Chapter 6 - Black Box Techniques - Part 1
Chapter 6 - Black Box Techniques - Part 1
(ITS 64704)
Dynamic Testing – Black Box
(Part I)
Dynamic Testing – Fundamentals
Topics
Idea of the Black Box Test Design Techniques
Equivalence Partitioning
Topics
Idea of the Black Box Test Design Techniques
Equivalence Partitioning
Test basis
• All documents from which the requirement of a component or a system can be inferred.
• The document on which the test cases are based
Test condition
• An item or event e.g., a function, transaction, feature, quality attribute, or structural element
of a component or system that could be verified by one or more test cases
Pre condition
• Environmental and state conditions that must be fulfilled before the test object can be
executed with a particular test or test procedure
Post condition
• State conditions (and/or environmental conditions) that must be fulfilled on a test
object after the execution of a test or test procedure
• The execution of dynamic tests requires the execution of the test object.
• To run the test, an executable program must be at hand!
• Separate classes, modules/components and system parts are generally not
executable by themselves
• They often provide operations or services for other software items
• They generally have no “main program“ to coordinate the procedure calls
• They often rely on the operations or services of other software items
• In the early test levels of class/module tests, component tests and integration
tests, the test object must often be embedded in a “test harness“
Topics
Idea of the Black Box Test Design Techniques
Equivalence Partitioning
Specification based
• Dynamic testing, in which Testing:
the test cases are derivedTerms
using the
functional specifications of the test object and the
completeness of the testing (coverage) is evaluated according
to the functional specifications
• The capability of the software product to provide functions
which meet stated and implied needs when the software is
used under specified conditions [ISO 9126].
• Sub characteristics of functionality after ISO 9126 are: accuracy,
suitability, interoperability, security, conformance
quality
Specification based Test Case and
Test Data Definition
Dynamic Testing – Fundamentals
Topics
Idea of the Black Box Test Design Techniques
Equivalence Partitioning
• The domain of definition of input and output are divided (partitioned) into
equivalence classes, such that all values within a class represent a similar behavior of
the test object.
• Assumptions:
• If a value chosen from the equivalence class detects a defect, it is assumed that
this defect will also be detected for every other value in the equivalence class.
• If a value chosen from the equivalence class does not detect a defect, it is
assumed that no other value from the equivalence class will detect a defect.
Equivalence Partitioning: Procedure
• If an area of validity is specified, then: define one valid and two invalid equivalence
classes
The specification of the test object defines an input integer with possible
values from 1 to 100
• If an area of validity is specified, then: define one valid and two invalid equivalence
classes
The specification of the test object defines an input integer with possible
values from 1 to 100
• If a minimum and a maximum value is specified, then: define one valid and two
invalid equivalence classes
Specification: A member of the sports club has to register himself, at least one
type of sport. A member can only be registered for a maximum of three types
of sport.
Equivalence Partitioning: Example
• If a minimum and a maximum value is specified, then: define one valid and two
invalid equivalence classes
Specification: A member of the sports club has to register himself, at least one
type of sport. A member can only be registered for a maximum of three types
of sport.
• If a number of values are specified which would not be treated differently, then:
define an valid equivalence class for those values and, in addition, define one invalid
equivalence class
• If a number of values are specified which would not be treated differently, then:
define an valid equivalence class for those values and, in addition, define one invalid
equivalence class
Valid Invalid
Football, Hockey, Handball, Basketball, Anything else than valid value:
Volleyball e.g Badminton, Swimming, etc
Equivalence Partitioning: Example
• If a “true“ and “false“ situation is specified, then: define equivalence for the “true”
and “false” conditions
Specification: Every member of the sports club received a unique member ID. It
must start with the first letter of the family name of the member.
Equivalence Partitioning: Example
• If a “true“ and “false“ situation is specified, then: define equivalence for the “true”
and “false” conditions
Specification: Every member of the sports club received a unique member ID. It
must start with the first letter of the family name of the member.
• A specific exit criteria can be defined based on the number of equivalence classes
represented in tests:
• Example:
• If 18 equivalence classes have been determined from the statements or
specifications of the input data, and if only 15 of these have been tested in test
cases, an equivalence class coverage of 83 % has been reached.
• Equivalence class coverage = (15 / 18) * 100% = 83.33 %
Equivalence partitioning: Minimal test
case
Recommendations :
To choose effective test data for defect finding, combine Equivalence
Partitioning with Boundary Value Analysis
Dynamic Testing – Fundamentals
Topics
Idea of the Black Box Test Design Techniques
Equivalence Partitioning
Test condition:
1. Any Number greater than 10 entered
in the reservation column is
considered invalid.
2. Any Number less than 1, then it is
considered invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid
Boundary Value Analysis (BVA):
Example
• We cannot test all the possible values because if done, the number of test cases will be
more than 100.
• To address this problem, we use equivalence partitioning hypothesis where we divide the
possible values of tickets into groups or sets as shown below where the system behavior
can be considered the same.
Maximum Maximum
value value Just above
Just below Minimum Minimum
maximum
minimum value value value
value
Boundary Value Analysis (BVA):
Example
• Apply Boundary Values Analysis to test boundaries between equivalence partitions.
• A text box has a minimum character limit of 4 and maximum character limit of
10
• Write BVA test cases for this example
Boundary Value Analysis (BVA): Example2
• A text box has a minimum character limit of 4 and maximum character limit of
10
• Write BVA test cases for this example
• Defects are more often found at the • Procedures for the choice of test data
boundaries of equivalence classes than are not easily provided
inside these classes • Definition of all relevant boundary
• The Boundary Analysis is, if used values is difficult
correctly, one of the most useful • Creativity required for finding
methods for the test case design successful test data
• Efficient combinations with other • Often not efficiently enough applied, as
techniques, which permit a certain it seems to be too simple
degree of choice regarding test data
(tbc)
THANK YOU