Test Techniques
Test Techniques
Testing Objectives:
Myers [MYE79] states a number of rules that can serve well as testing objectives:
The major testing objective is to design tests that systematically uncover types of
errors with minimum time and effort.
Software Testing Principles
- Testing should begin “in the small” and progress toward testing “in the large”.
- Controllability: “The better we can control the software, the more the testing
can be automated and optimized.”
- Simplicity: “The less there is to test, the more quickly we can test it.”
- Stability: “The fewer the changes, the fewer the disruptions to testing.”
- Understandability:”The more information we have, the smarter we will test.”
Test Case Design
Black-box testing:
knowing the specific functions of a software,
design tests to demonstrate each function and check its errors.
Major focus:
functions, operations, external interfaces,
external data and information
White-box testing:
knowing the internals of a software,
design tests to exercise all internals of a software to make sure
they operates according to specifications and designs
Major focus: internal structures, logic paths, control flows, data flows
internal data structures, conditions, loops, etc.
White-Box Testing and Basis Path Testing
When this metric is used in the context of the basis path testing, the value
computed for cyclomatic complexity defines the number of independent paths
in the basis set of a program.
For example,
path 1: 1-2-10-11-13
path 2: 1-2-10-12-13
path 3: 1-2-3-10-11-13
path 4: 1-2-3-4-5-8-9-2-…
path 5: 1-2-3-4-5-6-8-9-2-..
Path 6: 1-2-3-4-5-6-7-8-9-2-..
Step 4: Prepare test cases that will force execution of each path in the basis
set.
Path 1: test case:
value (k) = valid input, where k < i defined below.
value (i) = -999, where 2 <= I <= 100
expected results: correct average based on k values and proper totals.
Equivalence Partitioning
Valid inputs
system
outputs
invalid inputs
partition
Equivalence Classes
Equivalence classes can be defined using the following guidelines:
- If an input condition specifies a range, one valid and two invalid equivalence
class are defined.
- If an input condition requires a specific value, one valid and two invalid
equivalence classes are defined.
- If an input condition specifies a member of a set, one valid and one invalid
equivalence classes are defined.
- If an input condition is Boolean, one valid and one invalid classes are
defined.
Examples:
area code: input condition, Boolean - the area code may or may not be present.
input condition, range - value defined between 200 and 900
Guidelines:
- If an input condition specifies a range bounded by values a and b,
test cases should be designed with value a and b, just above and below a and b.