Professional Documents
Culture Documents
Software
• Use cases assist in the design of tests to uncover errors at the software validation level.
Operability
Understandability
Observability
Stability. Testability
Controllability
Simplicity Decomposability
Dr. Selva Kumar S (Scope- VIT AP)
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 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:
2.V(G) = E - N + 2
3. V (G) = P + 1
Where,
Where,
E – Number of edges
P = Number of predicate nodes (node that contains condition)
N – Number of Nodes
Dr. Selva Kumar S (Scope- VIT AP)
How to Calculate Cyclomatic Complexity
Control Flow Chart
Example
Cyclomatic Complexity
A = 10
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 A
Print B
Print C
Dr. Selva Kumar S (Scope- VIT AP)
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
• 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
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.
Dr. Selva Kumar S (Scope- VIT AP)
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
Dr. Selva Kumar S (Scope- VIT AP)
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.
• 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
Dr. Selva Kumar S (Scope- VIT AP)
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
• The events trigger states which become scenarios and a tester needs to
test them.
• The tester can use his/her experience with the application behavior and
functionalities to guess the error-prone areas.
• Many defects can be found using error guessing where most of the
developers usually make mistakes.
•Divide by zero.
Examples •Handling null values in text fields.
•Accepting the Submit button without any value.
•File upload without attachment.
upload
•FileS (Scope-
Dr. Selva Kumar with
VIT AP) 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
Graph notation
Simple Dr.
Example
Selva Kumar S (Scope- VIT AP)
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
• 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
the application. application.
• This is a higher level testing such as functional • This type of testing is performed at a lower
testing. level of testing such as Unit Testing,
Integration Testing.
• Black box testing requires Requirement • White Box testing requires Design documents
specification to test. with data flow diagrams, flowcharts etc.
• Black box testing is done by the testers. • White box testing is done by Developers or
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