Monday, 26 March 2012

Boundary Value Analysis & Equivalence Partitioning with examples


             Boundary Value Analysis

  •      Black-box technique that focuses on the  boundaries of the input domain rather than its center
  •          Whenever the engineers need to develop test cases for a range kind of input then they will go for boundary value analysis.
  BVA guidelines:
      
        1.     If input condition specifies a range bounded by values a and b, test cases should include a and b, values just above and just below a and b
      
      2.     If an input condition specifies and number of values, test cases should be exercise the minimum and maximum numbers, as well as values just above and just below the minimum and maximum values
3.     Apply guidelines 1 and 2 to output conditions, test cases should be designed to produce the minimum and maxim output reports
4.     If internal program data structures have boundaries (e.g. size limitations), be certain to test the boundaries

Equivalence Partitioning

  • Black-box technique that divides the input domain into classes of data from which test cases can be derived
  • An ideal test case uncovers a class of errors that might require many arbitrary test cases to be executed before a general error is observed
  • Whenever the test engineer need to develop test cases for a feature which has more number of validation then one will go for equableness class partition. Which describe first divide the class of inputs and then prepare the test cases
  • Equivalence class guidelines:
1.     If input condition specifies a range, one valid and two invalid equivalence classes are defined
2.     If an input condition requires a specific value, one valid and two invalid equivalence classes are defined
3.     If an input condition specifies a member of a set, one valid and one invalid equivalence class is defined
4.     If an input condition is Boolean, one valid and one invalid equivalence class is defined


Examples:


Functional Specification 1: -

                        A login process allows user ID & password to authorize users. From customer requirements user ID takes 9-numarics in lower case from 4 to 16 characters long. The password object takes alphabets in lower case from 4 to 8 characters long. Prepare test case titles or scenario.

Test Case Title 1: Verify user ID

Boundary Value Analysis (Size)                             Equivalence Class partition (Type) 

Min-1 ----- 3 Characters -------Fail                      Valid                    Invalid
Min ------- 4 Characters -------Pass                      a - z                     A - Z
Min+1---- 5 Characters -------Pass                      0 – 9                 Special Chars.
Max-1 ---15 Characters ------ Pass                                                  Blank field.
Max -----16 Characters ------ Pass
Max+1- 17 Characters ------ Fail
 


Test case Title 2: Verify password

Boundary Value Analysis (Size)                             Equivalence Class Partition (Type)
 

Min-1 ----- 3 Characters ---- Fail                                          Valid               Invalid
Min ------- 4 Characters ---- Pass                                         a – z                A - Z
Min+1 --- 5 Characters ---- Pass                                                                  0 - 9
Max-1---- 7 Characters ---- Pass                                                      Special Chars
Max ----- 8 Characters ---- Pass                                                       Blank Field
Max+1 – 9 Characters ---- Fail
 

Test Case Title 3: Verify Login Information
           
            User ID                                    Password                               Criteria
            Valid Value                            Valid Value                            Pass
            Valid Value                            Invalid Value                         Fail
            Invalid Value                         Valid Value                            Fail
            Blank Value                           Valid Value                            Fail
            Valid Value                            Blank Value                           Fail
            Invalid Value                         Blank Value                           Fail
            Blank Value                           Invalid Value                         Fail
            Blank Value                           Blank Value                           Fail





Functional specification 2:
                        In an insurance application, can apply for different types of policies.
From customer requirements, the system asks age, when a user selects type insurance. The age value should be >17 years and should be <60 years.

Prepare test case titles:

Test case title 1: Verify type’ A’ insurance selection.
Test case title2: verify age focus when selects type ‘A’ insurance.
Test case title3: verify age value

Boundary value Analysis (BVA)                              Equally class partition (Type)
 

Min-1 ------ 17 years ------ Fail                                             Valid               Invalid
Min -------- 18 years ------ pass                                               0 - 9              a - z
Min+1 ---- 19 years ------ pass                                                                     A - Z   
Max-1 ---- 58 years ------ pass                                                         Special Characters
Max ------ 59 years ------ pass                                                          Blank fields
Max+1 – 60 years ------ pass
 

Functional Specification 3: -
                        In a shopping application, users can apply for p items purchase.
From customer requirements, the system allows users to select item no. and entry of quantity upto 10 items. System returns the price of each item and total amount with respect to given quantity.

Test case Titles:
           
Test case Title 1:  verify item number selection
Test case Title 2: Verify Quantity value

Boundary Value Analysis (BVA)                         Equivalence Class Partition (Type)


Min-1 ----- 0 item ------ Fail                                       Valid               Invalid
Min ------- 1 item ------ Pass                                      0 – 9               a - z
Min+1 --- 2 items ----- Pass                                                              A - Z
Max-1 ---- 9 items ---- Pass                                                              Special Characters
Max ----- 10 items ---- Pass                                                              Blank field
Max+1 – 11 items ---- Fail
 

Test case title 3: verify total = price of one item X  given quantity.

1 comment:

  1. in example 2.

    Max+1 – 60 years ------ pass

    (Is this test case is pass)?

    ReplyDelete