Title: Blackbox Testing
1Blackbox Testing
2Blackbox Testing
- AKA Specification-Based
- Uses functional requirements to derive test cases
- Assumes errors include missing or improperly
implemented functions - No knowledge of implementation details
3Motivation
Arianne 5 Rocket Improper Reuse of A3 code
Failure to test Spec
4Equivalence Partitioning
- Divide input domain into classes of data
- Single test case can cover all equivalent data
elements - Assumption if any one case in a partition
succeeds all would succeed and vice-versa - Partitions consist of valid and invalid sets of
data
5Basic Rules
- Range of values one valid, two invalid
partitions - Specific value one valid, two invalid partitions
- Set member one valid and one invalid partition
- Boolean value one valid and one invalid class
- Other elements use common sense and analysis
6Invoice Specification
Invoices are calculated using the following
algorithm based on quantity of x and y Item X
sells for 5 and Item Y sells for 10 Invoice
Total gt200 get 5 discount Invoice
Total gt1000 get 10 discount Invoices
that order more than 30 X items
get a 5 discount
7Invoice Equivalence Partitions
X Classes Y Classes Invoice Total Classes
lt0, gt0
8Darwin Species File Partitions
Null, Correct, Long, Short
Correct, Incorrect
Exists, Nonexistent
9Is Spec testing really hard?
U.S. Army Personnel specification for
holidays Executive Order 10358 provided in the
case of an employee whose work week varied from
the normal Monday through Friday work week that
Labor Day and Thanksgiving Day each were to be
observed on the next succeeding workday when the
holiday fell on a day outside the employees
regular basic work week. Now, when Labor Day,
Thanksgiving Day or any Monday holiday is outside
the employees basic workweek, the immediately
preceding workday will be his holiday when the
non-workday on which the holiday falls is the
second non-workday or the non-workday designated
as the employees day off in lieu of Saturday.
When the non-workday on which the holiday falls
is the first non-workday or the non-workday
designated as the employees day off in lieu of
Sunday, the holiday observance is moved to the
next succeeding workday.
10Border/Boundary Conditions
Most errors happen at the boundary, so select
test cases that test at and on each side of the
boundary.
X Boundaries
30, 31, -1, 0
Y Boundaries
-1, 0
Invoice Total Boundaries
200, 199, 999,1000
If there are specification limits on data sizes
be sure to test at the limits i.e. program must
store up to 100 numbers, then test at 100. What
happens at 101???
11Syntax Testing
- Identify language or format (may be hidden)
- Define syntax of language
- Cover set of input strings (valid statements) by
covering the syntax graph
12Other composite techniques
- State-Based
- Spec is represented as a state machine
- Select test cases to cover machine
- Condition (Logic-Based)
- Complex dependencies
- Generate decision table for valid combinations
- Comparison Testing
13Comparison Test
14Example Decision Table
- Compute from input sides a, b, c whether a
triangle is equilateral, isoceles, scalene, or
not a triangle. - altbc, bltac, cltab
- ab, bc, ac
- Any two sides equal length
15Decision Table Tests
16Testing Login??
Usernames are a-zA-Z0-9 and 10 chars or
less Passwords are 6-8 chars, must be printable
ASCII
17Next Time Other Testing
GUI
Regression
Validation
Integration
Class