Test Adequacy Using Control Flow Flashcards
T is considered adequate with respect to the
statement coverage criterion if the statement
coverage of T with respect to (P,R) is ____
1
Sub i is the number of what?
Unreachable code
Sub c is the number of what?
Covered code
Sub e is the number of what?
Code in the program
Logical statements on the same line should be:
Separately counted
T/F Counting syntactical markers, or not, is an operational definition choice
T
T/F If syntactical markers are counted, they should be
treated as statements and all counted
T
T/F If syntactical markers are not counted, none should
be counted… including else
T
What is a condition also known as?
Predicate
Any expression that evaluates to true or false constitutes a ____
Condition
T/F x and x + y are invalid conditions
False, depends on the language
T/F The constants 1 and 0 may correspond to, respectively, true and false
T
T/F The constant 0 may correspond to false and any
non-zero constant corresponds to true
T
T/F Odd constants may correspond to true and even
constants may correspond to false
T
T/F A simple condition uses any boolean operator
F, only NOT operator
Simple conditions are also referred to as ____
or ____ conditions because they cannot be
parsed any further into two or more conditions
Atomic, elementary
T/F A compound condition is made up of two or
more simple conditions joined by one or more
Boolean operators
T
Any condition can serve as a decision in the appropriate context within a program
Conditions as decisions
What do most high-level languages provide to serve as contexts for decisions?
If, while, and switch statements
A decision can have three possible outcomes, what are they?
True, false, undefined
T/F When the condition corresponding to a decision evaluates to true or false, the decision to take one or the other path is made
T
T/F The evaluation of a condition never fails
F
When the evaluation of a condition fails, what happens to the corresponding decisions outcome?
Undefined
When does a condition become a decision?
When it is used within the appropriate context, such as an if statement
A decision is considered ____ if the flow of control has been diverted to all possible destinations that correspond to this decision
Covered
What is decision coverage also known as?
Branch decision coverage
A decision implied by the ____ statement is considered covered if during one or more executions of the program under test, the flow of control has been diverted to all possible destinations
Switch
T/F The domain of decision coverage consists of all
decisions in the program under test
T
What contributes to one decision?
If and while
What contributes to more than one decision?
Switch
When is a compound condition considered to be covered?
Each simple condition it is comprised of is also covered
T/F Decision coverage is concerned with the coverage
of decisions regardless of whether a decision
corresponds to a simple or a compound condition
T
T/F When a decision is composed of a compound condition, decision coverage does not imply that each simple condition within a compound condition has taken both values true and false
T
T/F Condition coverage requires each decision to have taken both outcomes
F
What is condition/decision coverage is also known as?
Branch condition coverage
Using condition coverage on some compound condition C implies that each simple condition within C has been evaluated to true and false. Does it imply that all combinations of the values of the individual simple conditions in C have been exercised?
No
A ____ is a program unit comprised of a textual code sequence that terminates in a jump to the beginning of another code sequence and jump
Linear Code Sequence and Jump
When control arrives at statement X, follows through to statement Y, and then jumps to statement Z, we say that the LCSAJ (X, Y, Z) is ____
Traversed
When does multiple condition coverage become expensive?
When there are many embedded simple conditions
When a compound condition C contains n simple conditions, the maximum number of tests required to cover C is ____
2^n
MC/DC coverage requires that every compound condition in a program must be tested by demonstrating that each simple condition within the compound condition has an ____ on its outcome
Independent effect
T/F MC/DC coverage is a stronger criterion than the multiple condition coverage criterion
F, weaker
T/F Each simple condition in MC/DC affects the outcome of C independently
T
T/F Conditions that are not part of a decision are also included in the set of conditions to be covered
T
T/F In some cases, an adequate test set need only demonstrate the independent effect of any one occurrence of the coupled condition
T
What are the three error types in a compound condition?
Missing condition, incorrect boolean operator, mixed
T/F Satisfying the MC/DC adequacy means that errors made while coding conditions will be revealed
F
T/F An MC/DC-adequate test is likely to reveal more
errors than a decision or condition coverage adequate test
T
What are two problems with MC/DC?
Short circuit operators
Multiple occurrences of a condition