Mathematical Preliminaries Flashcards

1
Q

T/F The goal of predicate-based test generation is to generate tests from a predicate p that guarantee the detection of any error that belongs to a class of errors in the coding of p

A

T

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

What does the + sign represent?

A

OR

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

What does a multiplication mean?

A

AND

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

What is the condition part of the statement

A

Predicate

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

T/F A predicate can be converted to a Boolean expression by replacing each relational expression with a distinct Boolean variable

A

T

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

A Boolean variable or a relational expression

A

Simple predicate

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

Join one or more simple predicates using bop

A

Compound predicate

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

One or more Boolean variables joined by bop

A

Boolean expression

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

A Boolean expression is ____ if each variable in the

expression occurs only once

A

Singular

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

A Boolean expression is in ____ _____ ____ if it is represented as a sum of product terms

A

Disjunctive normal form

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

A Boolean expression is in ___ ____ ____ if it is represented as a product of sums

A

Conjunctive normal form

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

T/F Any Boolean expression in CNF can be converted to an equivalent DNF and vice versa

A

T

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

Captures flow of control within a program

A

Control flow graph

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

What has a finite set N of nodes and a finite set E of edges

A

Control flow graph

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

What does descendant mean for nodes?

A

There is a path from one node to the next (m to n)

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

What does proper descendant mean for nodes?

A

m != n (m and n are not the same node)

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

How do you denote all successor nodes of n?

A

succ(n)

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

How do you denote all predecessor nodes of n

A

pred(n)

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

If there is an edge (n,m) in E, what is n and what is m?

A

m is the successor of n. n is the predecessor of m

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

A path through G is ____if the first node along the path is Start and the terminating node is End.

A

complete

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

A path p is ____ if there exists at least one test case which when input to program P causes p to be traversed

A

feasible

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

T/F Whether a path p through program P is feasible is, in general, an undecidable problem

A

T

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

T/F Any algorithm can be expressed using only three

control structures

A

T

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

T/F The cyclomatic complexity of a nonstructured program is at least 2

A

F, 3

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

T/F A flow graph is reducible to a structured program if and only if it contains a loop with two or more exits

A

F, if it DOES NOT CONTAIN a loop with two or more exits

26
Q

G has only one path if and only if….

A

V(G) = 1

27
Q

Inserting a new edge in G increases V(G) by _

A

1

28
Q

T/F V(G) depends only on the decision structure of G

A

T

29
Q

T/F V(G) is the maximum number of linearly independent paths in G

A

T

30
Q

What is V(G)

A

Cyclomatic Complexity

31
Q

V(G) is always >= _

A

1

32
Q

When is a boolean expression singular?

A

Each variable in the expression occurs only once

33
Q

Two expressions are ____ ____ if they do not share any variable

A

Mutually singular

34
Q

What is disjunctive normal form (DNF)?

A

Sum of product terms

35
Q

What is conjunctive normal form (CNF)?

A

Product of sums

36
Q

In an abstract syntax tree, what are leaf nodes?

A

Boolean or relational expressions

37
Q

In an abstract syntax tree, what are internal nodes?

A

Boolean operator

38
Q

T/F All loops are basic blocks by themselves

A

F, only pre-test loops

39
Q

T/F if statements are the last statement in a basic block

A

T

40
Q

T/F If a path is infeasible, you can cover the true and false branch

A

F

41
Q

T/F Not all programs can be written as a structured program

A

F, they can

42
Q

What is the structured program theorem?

A

Any program can be written as a structured program

43
Q

For nodes n and m in N, n ____ m if n lies on every path from Start to m

A

Dominates

44
Q

n is the ____ ____ of m when n is the last dominator of m along a path from Start to m

A

Immediate dominator

45
Q

If n dominates m, how is it denoted?

A

dom(n,m)

46
Q

If n is the immediate dominator of m, how is it denoted?

A

idom(n,m)

47
Q

T/F Each node, except for Start, has a unique immediate dominator

A

T

48
Q

T/F Start has a unique immediate dominator

A

F

49
Q

For nodes n and m in N, n ____ m if n lies on every path from m to the End node

A

Post-dominates

50
Q

If n post-dominates m, how is it denoted?

A

pdom(n,m)

51
Q

n is the ____ ____ of m if n is the first post-dominator along a path from m to End

A

immediate post-dominator

52
Q

If n is the immediate post-dominator of m, how is it denoted?

A

ipdom(n,m)

53
Q

T/F Each node, except for End, has a unique

immediate post-dominator

A

T

54
Q

A sequence of instructions forms a ____ ____ if the instruction in each position dominates, or always executes before all those in later positions and no other instruction executes between two instructions in the sequence

A

Basic block

55
Q
T/F Inserting or deleting functional statements to G
affects V(G)
A

F, it does not

56
Q

When is a path through G considered complete?

A

The first node along the path is Start and the terminating node is End

57
Q

When is a path considered feasible?

A

There exists at least one test case which when input to program P causes p to be traversed

58
Q

When is a flow graph reducible to a structured program?

A

If and only if it does not contain a loop with two or more exits

59
Q

__ is the maximum number of linearly independent paths in G

A

V(G)

60
Q

When are two or more expressions mutually singular?

A

When they don’t share any variable

61
Q

T/F if statements are the first statement in a basic block

A

F, last

62
Q

End has a unique immediate post-dominator

A

F