Black-Box Testing Techniques II - cise.ufl.edu · PDF fileBlack-Box Testing Techniques II...

Click here to load reader

  • date post

    24-Mar-2019
  • Category

    Documents

  • view

    220
  • download

    0

Embed Size (px)

Transcript of Black-Box Testing Techniques II - cise.ufl.edu · PDF fileBlack-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

Black-Box Test Case Design Techniques

Considered

Partition testing

Combinatorial Approaches

Boundary Value Analysis

Intuition & Experience

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.

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 combinationsof input Causes resulting in output Effects.

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.

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.

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.

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

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.

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.

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.

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.

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.

C-E Analysis Process Steps (contd)

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.

C-E Analysis Process Steps (contd)

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.

C-E Analysis Process Steps (contd)

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.

(contd)

C-E Analysis Process Steps (contd)

2. Deduce Logical Relationships and Constraints (contd)

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

C-E Analysis Process Steps (contd)

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.

C-E Analysis Process Steps (contd)

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.

C-E Analysis Process Steps (contd)

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.

C-E Analysis Process Steps (contd)

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...

C-E Analysis Process Steps (contd)

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...

C-E Analysis Process Steps (contd)

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...

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?

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?

(Well come back to this after illustrating the process steps with some examples.)

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%.

Guidelines for identifying Causes

and Effects

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

Guidelines for identifying Causes

and Effects (contd)

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%.

Guidelines for identifying Causes

and Effects (contd)

List each Cause and Effect.

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

Guidelines for identifying Causes

and Effects (contd)

List each Cause and Effect.

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

Illustration of Step 1 (contd)

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

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%.

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

Constraints deducible from spec,

problem domain knowledge, etc.

A. [(1) (2)] V [(1) (2)] (i.e., o