Professional Documents
Culture Documents
Software Engineering: Slide Set 06: Software Testing
Software Engineering: Slide Set 06: Software Testing
Software Testing 2
Software Testing
• It also helps to identify errors, gaps or
missing requirements in contrary to the
actual requirements.
• To stay in business.
Software Testing 4
Importance of Software Testing
• To detect defects early, which helps in reducing the cost of
defect fixing.
• It will bring out all the errors, if any, while using the
software.
Software Testing 6
Why Start Testing Early ?
Software Testing 7
Why Start Testing Early ?
• Fact One :
Software Testing 9
Why Start Testing Early ?
• Figure 6.2 shows how phases are executed.
Software Testing 10
Why Start Testing Early ?
• Planning, analysis and code build will take more
time then planned !
Software Testing 11
Why Start Testing Early ?
• The deadline is not going to be moved at all:
promises have been made to customers, project
managers are going to lose their bonuses if they
deliver later past deadline !
Software Testing 12
Why Start Testing Early ?
• Fact Two :
Software Testing 14
Why Start Testing Early ?
• If you find the bug in the requirements
definitions, all you have to do is modify the
documented requirements.
Software Testing 15
Why Start Testing Early ?
• Figure 6.4, this is what you should do:
Software Testing 16
Why Start Testing Early ?
• Make testing part of each Phase in the software life
cycle.
Software Testing 18
Software Testing Myths
• Just as every field has its myths, so does the field of
Software Testing.
Software Testing 20
Software Testing Myths
• Myth 2: Testing is Time-Consuming.
Software Testing 21
Software Testing Myths
• Myth 3: Only Fully Developed Products are Tested.
Software Testing 22
Software Testing Myths
• Myth 4: Complete Testing is Possible.
Software Testing 23
Software Testing Myths
• Myth 5: A Tested Software is Bug-Free.
Software Testing 24
Software Testing Myths
• Myth 6: Missed Defects are due to Testers.
Software Testing 25
Software Testing Myths
• Myth 7: Testers are Responsible for Quality of Product.
Software Testing 26
Software Testing Myths
• Myth 8: Test Automation should be used wherever
possible to Reduce Time.
Software Testing 27
Software Testing Myths
• Myth 9: Anyone can Test a Software Application.
Software Testing 28
Software Testing Myths
• Myth 10: A Tester's only Task is to Find Bugs.
Software Testing 29
QA, QC and Testing
Quality Assurance Quality Control Testing
Software Testing 31
Testing and Debugging
• Testing:
Software Testing 32
Testing and Debugging
• Debugging:
– It involves identifying, isolating, and fixing the
problems/bugs.
1. Manual Testing
2. Automation Testing
Software Testing 34
Manual Testing
• Manual testing includes testing a software manually, i.e.,
without using any automated tool or any script.
Software Testing 35
Manual Testing
• There are different stages for manual testing such as:
– Unit Testing
– Integration Testing
– System Testing
Software Testing 36
Manual Testing
• Testers use test plans, test cases, or test scenarios to test a
software to ensure the completeness of testing.
Software Testing 37
Automation Testing
• Automation testing, which is also known as Test
Automation, is when the tester writes scripts and uses
another software to test the product.
Software Testing 39
Manual Vs Automation Testing
Software Testing 41
Black Box Testing
• The technique of testing without having any
knowledge of the interior workings of the application
is called black-box testing.
Software Testing 42
Black Box Testing
Advantages Disadvantages
Well suited and efficient for large code Limited coverage, since only a selected
segments. number of test scenarios is actually
performed.
Code access is not required. Inefficient testing, due to the fact that
the tester only has limited knowledge
about an application.
Clearly separates user's perspective Blind coverage, since the tester cannot
from the developer's perspective target specific code segments or error
through visibly defined roles. prone areas.
Large numbers of moderately skilled The test cases are difficult to design.
testers can test the application with no
knowledge of implementation,
programming language, or operating
systems.
Software Testing 43
White Box Testing
• White-box testing is the detailed investigation of
internal logic and structure of the code.
• The tester needs to have a look inside the source code and
find out which unit/chunk of the code is behaving
inappropriately.
Software Testing 44
White Box Testing
Advantages Disadvantages
As the tester has knowledge of the Due to the fact that a skilled tester is
source code, it becomes very easy needed to perform white-box testing,
to find out which type of data can the costs are increased.
help in testing the application
effectively.
It helps in optimizing the code. Extra Sometimes it is impossible to look into
lines of code can be removed which every nook and corner to find out
can bring in hidden defects. hidden errors that may create
problems, as many paths will go
untested.
Due to the tester's knowledge It is difficult to maintain white-box
about the code, maximum coverage testing, as it requires specialized tools
is attained during test scenario like code analyzers and debugging
writing. tools.
Software Testing 45
Grey Box Testing
• Grey-box testing is a technique to test the application
with having a limited knowledge of the internal
workings of an application.
Software Testing 46
Grey Box Testing
• Unlike black-box testing, where the tester only tests the
application's user interface; in grey-box testing, the tester
has access to design documents and the database. Having
this knowledge, a tester can prepare better test data and
test scenarios while making a test plan.
Software Testing 47
Grey Box Testing
Advantages Disadvantages
Offers combined benefits of black-box Since the access to source code is not
and white-box testing wherever available, the ability to go over the
possible. code and test coverage is limited.
Grey box testers don't rely on the The tests can be redundant if the
source code; instead they rely on software designer has already run a
interface definition and functional test case.
specifications.
Based on the limited information Testing every possible input stream is
available, a grey-box tester can unrealistic because it would take an
design excellent test scenarios unreasonable amount of time;
especially around communication therefore, many program paths will go
protocols and data type handling. untested.
Software Testing 48
Comparison of Testing Methods
Black Box Testing Grey Box Testing White Box Testing
The internal workings of The tester has limited Tester has full
an application need not knowledge of the knowledge of the
be known. internal workings of the internal workings of the
application. application.
Also known as closed- Also known as Also known as clear-box
box testing, data-driven translucent testing, as testing, structural
testing, or functional the tester has limited testing, or code-based
testing. knowledge of the insides testing.
of the application.
Performed by end-users Performed by end-users Normally done by
and also by testers and and also by testers and testers and developers.
developers. developers.
Software Testing 49
Comparison of Testing Methods
Black Box Testing Grey Box Testing White Box Testing
This can only be done by Data domains and Data domains and
trial-and-error method. internal boundaries can internal boundaries can
be tested, if known. be better tested.
Software Testing 50
Testing Levels
• There are different levels during the process of testing.
1. Functional Testing
2. Non-functional Testing
Software Testing 51
Functional Testing
• This is a type of black-box testing that is based on the
specifications of the software that is to be tested.
Software Testing 52
Five Steps of Functional Testing
Steps Description
The output based on the test data and the specifications of the
3 application.
The writing of test scenarios and the execution of test cases.
4
Software Testing 53
Types of Functional Testing
1. Unit Testing
2. Integration Testing
3. System Testing
4. Regression Testing
5. Acceptance Testing
6. Alpha Testing
7. Beta Testing
Software Testing 54
Unit Testing
1. Unit Testing:
Software Testing 56
Unit Testing
• Limitations of Unit Testing:
Software Testing 57
Integration Testing
2. Integration Testing:
Bottom-up Integration
1 This testing begins with unit testing, followed by tests of progressively
higher level combinations of units called modules or builds.
Top-down Integration
2 In this testing, the highest-level modules are tested first and
progressively, lower-level modules are tested thereafter.
• In a comprehensive software development environment,
bottom-up testing is usually done first, followed by top-
down testing.
Software Testing 60
System Testing
3. System Testing:
Software Testing 62
Regression Testing
4. Regression Testing:
Software Testing 63
Acceptance Testing
5. Acceptance Testing:
Software Testing 64
Acceptance Testing
5. Acceptance Testing:
Software Testing 65
Alpha Testing
6. Alpha Testing:
Software Testing 66
Alpha Testing
6. Alpha Testing:
• Spelling Mistakes
• Broken Links
• Cloudy Directions
Software Testing 68
Beta Testing
7. Beta Testing:
• Users will install, run the application and send their feedback
to the project team.
Software Testing 69
Beta Testing
7. Beta Testing:
• Getting the feedback, the project team can fix the problems before
releasing the software to the actual users.
• The more issues you fix that solve real user problems, the higher
the quality of your application will be.
Software Testing 71
Non-Functional Testing
• Some of the important and commonly used non-
functional testing types are discussed below:
1. Performance Testing
2. Load Testing
3. Stress Testing
4. Usability Testing
5. Security Testing
6. Portability Testing
Software Testing 72
Performance Testing
• It is mostly used to identify any bottlenecks or
performance issues rather than finding bugs in a
software.
– Network delay
– Client-side processing
– Database transaction processing
– Load balancing between servers
– Data rendering
Software Testing 73
Load Testing
• It is a process of testing the behavior of a software by
applying maximum load in terms of software accessing
and manipulating large input data.
Software Testing 74
Stress Testing
• Stress testing includes testing the behavior of a software
under abnormal conditions.
Software Testing 75
Stress Testing
• This testing can be performed by testing different
scenarios such as:
Software Testing 76
Usability Testing
• Usability testing is a black-box technique and is used to
identify any error(s) and improvements in the software
by observing the users through their usage and operation.
– Efficiency of Use
– Learn-Ability
– Memory-Ability
– Errors/Safety
– Satisfaction.
Software Testing 77
Security Testing
• Security testing involves testing a software in
order to identify any flaws and gaps from
security and vulnerability point of view.
Software Testing 78
Security Testing
• Listed below are the main aspects that security testing
should ensure:
– Confidentiality
– Integrity
– Authentication
– Availability
– Authorization
– Non-repudiation
– Software is secure against known and unknown vulnerabilities
– Software data is secure
Software Testing 79
Security Testing
• Listed below are the main aspects that security testing
should ensure:
Software Testing 80
Portability Testing
• Portability testing includes testing a software with the aim
to ensure its reusability and that it can be moved from
another software as well.
Software Testing 82
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
• Steps:
Software Testing 83
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
1. Draw a control flow graph- Any procedural design
can be translated into a control flow graph:
Software Testing 84
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
10
12
4
11
13
14
1
9
2
Software Testing 85
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
Straight Line of Code If - Then If – Then - Else
Software Testing 86
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
2. Calculate Cyclomatic Complexity:
• V(G) = 19 – 14 + 2 = 7
• Path 1: 1 - 2 - 3 - 5 - 7 - 9 - 11 - 13 - 14
• Path 2: 1 - 3 - 4 - 14
• Path 3: 1 - 3 - 5 - 6 - 14
• Path 4: 1 - 3 - 5 - 7 - 8 - 14
• Path 5: 1 - 3 - 5 - 7 - 9 - 10 - 14
• Path 6: 1 - 3 - 5 - 7 - 9 - 11 - 12 - 14
• Path 7: 1 - 3 - 5 - 7 - 9 - 11 - 13 - 14
Software Testing 88
McCabe’s Basis Path Testing
(A Technique Used for White Box Testing)
4. Generate test cases to exercise each path:
Software Testing 89
Graph Matrices
(A Technique Used for White Box Testing)
• Graph matrix method is an alternative approach of
finding number of basis paths in a flow graph.
Software Testing 90
Graph Matrices
(A Technique Used for White Box Testing)
1
3
e
5 b
f
4 d
g c
Software Testing 91
Graph Matrices
(A Technique Used for White Box Testing)
Nodes
3 d b
Software Testing 92