SOFTWARE ENGINEERING TECHNIQUES
LESSON 24:
Topics Covered                                                             An input condition is either a specific numeric value, range of
Functional testing/Black box testing: Equivalence class testing,           values, a set of related values, or a boolean condition.
boundary value analysis, Cause effect graphing technique.                  Equivalence classes can be defined by:
Objectives                                                                 •     If an input condition specifies a range or a specific value,
Upon completion of this Lesson, you should be able to:                           one valid and two invalid equivalence classes defined.
•    Know what is functional testing/black box testing                     •     If an input condition specifies a boolean or a member of a
•    Know what are the various testing methods                                   set, one valid and one invalid equivalence classes defined.
•    Know what is equivalence class testing and boundary value             Test cases for each input domain data item developed and
     analysis and the cause effect graphing technique                      executed.
Black Box Testing                                                          This method uses less number of input data compare to
Functional tests examine the observable behavior of software               exhaustive testing. However, the data for boundary values are
as evidenced by its outputs, without any reference to internal             not considered.
functions. This kind of tests is from the user point of view,              This method though reduces significantly the number of input
which means as if the user is testing as in the normal business            data to be tested; it does not test the combinations of the input
functions.                                                                 data.
•    Black box tests normally determine the quality of the                 Boundary Value Analysis
     software. It is an advantage to create the quality criteria           It is observed that boundary points for any inputs are not
     from this point of view from the beginning.                           tested properly. This leads to many errors. Large number of
•    In black box testing, software is subjected to a full range of        errors tends to occur at boundaries of the input domain.
     inputs and the outputs are verified for its correctness. Here,        Boundary Value Analysis (BVA) leads to selection of test cases
     the structure of the program is immaterial.                           that exercise boundary values.
•    Black box testing technique can be applied once unit and              BVA complements equivalence partitioning i.e. select any
     integration testing is completed.                                     element in an equivalence class, select those at the ‘’edge’ of the
•    It focuses on functional requirements.                                class.
•    It is compliment to the white box testing.                            Examples
The main objective of the black box testing is to find:                    1.    For a range of values bounded by a and b, test (a-1), a,
1.   Incorrect or missing functions                                              (a+1), (b-1), b, (b+1).
2.   Interface errors                                                      2.    If input conditions specify a number of values n, test with
                                                                                 (n-1), n and (n+1) input values.
3.   Errors in data structures or external database access
                                                                           3.    Apply 1 and 2 to output conditions (e.g., generate table of
4.   Performance errors
                                                                                 minimum and maximum size).
5.   Initialization and termination errors.
                                                                           4.    If internal program data structures have boundaries (e.g.,
Some of the techniques used for black box testing are                            buffer size, table limits), use input data to exercise
discussed below:                                                                 structures on boundaries.
Equivalence Class Partitioning                                             BVA and Equivalence partitioning both helps in testing the
The main objective of this method is to partitioning the input             programs and covers most of the conditions. This method
so that an optimal input data is selected. Steps to be followed            does not test the combinations of input conditions.
are:
                                                                           Cause Effect Graphing Techniques
1.   Divide the input domain into classes of data for which test           Translation of natural language descriptions of procedures to
     cases can be generated.                                               software-based algorithms is error prone.
2.   Attempting to uncover classes of errors, if any.
                                                                           Example: From US Army Corps of Engineers:
3.   Identify the both right and wrong input data while                    Executive Order 10358 provides in the case of an employee
     partitioning the data.                                                whose work week varies from the normal Monday through
4.   Test the program for all types of data.                               Friday work week, that Labor Day and Thanksgiving Day each
Based on equivalence classes for input conditions.                         were to be observed on the next succeeding workday when the
                                                                           holiday fell on a day outside the employee’s regular basic work
An equivalence class represents a set of valid or invalid states
                                                           © Copy Right: Rai University
3E.253                                                                                                                                          87
                                  week. Now, when Labor Day, Thanksgiving Day or any of the                When outputs of versions differ, each is investigated to
SOFTWARE ENGINEERING TECHNIQUES
                                  new Monday holidays are outside an employee’s basic work-                determine if there is a defect.
                                  book, the immediately preceding workday will be his holiday              Method does not catch errors in the specification.
                                  when the non-workday on which the holiday falls is the second
                                  non-workday or the non-workday designated as the employee’s              Notes
                                  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 employee’s day off in lieu of Sunday, the
                                  holiday observance is moved to the next succeeding workday.
                                  How do you Test Code, Which Attempts to Implement
                                  this?
                                  Cause-effect graphing attempts to provide a concise representa-
                                  tion of logical combinations and corresponding actions.
                                  1.   Causes (input conditions) and effects (actions) are listed for
                                       a module and an identifier is assigned to each.
                                  2.   A cause-effect graph developed.
                                  3.   Graph converted to a decision table.
                                  4.   Decision table rules are converted to test cases.
                                  Simplified Symbology
                                            Fig: Representation of cause-effect nodes
                                  Comparison Testing
                                  In some applications the reliability is critical.
                                  Redundant hardware and software may be used.
                                  For redundant software, use separate teams to develop
                                  independent versions of the software.
                                  Test each version with same test data to ensure all provisional
                                  identical output.
                                  Run all versions in parallel with a real-time comparison of
                                  results.
                                  Even if will only run one version in final system, for some
                                  critical applications can develop independent versions and use
                                  comparison testing or back-to-back testing.
                                                                                           © Copy Right: Rai University
                                  88                                                                                                                                  3E.253