Equivalence Partitioning:-
Equivalence partitioning is a black-box testing method that divides the input domain of a program into classes of data from which test cases can be derived. Test case design for equivalence partitioning is based on an evaluation of equivalence classes for an input condition. An equivalence class represents a set of valid or invalid states for input conditions. Typically, an input condition is either a specific numeric value, a range of values, a set of related values, or a boolean condition. Equivalence classes may be defined according to the following guidelines:
- If an input condition specifies a range, one valid and two invalid equivalence classes 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 class are defined.
- If an input condition is boolean, one valid and one invalid class are defined.
As an example, consider data maintained as part of an automated banking application.
The user can access the bank using a personal computer, provide a six-digit password, and follow with a series of typed commands that trigger various banking functions. During the log-on sequence, the software supplied for the banking application accepts data in the form:
- area code—blank or three-digit number
- prefix—three-digit number not beginning with 0 or 1
- suffix—four-digit number
- password—six digit alphanumeric string
- commands—check, deposit, bill pay, and the like
The input conditions associated with each data element for the banking application can be specified as area code:
- Input condition, Boolean—the area code may or may not be present.
- Input condition, range—values defined between 200 and 999, with specific exceptions.
- prefix: Input condition, range—specified value >200
- Input condition, value—four-digit length
- password: Input condition, Boolean—a password may or may not be present.
- Input condition, value—six-character string.
- command: Input condition, set—containing commands noted previously.
Applying the guidelines for the derivation of equivalence classes, test cases for each input domain data item can be developed and executed. Test cases are selected so that the largest number of attributes of an equivalence class are exercised at once.
0 comments:
Post a Comment