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
T/F A flow graph is reducible to a structured program if and only if it contains a loop with two or more exits
F, if it DOES NOT CONTAIN a loop with two or more exits
26
G has only one path if and only if....
V(G) = 1
27
Inserting a new edge in G increases V(G) by _
1
28
T/F V(G) depends only on the decision structure of G
T
29
T/F V(G) is the maximum number of linearly independent paths in G
T
30
What is V(G)
Cyclomatic Complexity
31
V(G) is always >= _
1
32
When is a boolean expression singular?
Each variable in the expression occurs only once
33
Two expressions are ____ ____ if they do not share any variable
Mutually singular
34
What is disjunctive normal form (DNF)?
Sum of product terms
35
What is conjunctive normal form (CNF)?
Product of sums
36
In an abstract syntax tree, what are leaf nodes?
Boolean or relational expressions
37
In an abstract syntax tree, what are internal nodes?
Boolean operator
38
T/F All loops are basic blocks by themselves
F, only pre-test loops
39
T/F if statements are the last statement in a basic block
T
40
T/F If a path is infeasible, you can cover the true and false branch
F
41
T/F Not all programs can be written as a structured program
F, they can
42
What is the structured program theorem?
Any program can be written as a structured program
43
For nodes n and m in N, n ____ m if n lies on every path from Start to m
Dominates
44
n is the ____ ____ of m when n is the last dominator of m along a path from Start to m
Immediate dominator
45
If n dominates m, how is it denoted?
dom(n,m)
46
If n is the immediate dominator of m, how is it denoted?
idom(n,m)
47
T/F Each node, except for Start, has a unique immediate dominator
T
48
T/F Start has a unique immediate dominator
F
49
For nodes n and m in N, n ____ m if n lies on every path from m to the End node
Post-dominates
50
If n post-dominates m, how is it denoted?
pdom(n,m)
51
n is the ____ ____ of m if n is the first post-dominator along a path from m to End
immediate post-dominator
52
If n is the immediate post-dominator of m, how is it denoted?
ipdom(n,m)
53
T/F Each node, except for End, has a unique | immediate post-dominator
T
54
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
Basic block
55
``` T/F Inserting or deleting functional statements to G affects V(G) ```
F, it does not
56
When is a path through G considered complete?
The first node along the path is Start and the terminating node is End
57
When is a path considered feasible?
There exists at least one test case which when input to program P causes p to be traversed
58
When is a flow graph reducible to a structured program?
If and only if it does not contain a loop with two or more exits
59
__ is the maximum number of linearly independent paths in G
V(G)
60
When are two or more expressions mutually singular?
When they don't share any variable
61
T/F if statements are the first statement in a basic block
F, last
62
End has a unique immediate post-dominator
F