Software Testing White Box Flashcards

1
Q

What is White Box Testing?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Path Testing?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the steps in Path Testing?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the cyclomatic complexity equation?

A

E - n + 2
E = Number of edges (arrows shown on a flow graph)
N = Number of nodes (circles shown on a flow graph)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

E = 12, N = 10
CC = 12 - 10 + 2 = 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the cyclomatic complexity value mean?

A

Number of executable paths

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Black Box testing vs White Box testing

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly