Control Flow Testing Flashcards

(19 cards)

1
Q

What are the two basic program statements

A
  1. Assignment Statements (x = 2 * y;)
  2. Conditional Statements (if(), for(), while(),…)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is control flow?

A

Successive execution of program statements where conditional statements alter the default flow

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

What is a program path?

A

Sequence of statements from entry to exit

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

What are the assumptions for control flow?

A
  1. We have correct specifications
  2. Definitions of data are correct
  3. Data can be accessed correctly
  4. All know bugs have been resolved
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What drives the control flow?

A

The logic in the code

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

What is a control flow graph?

A

It is a graphical representation of a program’s control structure

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

What is a complete path?

A

Path that goes from the beginning of the program to the end of the program

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

Why are complete paths useful?

A

They are useful because we can’t start execution randomly wherever we want w/out modifying the code

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

What do the different symbols in control graph mean?

A
  • Diamond (Decision point) - where control can diverge
  • Square (Process block) - statements uninterrupted by decisions or junctions
  • Circle (Junction point) - where control flow merges
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why are complete paths interesting?

A

Complete path are the only paths that are able to be executed without changing code

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

What is complete testing in Control Flow testing?

A
  • Path Coverage
  • Statement Coverage
  • Branch Coverage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is path coverage?

A

Every complete path (start to end) executed

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

What is statement coverage?

A

Every line/statement executed at least once and observing the output

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

What is branch coverage?

A

Every branch (true/false of every decision) executed at least once

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

What are the two types of paths?

A
  1. Executable path - there exists input so that path is executed
  2. Infeasible path - there is no input to execute the path
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is 100% statement coverage?

A

All the statements have been executed at least once; Cover all Assignment & Conditional statements

17
Q

What is 100% branch coverage?

A

Selecting a set of paths such that each branch is included on some path

18
Q

What is a predicate? Path predicate?

A
  • A predicate is a logical function evaluated at a decision point
  • A path predicate is the set of predicate associated with a path
19
Q

What is control flow dominated by?

A
  • Statement testing/Coverage
  • Branch testing/Coverage
    … path coverage has too large of a domain