Pdf.2 Flashcards

1
Q

independent paths in the code at least once.
☞ ______________

  1. logical decisions on their true and false sides.
    ☞ ______________
  2. loops at their boundaries and within their bounds.
    ☞ ___________
  3. internal data structures to ensure their validity.
    ☞ _____________
A

Basis Path Testing
Condition Testing
Loop Testing
Data Flow Testing

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

__________ executes the true and false value of each simple logical condition in a component

A

Condition testing

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

WHITE BOX TESTING: CONDITION TESTING

Errors in a condition result from errors in:

____________ - (a rel-op b) where rel-op={<, ≤, =, ≠, ≥, >}
may be negated with NOT, e.g., a≤b; NOT(a≤b)

__________ two or more simple conditions connected with
AND, OR, e.g., (a>b) AND (c<d)

______________ (E1 rel-op E2) where E1 and E2 are arithmetic
expressions, e.g., ((a*b+c)>(a+b+c))

____________ non relational expressions (e.g., NOT A)

A

simple condition
compound condition
relational expression
Boolean expression

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

WHITE BOX TESTING: CONDITION TESTING

_____________
For a compound condition C, test true and false branches of C
and every simple condition of C.

e.g., for C = (a>b) AND (c<d) we test for:
C TRUE and FALSE
a>b TRUE and FALSE
c<d TRUE and FALSE

A

Branch testing

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

WHITE BOX TESTING: CONDITION TESTING
___________
For an expression E1 rel-op E2, we test using values that make:
E1 greater than E2, E1 equal to E2, and E1 less than E2.

– This guarantees detection of rel-op error if E1 and E2 are _______.
– To detect errors in E1 and E2, the difference between E1 and E2 for
the tests that make E1 greater than E2 and E1 less than E2 should be
as ______ as possible.

A

Domain testing
correct
small

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

WHITE BOX TESTING: LOOP TESTING
Simple Loops (n iterations)
1. 0, 1, 2 passes through the loop.
2. m passes through the loop where m<n.
3. n-1, n, n+1 passes through the loop.

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

executes loops at and within their bounds.

A

Loop testing

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

WHITE BOX TESTING: LOOP TESTING(
Simple Loops (n iterations)
1. ______ passes the loop.
2. ______ passes through the loop where m<n.
3. ________ passes through the loop.

A

0, 1, 2
m
n-1, n, n+1

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

WHITE BOX TESTING: LOOP TESTING(
Nested Loops
1. Conduct _________ for the innermost loop while holding the outer loops at their minimum iteration values.

  1. Work ______, conducting simple loop tests for the next innermost loop.
  2. Continue until all the loops have been tested.

Tests grow ____________ with level of nesting!

A

simple loop tests
outward

geometrically

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

WHITE BOX TESTING: LOOP TESTING
3. Concatenated Loops
☞If loops are independent
→ use __________
☞If loops are dependent (i.e., a loop depends
on a variable set in another loop)
→ use __________

A

simple loop testing
nested loop testing

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

WHITE BOX TESTING: LOOP TESTING
. Unstructured Loops
☞Refactor the code!!!

These _______ have the highest likelihood of uncovering
errors with the minimum amount of effort and test overlap.

A

loop test

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

WHITE BOX TESTING: DATA FLOW TESTING

_________ ensures that the value of a variable is
correct at certain points of execution in the code.

Select test paths according to the locations of
definitions (S) and uses (S’) of a variable (X)

____ is the set of [X, S, S´] where X is
not redefined between S and S´.

A testing strategy: Every DU chain must be covered ______.
For every variable, do a test along the path from where the
variable is _______ to the statement(s) where the variable is used.
These tests can be combined with _______

A

Data flow testing
Definition Use (DU) Chain (X)

once
defined
basis path testing

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

DESIGN TESTS: BLACK BOX TESTING

Black box tests attempt to find:
– _________ functions
– ___________ errors
– __________________ errors
– _________ errors
– ___________ errors

To achieve reasonable testing, a black box test case should cover a
_____________, not just a single value. That is, it
should tell us something about the presence or ________ of a class
of errors (e.g., all character data is correctly/incorrectly processed).

A

incorrect or missing
interface incompatibility

data structure or external database access
performance

initialization and termination

range of input or output values

absence

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

EQUIVALENCE PARTITIONING

__________ creates subdomains by grouping inputs
and outputs by type to create test coverage of a class of errors.

 Divide the input/output data of a component into partitions of
equivalent data.
 The equivalence partitions are usually derived from the
requirements specification.
 Test cases are designed to cover each equivalence partition at
least once.

A COMMON PARTITIONING HEURISTIC
Select subdomains based on _______ inputs/outputs.
For testing, select “______” values “inside” a subdomain.

A

Equivalence partitioning

valid and invalid

typical

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

EQUIVALENCE PARTITIONING:
SUBDOMAIN SELECTION HEURISTICS

If the input is a ______ → one valid and two invalid subdomains:
invalid: less than range
valid: in range
invalid: greater than range

If the input is a _______ → one valid and two invalid subdomains:
invalid: less than specific value
valid: specific value
invalid: greater than specific value

If the input is a set of _________ → one valid and one invalid subdomain:
invalid: not member of set
valid: member of set

If the input is ___________ → one valid and one invalid subdomain:
invalid: non-Boolean
valid: Boolean

A

range
specific value
related values
Boolean

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

BOUNDARY TESTING
More errors occur at the ________
of a subdomain than in the “center”.

Why?
– off-by-one bugs
– forget to handle empty container/null object
– overflow errors in arithmetic
– program does not handle aliasing of objects

Small subdomains at the “boundaries” of the main subdomains
have a ________ probability of revealing these common errors.

For testing, select values at the
_______ of a main subdomain.

A

“boundaries”
high
“boundaries”

17
Q

BOUNDARY TESTING:
TEST VALUE SELECTION HEURISTICS
1. If the input is a ________ and is bounded by a and b, then use a, b, and
values just above and just below a and b, respectively.

  1. If the input is a number of _____ values, use the minimum and the
    maximum of the values and values just above and just below them,
    respectively. (Can also be applied to a single specific input value.)

3.If the input is a __________, test all values in the set (if possible) and
one value outside the set

A

range

discrete

set of values

18
Q

BOUNDARY TESTING:
TEST VALUE SELECTION HEURISTICS

  1. If the input is a ________, test for both Boolean values (T, F) and for a
    non-Boolean value.
  2. Apply guidelines 1 and 2 to create output values at the minimum and
    maximum expected values.
    E.g., if the output is a table, create a minimum size table (1 row) and a
    maximum size table.
  3. If data structures have _______, test these boundary values and
    values just above and just below them, respectively.
    E.g., for an array with bounds 1 to 10 → test array index = 0, 1, 2, 9, 10, 11.
A

Boolean

boundaries

19
Q

BLACK BOX TESTING: STATE-BASED TESTING
Some programs can be in many different states simultaneously.

A

THREAD TESTING
object oriented systems.

20
Q

BLACK BOX TESTING: STATE-BASED TESTING
Some programs can be in many different states simultaneously.

21
Q

BLACK BOX TESTING: STATE-BASED TESTING

 ________ focuses on comparing the resulting state of
a class with the expected state.
☞ Derive test cases using ___________ for a class.
 Derive a representative set of __________ for each
transition (similar to equivalence testing).
 Check the _________ or links of the class after applying a
“stimuli” to determine if the specified state has been reached.
☞ We first need to put the class in the desired state
before applying the “stimuli”.

A

State-based testing
state machine diagram
“stimuli” (events)
attributes

22
Q

REGRESSION TESTING
 Whenever you find a bug:
– _________ it (before you fix it).
– Record the _____________.
– Record the _________.
– Put everything into the ________
– Then, ___________.
 Why is this a good idea?

– It helps to populate the test suite with good tests.
– It protects against changes that reintroduce the bug.
☞It happened once, so it might happen again!

A

Reproduce
input that produced that bug
correct output
test suite.
fix the bug and verify the fix