J.E.D.I
• Work outward, conducting tests for the next loop, but keeping all other
outer loops at minimum values and other nested loops to “typical” values. •
Continue until all loops have been tested. For Concatenated Iteration, the test cases can be derived from the following
possible execution of the iteration or repetition •
If loops are independent, the test for simple loops can be used. •
If loops are dependent, the test for nested loops can be used. For Unstructured Iteration, no test cases can be derived since it would be best to
redesign the loop since it is not a good iteration or repetition constructs.
3. Data Flow Testing. It is a test case design method that selects test paths of a
program according to the locations of the definitions and uses of variables in the program.
6.3.2 Black-Box Testing Techniques
Black-box testing is a test design technique that focuses on testing the functional aspect of the software whether it complies with functional requirements. Software
engineers derive sets of input conditions that will fully test all functional requirements of the software. It defines a set of test cases that finds incorrect or missing functions,
errors in interface, errors in data structure, errors in external database access, performance errors, and errors in initialization and termination.
Graph-based Testing Graph-based Testing is a black-box testing technique that uses objects that are
modeled in software and the relationships among these objects. Understanding the dynamics on how these objects communicate and collaborate with one another can derive
test cases.
Developing Test Cases Using Graph-based Testing STEP 1. Create a graph of software objects and identify the relationship of these objects.
Using nodes and edges, create a graph of software objects. Nodes represent the software objects. Properties can be used to describe the nodes and edges. For object-
oriented software engineering, the collaboration diagram is a good input for the graph- based testing because you don’t need to create a graph. The collaboration diagram in
Figure 6.3 is used as an example.
Software Engineering 277
J.E.D.I
STEP 2. Traverse the graph to define test cases. The derived test cases are:
Test Case 1: •
FindAthleteUI
class sends a request to retrieve a list of athlete based on
a search criteria. The request is sent to the FindAthleteRecord.
•
The FindAthleteRecord sends a message to the DBAthlete to process the search criteria.
•
The DBAthele request the database server to execute the SELECT- statement. It populates the PCLAthlete class with the athlete
information. It returns the reference of the PCLAthlete to the AthleteListUI
. •
The AthleteListUI lists the names of the athletes.
Guidelines for Graph-based Testing 1.
Identify the start and stop points of the graph. There should be an entry and exit nodes.
2. Name nodes and specify their properties.
3. Establish their relationship through the use of edges. Specify the properties.
4. Derive test cases and ensure that there is node and edge coverage.
Software Engineering 278
Figure 6.3: Finding an Athlete Collaboration Diagram
J.E.D.I
Equivalence Testing Equivalence Testing is a black-box testing technique that uses the input domain of the
program. It divides the input domain into sets of data from which test cases can be derived. Derived test cases are used to uncover errors that reflect a class of errors.
Thus, reduces the effort in testing the software. It makes use of equivalence classes, which are sets of valid and invalid states that an input may be in.
Guidelines in Identifying Equivalence Classes 1. Input Condition is specified as a range of value. The test case is one valid input,
and two invalid equivalence classes. 2. Input Condition requires a specific value. The test case is one valid, and two
invalid equivalence classes. 3. Input condition specifies a member of a set. The test case is one valid and one
invalid. 4. Input condition is Boolean. The test case is one valid, and one invalid.
As an example, consider a text message code of registering a mobile number to a text service of getting traffic reports. Assume that the message requires the following
structure:
Service Server Number Number of the Server
providing the service. Service Code
A unique service code that tells the service provider
what service is asked. Mobile Number
The mobile number where the information is sent.
765 234
09198764531 Input Conditions associated with each data element:
Service Server Number specific value
input condition 1: correct value input condition 2: incorrect value
Service Code specific value
input condition 1: correct value input condition 2: incorrect value
Mobile Number specific value
input condition 1: correct value input condition 2: missing number
input condition 3: length not correct
Boundary Value Testing Boundary Value Testing is a black-box testing technique that uses the boundaries of
the input domain to derive test cases. Most errors occur at the boundary of the valid input values.
Guidelines in Deriving Test Cases Using Boundary Value Testing
Software Engineering 279
J.E.D.I
1. If input condition specifies range bounded by n and m, the test cases that can be derived:
• use values n and m • just above n and m
• just below n and m 2. If input condition specifies number of values, the test cases that can be derived:
• use the minimum • use the maximum
• just above and below minimum • just above and below maximum.
Software Engineering 280
J.E.D.I
6.4 Testing your Programs