Graph Coverage Flashcards

1
Q

In a _____ box approach, we consider only the requirements or inputs for a test

A

black

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

In a _____ box approach, we factor in the program implementation to our tests

A

white

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

Describe statement coverage and branch coverage

A

Statement coverage: How many statements did the suite test

Branch coverage: How many of the condition outcomes were tested

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

In Control Flow Graphs, what do nodes and edges represent?

A

Nodes: Program Code
Edges: Execution paths that the program may take

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

What are the 4 types of nodes in a Control Flow Graph? Describe them.

A

Entry Node: 0 incoming edges
Exit Node: 0 outgoing edges
Decision/Branch Node: >1 outgoing edges
Join Node: >1 incoming edges

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

In Control Flow Graphs, straight line sequences of codes are ______ into basic blocks

A

grouped

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

Node coverage can be more useful than statement. Why?

A

We can remove irrelevant information as lines of code will be grouped together and removes double counting

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

In a CFG, statement and branch coverage can be replaced with what?

A

Node and Edge coverage

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

How do node and edge coverage compare?

A

Edge coverage tests everything that statement coverage does, as you are testing the edges, rather than the nodes of the graph

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

Is full coverage realistic in practice? Why?

A

No, because of reachability (syntactic [early returns], semantic [condition never false])

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

In CFG coverage, the ____ taken by each test can matter (the combinations of our conditions matter).

A

path

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

Is it feasible to test all paths in a CFG? Why?

A

No, because there can be a graph with many decisions and there can be loops (infinite paths)

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

How do we compromise when we test paths in a CFG? Are these compromises good?

A

Edge pair coverage: Test paths with length <= 2 (related if statements tend to be grouped)
Specified path coverage: Given a number k, test k paths

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

What is a simple path? What is a prime path?

A

A path between nodes where no node appears more than once, except maybe for the first and last
A prime path is a simple path that is not a subpath of any other simple path

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

What is the use of a simple path when testing CFGs?

A

Captures the acyclic behaviors of a program

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

When finding simple paths of a graph, we create a finite set of ways that one _________ of a loop may interact with the next

A

iterations

17
Q

What do prime paths provide when testing CFGs?

A

Captures notions of how to bypass a loop or have one iteration of the loop affect the next

18
Q

What is prime path coverage?

A

Cover all prime paths in a CFG with testing

19
Q

What are the intuition for prime paths?

A

The way to enter, iterate, and exit a loop

20
Q

Prime path coverage tests are only good for testing _______ loops. What do they miss?

A

critical

Bugs that happen after a certain number of iterations, miss combinations based in decisions

21
Q

What are the subsumption relationships of all the CFG test coverages?

A

All
Prime / Edge pair coverage
Edge
Node

22
Q

One test may cover ______ prime paths

A

multiple