Top Banner
Black-Box Testing Techniques II Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 5
94

Black-Box Testing Techniques II

Jan 02, 2016

Download

Documents

cassidy-rosales

Black-Box Testing Techniques II. Software Testing and Verification Lecture 5. Prepared by Stephen M. Thebaut, Ph.D. University of Florida. Black-Box Test Case Design Techniques Considered. Partition testing Combinatorial Approaches Boundary Value Analysis Intuition & Experience. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Black-Box Testing Techniques II

Black-Box Testing Techniques II

Prepared by

Stephen M. Thebaut, Ph.D.

University of Florida

Software Testing and Verification

Lecture 5

Page 2: Black-Box Testing Techniques II

Black-Box Test Case Design Techniques Considered

• Partition testing

• Combinatorial Approaches

• Boundary Value Analysis

• Intuition & Experience

Page 3: Black-Box Testing Techniques II

Cause-Effect Analysis

• Cause-Effect Analysis is a combinatorial approach that can be viewed as a logical extension of partition testing.

• It extends the idea of partitioning a multi-dimensional input space by providing a systematic means for generating test case templates to cover different combinations of input “Causes” resulting in output “Effects.”

Page 4: Black-Box Testing Techniques II

Cause-Effect Analysis

• Cause-Effect Analysis is a combinatorial approach that can be viewed as a logical extension of partition testing.

• It extends the idea of partitioning a multi-dimensional input space by providing a systematic means for generating test case templates to cover different combinations of input “Causes” resulting in output “Effects.”

Page 5: Black-Box Testing Techniques II

Causes and Effects

• A CAUSE may be thought of as a distinct input condition, or an “equivalence class” of input conditions.

• An EFFECT may be thought of as a distinct output condition or change in program state.

Page 6: Black-Box Testing Techniques II

Causes and Effects

• A CAUSE may be thought of as a distinct input condition, or an “equivalence class” of input conditions.

• An EFFECT may be thought of as a distinct output condition or change in program state.

Page 7: Black-Box Testing Techniques II

Causes and Effects

• Causes and Effects are represented as Boolean variables.

• The logical relationships among them CAN (but need not) be represented as one or more Boolean graphs.

Page 8: Black-Box Testing Techniques II

Causes and Effects

• Causes and Effects are represented as Boolean variables.

• The logical relationships among them CAN (but need not) be represented as one or more Boolean graphs.

Л

V Causes Effects

Page 9: Black-Box Testing Techniques II

C-E Analysis Process Steps

1. Identify Causes and Effects

– The most critical and usually the most difficult step

– Choose an appropriate level of abstraction.

– Divide and conquer as necessary.

– Effects may or may not be mutually exclusive.

Page 10: Black-Box Testing Techniques II

C-E Analysis Process Steps

1. Identify Causes and Effects

– The most critical and usually the most difficult step

– Choose an appropriate level of abstraction.

– Divide and conquer as necessary.

– Effects may or may not be mutually exclusive.

Page 11: Black-Box Testing Techniques II

C-E Analysis Process Steps

1. Identify Causes and Effects

– The most critical and usually the most difficult step

– Choose an appropriate level of abstraction.

– Divide and conquer as necessary.

– Effects may or may not be mutually exclusive.

Page 12: Black-Box Testing Techniques II

C-E Analysis Process Steps

1. Identify Causes and Effects

– The most critical and usually the most difficult step

– Choose an appropriate level of abstraction.

– Divide and conquer as necessary.

– Effects may or may not be mutually exclusive.

Page 13: Black-Box Testing Techniques II

C-E Analysis Process Steps

1. Identify Causes and Effects

– The most critical and usually the most difficult step

– Choose an appropriate level of abstraction.

– Divide and conquer as necessary.

– Effects may or may not be mutually exclusive.

Page 14: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

2. Deduce Logical Relationships and Constraints

– Relationships take the form of conditionals and utilize the logical operators AND, OR, and NOT.

– Constraints describe relationships among Causes that allow for the identification of infeasible (i.e., impracticable) combinations.

Page 15: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

2. Deduce Logical Relationships and Constraints

– Relationships take the form of conditionals and utilize the logical operators AND, OR, and NOT.

– Constraints describe relationships among Causes that allow for the identification of infeasible (i.e., impracticable) combinations.

Page 16: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

2. Deduce Logical Relationships and Constraints

– Relationships take the form of conditionals and utilize the logical operators AND, OR, and NOT.

– Constraints describe relationships among Causes that allow for the identification of infeasible (i.e., impracticable) combinations.

(cont’d)

Page 17: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

2. Deduce Logical Relationships and Constraints (cont’d)

– Boolean graphs provide a convenient and economical way to visualize relationships and constraints.

Page 18: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

3. Identify an appropriate Test Case Selection Strategy

– Determines the number and nature of Cause-combinations to be considered.

– Strategies can be designed to meet a variety of coverage requirements/ cost constraints.

Page 19: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

3. Identify an appropriate Test Case Selection Strategy

– Determines the number and nature of Cause-combinations to be considered.

– Strategies can be designed to meet a variety of coverage requirements/ cost constraints.

Page 20: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

3. Identify an appropriate Test Case Selection Strategy

– Determines the number and nature of Cause-combinations to be considered.

– Strategies can be designed to meet a variety of coverage requirements/ cost constraints.

Page 21: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

4. Construct a Test Case Coverage Matrix

– Typically involves tracing through the Cause-Effect relationships to identify combinations of Causes resulting in each Effect according to the selection strategy chosen.

– This can be extremely tedious if done manually...

Page 22: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

4. Construct a Test Case Coverage Matrix

– Typically involves tracing through the Cause-Effect relationships to identify combinations of Causes resulting in each Effect according to the selection strategy chosen.

– This can be extremely tedious if done manually...

Page 23: Black-Box Testing Techniques II

C-E Analysis Process Steps (cont’d)

4. Construct a Test Case Coverage Matrix

– Typically involves tracing through the Cause-Effect relationships to identify combinations of Causes resulting in each Effect according to the selection strategy chosen.

– This can be extremely tedious if done manually...

Page 24: Black-Box Testing Techniques II

Question…

To what extent do you think CASE support might be applicable to each step in the process? For which steps do you think it might be most important?

Page 25: Black-Box Testing Techniques II

Question…

To what extent do you think CASE support might be applicable to each step in the process? For which steps do you think it might be most important?

(We’ll come back to this after illustrating the process steps with some examples.)

Page 26: Black-Box Testing Techniques II

Illustration of Step 1 (Identify Causes and Effects)

The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question.

A non-resident will pay 1% of the gross pay in city tax.

Residents pay on the following scale:

- If gross pay is no more than $30,000, the tax is 1%.

- If gross pay is more than $30,000, but no more than

$50,000, the tax is 5%.

- If gross pay is more than $50,000, the tax is 15%.

Page 27: Black-Box Testing Techniques II

Guidelines for identifying Causes and Effects

• Underline words or phrases in the specification that correspond to input/output conditions or changes in state.

Page 28: Black-Box Testing Techniques II

Guidelines for identifying Causes and Effects (cont’d)

The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question.

A non-resident will pay 1% of the gross pay in city tax.

Residents pay on the following scale:

- If gross pay is no more than $30,000, the tax is 1%.

- If gross pay is more than $30,000, but no more than

$50,000, the tax is 5%.

- If gross pay is more than $50,000, the tax is 15%.

Page 29: Black-Box Testing Techniques II

Guidelines for identifying Causes and Effects (cont’d)

• List each Cause and Effect.

• Assign a unique number to each (use different number ranges to differentiate Causes from Effects).

Page 30: Black-Box Testing Techniques II

Guidelines for identifying Causes and Effects (cont’d)

• List each Cause and Effect.

• Assign a unique number to each (use different number ranges to differentiate Causes from Effects).

Page 31: Black-Box Testing Techniques II

Guidelines for identifying Causes and Effects (cont’d)

The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question.

A non-resident will pay 1% of the gross pay in city tax.

Residents pay on the following scale:

- If gross pay is no more than $30,000, the tax is 1%.

- If gross pay is more than $30,000, but no more than

$50,000, the tax is 5%.

- If gross pay is more than $50,000, the tax is 15%.

Page 32: Black-Box Testing Techniques II

Illustration of Step 1 (cont’d)

Ignoring, again, the unspecified responses to “invalid” inputs, we have:

Causes: Effects:

(1) Non-Resident (11) 1% tax

(2) Resident (12) 5% tax

(3) $0 Gross Pay $30K (13) 15% tax

(4) $30K Gross Pay $50K

(5) Gross Pay $50K

Page 33: Black-Box Testing Techniques II

Illustration of Step 2 (Deduce Logical Relationships and Constraints)The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question.

A non-resident will pay 1% of the gross pay in city tax.

Residents pay on the following scale:

- If gross pay is no more than $30,000, the tax is 1%.

- If gross pay is more than $30,000, but no more than

$50,000, the tax is 5%.

- If gross pay is more than $50,000, the tax is 15%.

Page 34: Black-Box Testing Techniques II

What are the constraints?

Causes: Effects:

(1) Non-Resident (11) 1% tax

(2) Resident (12) 5% tax

(3) $0 Gross Pay $30K (13) 15% tax

(4) $30K Gross Pay $50K

(5) Gross Pay $50K

Page 35: Black-Box Testing Techniques II

Constraints deducible from spec, problem domain knowledge, etc.A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and

only one of (1) and (2) must be true.)

B. [(3) Л ¬(4) Л ¬(5)] V [¬(3) Л (4) Л ¬(5)] V

[¬(3) Л ¬(4) Л (5)]

C. [(11) Л ¬(12) Л ¬(13)] V [¬(11) Л (12) Л

¬(13)] V [¬(11) Л ¬(12) Л (13)]

Page 36: Black-Box Testing Techniques II

Constraints deducible from spec, problem domain knowledge, etc.A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and

only one of (1) and (2) must be true.)

B. [(3) Л ¬(4) Л ¬(5)] V [¬(3) Л (4) Л ¬(5)] V

[¬(3) Л ¬(4) Л (5)]

C. [(11) Л ¬(12) Л ¬(13)] V [¬(11) Л (12) Л

¬(13)] V [¬(11) Л ¬(12) Л (13)]

Page 37: Black-Box Testing Techniques II

Constraints deducible from spec, problem domain knowledge, etc.A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and

only one of (1) and (2) must be true.)

B. [(3) Л ¬(4) Л ¬(5)] V [¬(3) Л (4) Л ¬(5)] V

[¬(3) Л ¬(4) Л (5)]

C. [(11) Л ¬(12) Л ¬(13)] V [¬(11) Л (12) Л

¬(13)] V [¬(11) Л ¬(12) Л (13)]

Page 38: Black-Box Testing Techniques II

Constraints deducible from spec, problem domain knowledge, etc.A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and

only one of (1) and (2) must be true.)

B. [(3) Л ¬(4) Л ¬(5)] V [¬(3) Л (4) Л ¬(5)] V

[¬(3) Л ¬(4) Л (5)]

C. [(11) Л ¬(12) Л ¬(13)] V [¬(11) Л (12) Л

¬(13)] V [¬(11) Л ¬(12) Л (13)]

Page 39: Black-Box Testing Techniques II

What are the logical relationships?

The first input is a yes/no response to the question “Do you reside within the city?” The second input is gross pay for the year in question.

A non-resident will pay 1% of the gross pay in city tax.

Residents pay on the following scale:

- If gross pay is no more than $30,000, the tax is 1%.

- If gross pay is more than $30,000, but no more than

$50,000, the tax is 5%.

- If gross pay is more than $50,000, the tax is 15%.

Page 40: Black-Box Testing Techniques II

Conditionals deducible from specification and constraints

• From the specification we have:

(1) => (11)

[(2) Л (3)] => (11)

[(2) Л (4)] => (12)

[(2) Л (5)] => (13)

Page 41: Black-Box Testing Techniques II

Conditionals deducible from specification and constraints (cont’d)• Which, in light of the identified

constraints, simplify to:

[(1) V (3) => (11)

[(2) Л (4)] => (12)

[(2) Л (5)] => (13)

Page 42: Black-Box Testing Techniques II

Boolean Graph Representation

(1)

(11)

(3)

(4)

(12)

(2)

(13)

(5)

Л

Л

V

Page 43: Black-Box Testing Techniques II

Boolean Graph Representation

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

Page 44: Black-Box Testing Techniques II

Boolean Graph Representation

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 45: Black-Box Testing Techniques II

Cause/Effect Constraints

E

O

I

Exclusive Inclusive

One & Only One Requires

A

B

“at most one” “at least one”

A => B“one and only one”

Page 46: Black-Box Testing Techniques II

Illustration of Step 3 (Identify Test Case Selection Strategy)

• Simple (but extreme) strategies:

– “All Feasible Combinations of Cause Values” (AFCCV)

– “All Effects” (AE)

• For the relationships depicted in our graph, how many test cases would be required to achieve AFCCV coverage? AE coverage?

Page 47: Black-Box Testing Techniques II

Illustration of Step 3 (Identify Test Case Selection Strategy)

• Simple (but extreme) strategies:

– “All Feasible Combinations of Cause Values” (AFCCV)

– “All Effects” (AE)

• For the relationships depicted in our graph, how many test cases would be required to achieve AFCCV coverage? AE coverage?

Page 48: Black-Box Testing Techniques II

Illustration of Step 3 (Identify Test Case Selection Strategy)

• Simple (but extreme) strategies:

– “All Feasible Combinations of Cause Values” (AFCCV)

– “All Effects” (AE)

• For the relationships depicted in our graph, how many test cases would be required to achieve AFCCV coverage? AE coverage?

Page 49: Black-Box Testing Techniques II

Illustration of Step 3 (Identify Test Case Selection Strategy)

• Simple (but extreme) strategies:

– “All Feasible Combinations of Cause Values” (AFCCV)

– “All Effects” (AE)

• For the relationships depicted in our graph, how many test cases would be required to achieve AFCCV coverage? AE coverage?

Page 50: Black-Box Testing Techniques II

AFCCV and AE Coverage

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 51: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AFCCV:

– There are 25 = 32 possible value combinations for all 5 Causes.

– For Causes (1) and (2), there are 2 feasible value combination pairs (due to the “one and only one” constraint): TF and FT.

Page 52: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AFCCV:

– There are 25 = 32 possible value combinations for all 5 Causes.

– For Causes (1) and (2), there are 2 feasible value combination pairs (due to the “one and only one” constraint): TF and FT.

Page 53: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AFCCV:

– There are 25 = 32 possible value combinations for all 5 Causes.

– For Causes (1) and (2), there are 2 feasible value combination pairs (due to the “one and only one” constraint): TF and FT.

(cont’d)

Page 54: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AFCCV: (cont’d)

– Similarly, for Causes (3), (4), and (5), there are 3 feasible value combination triples: TFF, FTF, and FFT.

– Thus, there are 2 X 3 = 6 feasible combinations of values for all 5 Causes, requiring a total of 6 test cases.

Page 55: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AFCCV: (cont’d)

– Similarly, for Causes (3), (4), and (5), there are 3 feasible value combination triples: TFF, FTF, and FFT.

– Thus, there are 2 X 3 = 6 feasible combinations of values for all 5 Causes, requiring a total of 6 test cases.

Page 56: Black-Box Testing Techniques II

How about AE Coverage?

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 57: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE:

– There are 3 mutually exclusive Effects.

– Thus, a different combination of Cause values is required for each Effect to evaluate to True.

– Therefore, 3 test cases are required.

Page 58: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE:

– There are 3 mutually exclusive Effects.

– Thus, a different combination of Cause values is required for each Effect to evaluate to True.

– Therefore, 3 test cases are required.

Page 59: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE:

– There are 3 mutually exclusive Effects.

– Thus, a different combination of Cause values is required for each Effect to evaluate to True.

– Therefore, 3 test cases are required.

Page 60: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE:

– There are 3 mutually exclusive Effects.

– Thus, a different combination of Cause values is required for each Effect to evaluate to True.

– Therefore, 3 test cases are required.

(cont’d)

Page 61: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE: (cont’d)

– In general, when there are N Effects, N or fewer test cases are required for AE Coverage.

– When the N Effects are mutually exclusive, all N test cases are required.

Page 62: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• AE: (cont’d)

– In general, when there are N Effects, N or fewer test cases are required for AE Coverage.

– When the N Effects are mutually exclusive, all N test cases are required.

Page 63: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• Note that AE is analogous to partitioning an input space based solely on the specified outputs...

• AFCCV is analogous to associating a separate equivalence class with every (feasible) combination of the individual input classes (i.e., the “brute-force” approach)...

• Question: do these strategies depend on the Cause-Effect relationships?

Page 64: Black-Box Testing Techniques II

Partitioning Based on Specified Output

Would you be comfortable with the degree of coverage afforded by choosing ONE test case from each of these 3 partitions? Why or why not?

5% 15%Res?

yes

no

Gross_Pay

30K (30K, 50K] > 50K

1%

Page 65: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• Note that AE is analogous to partitioning an input space based solely on the specified outputs...

• AFCCV is analogous to associating a separate equivalence class with every (feasible) combination of the individual input classes (i.e., the “brute-force” approach)...

• Question: do these strategies depend on the Cause-Effect relationships?

Page 66: Black-Box Testing Techniques II

The “Brute-Force” Approach

We could “hedge our bet” by associating a separate partition with every (feasible) combination of classes from the sets:

1% 5% 15%

1% 1% 1%Res?

yes

no

Gross_Pay

30K (30K, 50K] > 50K

What are the pros and cons of this approach?

Page 67: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• Note that AE is analogous to partitioning an input space based solely on the specified outputs...

• AFCCV is analogous to associating a separate equivalence class with every (feasible) combination of the individual input classes (i.e., the “brute-force” approach)...

• Question: do these strategies depend on the Cause-Effect relationships?

Page 68: Black-Box Testing Techniques II

AFCCV and AE Coverage (cont’d)

• Note that AE is analogous to partitioning an input space based solely on the specified outputs...

• AFCCV is analogous to associating a separate equivalence class with every (feasible) combination of the individual input classes (i.e., the “brute-force” approach)...

• Question: do these strategies depend on the Cause-Effect relationships?

AFCCV: NO AE: YES

Page 69: Black-Box Testing Techniques II

Another Test Case Selection Strategy…

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 70: Black-Box Testing Techniques II

Another Test Case Selection Strategy…

REPEAT

Select the next (initially, the first) Effect.

Tracing back through the graph (right to left), find all feasible combinations of connected Cause values that result in the Effect being True.

For each new such combination found:

Determine values of all other Effects, and

Enter values for each Cause and Effect in anew column of the test case coverage matrix.

UNTIL each Effect has been selected.

Page 71: Black-Box Testing Techniques II

What Should We Call this Strategy?

How about: All Feasible Combinations of Connected Cause Values that Result in Each Effect being True (AFCCCVREET)?

Page 72: Black-Box Testing Techniques II

What Should We Call this Strategy?

How about: All Feasible Combinations of Connected Cause Values that Result in Each Effect being True (AFCCCVREET)?

Nah…let’s just call it “Strategy #3”.

Page 73: Black-Box Testing Techniques II

Applying Strategy #3

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 74: Black-Box Testing Techniques II

Applying Strategy #3

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 75: Black-Box Testing Techniques II

Applying Strategy #3

• Cause Value Combinations for Effect 11:

(1) V (3) 1, 3 or

1, 3 or

1, 3

• Cause Value Combinations for Effect 12:

• Cause Value Combinations for Effect 13:

Page 76: Black-Box Testing Techniques II

Coverage Matrix

TEST CASES

CAUSES 1 2 3 4 5

Non-Resident (1) T T F

Resident (2) F F T

$0 Gross Pay $30K (3) T F T

$30K Gross Pay $50 (4) F F

Gross Pay $50K (5) F F

EFFECTS

1% tax (11) T T T

5% tax (12) F F F

15% tax (13) F F F

don’t care, subject to Cause constraint B

Page 77: Black-Box Testing Techniques II

Applying Strategy #3

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 78: Black-Box Testing Techniques II

Applying Strategy #3

• Cause Value Combinations for Effect 11:

(1) V (3) 1, 3 or

1, 3 or

1, 3

• Cause Value Combinations for Effect 12:

(4) Л (2) 2, 4

• Cause Value Combinations for Effect 13:

Page 79: Black-Box Testing Techniques II

Coverage Matrix (cont’d)

TEST CASES

CAUSES 1 2 3 4 5

Non-Resident (1) T T F F

Resident (2) F F T T

$0 Gross Pay $30K (3) T F T F

$30K Gross Pay $50K (4) F F T

Gross Pay $50K (5) F F F

EFFECTS

1% tax (11) T T T F

5% tax (12) F F F T

15% tax (13) F F F F

don’t care, subject to Cause constraint B

Page 80: Black-Box Testing Techniques II

Applying Strategy #3

Non-Res (1)

(11) 1% tax

[0,30K] (3)

(30K,50K] (4)

(12) 5% tax

Res (2)

(13) 15% tax

>50K (5)

Л

Л

V

O

O

O

Page 81: Black-Box Testing Techniques II

Applying Strategy #3

• Cause Value Combinations for Effect 11:

(1) V (3) 1, 3 or

1, 3 or

1, 3

• Cause Value Combinations for Effect 12:

(4) Л (2) 2, 4

• Cause Value Combinations for Effect 13:

(5) Л (2) 2, 5

Page 82: Black-Box Testing Techniques II

Coverage Matrix (cont’d)

TEST CASES

CAUSES 1 2 3 4 5

Non-Resident (1) T T F F F

Resident (2) F F T T T

$0 Gross Pay $30K (3) T F T F F

$30K Gross Pay $50K (4) F F T F

Gross Pay $50K (5) F F F T

EFFECTS

1% tax (11) T T T F F

5% tax (12) F F F T F

15% tax (13) F F F F T

don’t care, subject to Cause constraint B

Page 83: Black-Box Testing Techniques II

Complete Coverage Matrix

TEST CASES

CAUSES 1 2 3 4 5

Non-Resident (1) T T F F F

Resident (2) F F T T T

$0 Gross Pay $30K (3) T F T F F

$30K Gross Pay $50K (4) F F T F

Gross Pay $50K (5) F F F T

EFFECTS

1% tax (11) T T T F F

5% tax (12) F F F T F

15% tax (13) F F F F T

don’t care, subject to Cause constraint B

Page 84: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does Strategy #3 differ from AFCCV?

– For each Effect, only the connected Causes are considered.

– It is less conservative:

• Does not ensure that every feasible combination of Cause values will be covered.

• And thus does not ensure that every feasible combination of Effect values will be covered. (Relevant when Effects are not mutually exclusive.)

Page 85: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does Strategy #3 differ from AFCCV?

– For each Effect, only the connected Causes are considered.

– It is less conservative:

• Does not ensure that every feasible combination of Cause values will be covered.

• And thus does not ensure that every feasible combination of Effect values will be covered. (Relevant when Effects are not mutually exclusive.)

Page 86: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does Strategy #3 differ from AFCCV?

– For each Effect, only the connected Causes are considered.

– It is less conservative:

• Does not ensure that every feasible combination of Cause values will be covered.

• And thus does not ensure that every feasible combination of Effect values will be covered. (Relevant when Effects are not mutually exclusive.)

Page 87: Black-Box Testing Techniques II

Complete Coverage Matrix

TEST CASES

CAUSES 1 2 3 4 5

Non-Resident (1) T T F F F

Resident (2) F F T T T

$0 Gross Pay $30K (3) T F T F F

$30K Gross Pay $50K (4) F F T F

Gross Pay $50K (5) F F F T

EFFECTS

1% tax (11) T T T F F

5% tax (12) F F F T F

15% tax (13) F F F F T

don’t care, subject to Cause constraint B

Page 88: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does Strategy #3 differ from AFCCV?

– For each Effect, only the connected Causes are considered.

– It is less conservative:

• Does not ensure that every feasible combination of Cause values will be covered.

• And thus does not ensure that every feasible combination of Effect values will be covered. (Relevant when Effects are not mutually exclusive.)

Page 89: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does it differ from AE?

– It is more conservative (ALL feasible combinations of connected Cause values must be covered for each Effect).

Page 90: Black-Box Testing Techniques II

Comparing Strategy #3 to AFCCV and AE Coverage

• How does it differ from AE?

– It is more conservative (ALL feasible combinations of connected Cause values must be covered for each Effect).

Page 91: Black-Box Testing Techniques II

Coming up in “Black-Box Testing Techniques III”…

• We step-through another (somewhat more complex) example of Cause-Effect Analysis.

• Describe a test case design technique for exploring boundary conditions.

• Consider a test case design strategy based on intuition and experience.

Page 92: Black-Box Testing Techniques II

Coming up in “Black-Box Testing Techniques III”…

• We step-through another (somewhat more complex) example of Cause-Effect Analysis.

• Describe a test case design technique for exploring boundary conditions.

• Consider a test case design strategy based on intuition and experience.

Page 93: Black-Box Testing Techniques II

Coming up in “Black-Box Testing Techniques III”…

• We step-through another (somewhat more complex) example of Cause-Effect Analysis.

• Describe a test case design technique for exploring boundary conditions.

• Consider a test case design strategy based on intuition and experience.

Page 94: Black-Box Testing Techniques II

Black-Box Testing Techniques II

Prepared by

Stephen M. Thebaut, Ph.D.

University of Florida

Software Testing and Verification

Lecture 5