Software Testing White Box Flashcards
What is White Box Testing?
- Also refers to as structural testing.
- Concerned with the internal path & structure of the program.
- Have knowledge of the internal working of the software.
- Tester needs to have programming skills.
- Ultimate goal is to cover all possible paths of execution of the program.
What is Path Testing?
Aims to develop test cases that will guarantee execution of every program statement at least once. This helps determine all the errors and bugs underlying the program along a defined program route.
Cyclomatic complexity (CC) – a software metric to measure the complexity
of the code structure.
CC <= 4 : good
CC between 5 and 7 : medium complexity
CC between 8 and 10 : high complexity
CC > 10 : extreme complexity
What are the steps in Path Testing?
- Step 1 – Construct the flow graph based on the code given
- Step 2 – Determine the Cyclomatic Complexity of the function
- Step 3 – Identify independent executable paths
- Step 4 – Design the test cases
- Step 5: Identify the input test data and expected results
What is the cyclomatic complexity equation?
E - n + 2
E = Number of edges (arrows shown on a flow graph)
N = Number of nodes (circles shown on a flow graph)
Calculate the cyclomatic complexity of this:
def computeScore(score):
studentScore = “”
if (score >= 79):
studentScore = “Distinction”
elif (score >= 59):
studentScore = “Merit”
elif (score >= 39):
studentScore = “Pass”
else:
studentScore = “Fail”
return studentScore
E = 12, N = 10
CC = 12 - 10 + 2 = 4
What does the cyclomatic complexity value mean?
Number of executable paths
Black Box testing vs White Box testing
Black Box: Conducts tests based on the functional requirements of the system.
Attempts to find errors based on external behaviours such as:
o Incorrect or missing functionality
o Interface errors
o Errors in data structure used by interfaces
Does not have knowledge of the internal working of the software.
White Box: Concerned with the internal path & structure of the program.
Ultimate goal is to cover all possible paths of execution of the program.
Have knowledge of the internal working of the software.