Professional Documents
Culture Documents
Conventional
Software
Test Strategies for Conventional Software
The conventional applications, the software is tested
from two different perspectives:
• Internal program logic is exercised using “white box” test-case
design techniques.
• Use cases assist in the design of tests to uncover errors at the software validation level.
Software Testing Fundamentals
• Testability- Software testability is simply how easily [a computer program]
can be tested.
Operability
Understandability
Observability
Stability. Testability
Controllability
Simplicity Decomposability
Software Testing Fundamentals Cont’d
Testability:
Operability - The better it works, the more efficiently it can be tested.
Decomposability - By controlling the scope of testing, we can more quickly isolate problems and
perform smarter retesting.
Simplicity - The less there is to test, the more quickly we can test it.
Test Characteristics
• A good test has a high probability of finding an error.
• A good test is not redundant.
• A good test should be “best of breed”
• A good test should be neither too simple nor too complex.
White-box Testing
• White-box testing sometimes called glass-box or structural testing
• White box testing is a testing technique, that examines the program structure
and
derives test data from the program logic/code.
• Test cases derived to exercise the basis set are guaranteed to execute
every statement in the program at least one time during testing.
• Control flow depicts a program as a graph that consists of Nodes and Edges.
or
Example
•The Code complexity of the program can be defined using the formula:
IF B > C THEN
The graph shows seven
A=B
shapes(nodes), seven lines(edges),
ELSE hence cyclomatic complexity is 7-
A=C 7+2 = 2.
ENDIF
Print B
How to Calculate Cyclomatic Complexity
Example Flow graph
i = 0;
n=4; //N-Number of nodes Cyclomatic Complexity
present in the graph
Cyclomatic Complexity
• V (G) >=1.
• Minimize complexity to 10
1.M can be the number of test cases to achieve branch coverage (Upper Bound)
2.M can be the number of paths through the graphs. (Lower Bound)
Example
High Testability
Medium Testability
Cost and effort is
Medium
20-40 Very complex Code
Low Testability
Cost and Effort
are high
>40 Not at all testable
Very high Cost and Effort
Uses of Cyclomatic Complexity
• Developers can assure that all the paths have been tested atleast once
• Using these metrics early in the cycle reduces more risk of the program
Independent Program Paths
• An independent path is any path through the program that introduces at
least one new set of processing statements or a new condition.
1-2-3-4-5-10-1-2-3-6-8-9-10-1-11
Finally, after obtaining the independent paths, test cases can be designed where
Design Test Cases
each test case represents one or more independent paths.
Graph Matrices
• The procedure for deriving the flow graph and even determining a set of
basis paths is amenable to mechanization.
• A data structure, called a graph matrix, can be quite useful for developing
a software tool that assists in basis path testing.
Loop Testing
Concatenated Unstructured
Simple loop Nested loop
loop loop
Why do Loop Testing
• Testing can fix the loop repetition issues.
• Make a passes through the loop where a<b, n is the maximum number
of passes through the loop
• Make b, b-1; b+1 passes through the loop where “b” is the maximum
number of allowable passes through the loop.
Loop Testing: Nested Loops
• Adjust all the other loops to their minimum value and start
with the deepest loop.
• Start a simple loop test on the innermost loop and keep the
outside loops at their minimum iteration parameter value.
• Conduct the test for the following loop and make your way
outwards.
Unstructured Loop
• This testing occurs throughout the Software Development and Testing Life
Cycle i.e in Unit, Integration, System, Acceptance, and Regression Testing
stages. This can be either Functional or Non-Functional.
Types of Black Box Testing
Equivalence Partitioning
Error Guessing
Comparison Testing
Black Box Testing Techniques Cont’d
1. Equivalence Partitioning
• This technique is also known as Equivalence Class Partitioning (ECP).
• In this technique, input values to the system or application are
divided into different classes or groups based on its similarity in the
outcome.
• Boundary refers to values near the limit where the behavior of the system changes.
• In boundary value analysis, both valid and invalid inputs are being tested to verify
the
issues. If we want to test a field where values from 1 to 100 should
be accepted,
then we choose the boundary values:
• 1-1,
• 1,
• 1+1,
• 100-1,
• 100,
• and 100+1.
Instead of using all the values from 1 to 100, we just use 0, 1, 2, 99, 100,
and 101.
Black Box Testing Techniques Cont’d
3. Decision Table Testing
simple if
the
user
provides
the
correct
username and password the user
will be redirected to the
homepage.
Black Box Testing Techniques Cont’d
• The events trigger states which become scenarios and a tester needs to
test them.
Black Box Testing Techniques Cont’d
• The tester can use his/her experience with the application behavior and
functionalities to guess the error-prone areas.
File upload with less than or more than the limit size.
Black Box Testing Techniques Cont’d
6. Graph-Based Testing Methods
• From this object graph, each object relationship is identified and test
cases are written accordingly to discover the errors.
• An activity diagram, showing the workflow when a user interacts with the system
• A state diagram, showing the states of a system and transitions between them
Black Box Testing Techniques Cont’d
Graph-Based Testing Methods -Major Steps
Graph notation
Sample Example
Comparison Testing
• Comparison testing identifies the strengths and weaknesses of
a software product against other software products that
already exist in the market and are readily used by the target
audience.
• Runs It is the number of rows that represents the number of test conditions to be
performed.
• Factors It is the number of columns that represent in the number of variables to be tested
Example 1
• It is a testing method without having knowledge • It is a testing method having knowledge about
about the actual code or internal structure of the actual code and internal structure of the
• This is a higher level testing such as functional • This type of testing is performed at a lower
Integration Testing.
etc.
Model-based Testing
• The model-based testing technique uses UML state diagrams
2. Traverse the behavioral model and specify the inputs that will force the software to
make the transition from state to state.
3. Review the behavioral model and note the expected outputs as the software makes the
transition from state to state.
5. Compare actual and expected results and take corrective action as required