0% found this document useful (0 votes)
8 views

Lecture 12

The document discusses software testing techniques, emphasizing the importance of testability, which includes operability, observability, controllability, simplicity, stability, and understandability. It covers various testing methods such as white-box and black-box testing, along with specific strategies like exhaustive and selective testing, basic path testing, loop testing, equivalence partitioning, and boundary value analysis. The goal of these techniques is to uncover errors and ensure the software meets quality and performance requirements before delivery to end users.

Uploaded by

uxamach7562
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture 12

The document discusses software testing techniques, emphasizing the importance of testability, which includes operability, observability, controllability, simplicity, stability, and understandability. It covers various testing methods such as white-box and black-box testing, along with specific strategies like exhaustive and selective testing, basic path testing, loop testing, equivalence partitioning, and boundary value analysis. The goal of these techniques is to uncover errors and ensure the software meets quality and performance requirements before delivery to end users.

Uploaded by

uxamach7562
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Software Engineering

Lecture 12

Software Testing Techniques

1
Software Testing
• Testing is the process of exercising a program
with the specific intent of finding errors prior
to delivery to the end user.

2
Testability
• Operability — it operates cleanly

• Observability — the results of each test case


are readily observed

• Controllability — the degree to which testing


can be automated and optimized

3
Testability

• Simplicity — reduce complex architecture and


logic to simplify tests

• Stability — few changes are requested during


testing

• Understandability — of the design

4
What Testing Shows
errors

requirements conformance

performance

an indication
of quality
Who Tests the Software?

developer independent tester

Understands the system Must learn about the system,


but, will test "gently" but, will attempt to break it
and, is driven by "delivery" and, is driven by quality
Exhaustive Testing

loop < 20 X

There are 1014 possible paths! If we execute one test per


millisecond, it would take 3,170 years to test the program
Selective Testing

Selected path

loop < 20 X

What you can do is do some selective path testing to assure it is


possible to get down a particular path
Test Case Design
"Bugs lurk in corners
and congregate at
boundaries ..."
Boris Beizer

OBJECTIVE to uncover errors

CRITERIA in a complete manner

CONSTRAINT with a minimum of effort and time


Software Testing
Software testing comes in many flavors for testing one method
or program

white-box black-box
methods methods

Methods

Strategies

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
10
White-Box Testing

... our goal is to ensure that all


statements and conditions have
been executed at least once ...

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
11
Why Cover?

logic errors and incorrect assumptions


are inversely proportional to a path's
execution probability

we often believe that a path is not


likely to be executed; in fact, reality is
often counter intuitive

typographical errors are random; it's


likely that untested paths will contain
some

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
12
Basic Path Testing
Next, we derive the
independent paths:
1

2 There are four paths

3 Path 1: 1,2,3,6,7,8
4
5 6
Path 2: 1,2,3,5,7,8
Path 3: 1,2,4,7,8
Path 4: 1,2,4,7,2,4,...7,8
7
Finally, we derive test
cases to exercise these
8
paths.

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
13
Loop Testing

Simple
loop
Nested
Loops
Concatenated
Loops Unstructured
Loops
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
14
Loop Testing: Simple Loops

Minimum conditions—Simple Loops


1. skip the loop entirely
2. only one pass through the loop
3. two passes through the loop
4. m passes through the loop m < n
5. (n-1), n, and (n+1) passes through Simple
the loop loop

where n is the maximum number


of allowable passes

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
15
Loop Testing: Nested Loops
Nested Loops
Start at the innermost loop.
Set all outer loops to their minimum iteration parameter
values.
Test the min+1, typical, max-1 and max for the
innermost loop, while holding the outer loops at their
minimum values.

Move out one loop and set it up as in step 2, holding all


other loops at typical values. Nested
Loops
Continue this step until the outermost loop has been
tested.

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
16
Loop Testing: Concatenated Loops

Concatenated Loops

If the loops are independent of one another


then treat each as a simple loop
else* treat as nested loops
endif*
for example, the final loop counter value
of loop 1 is used to initialize loop 2.

Concatenated
Loops
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
17
Black-Box Testing

requirements

output

input events

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
18
Equivalence Partitioning

user output FK
queries mouse formats input
data
picks prompts

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
19
Equivalence Partitioning

Invalid inputs Valid inputs

System

Outputs
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
20
Equivalence Partitioning
Partition system inputs and outputs into
‘equivalence sets’
 If input is a 5-digit integer between 10,000 and 99,999,
equivalence partitions are <10,000, 10,000-99, 999 and > 99,999

Choose test cases at the boundary of these


sets

 00000, 09999, 10000, 99999, 100001

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
21
Boundary Value Analysis

user output FK
queries mouse formats input
data
picks prompts

output
input domain domain
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
22
Other Black Box Techniques

error guessing methods


decision table techniques
cause effect graphing

These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are
provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001
23
End of Lecture

24

You might also like