Equivalence Partitioning and Boundary Value Analysis

As you already know EP and BVA are Black box Test design Techniques. Dividing the test input data into a range of values and selecting one input value from each range is called Equivalence Partitioning. We use this technique with below goals:

1.To reduce the number of test cases to a necessary minimum.
2.To select the right test cases to cover all possible scenarios.

In EP, we usually make partition between valid and invalid value range. Considering an example, Lets assume an input field takes year of birth between 1990 to 2000. In this case

Invalid range
Valid range
<1990 and >2000
1990 - 2000

For the most part, errors are observed in the extreme ends of the input values, so these extreme values like start/end or lower/upper values are called Boundary values and analysis of these Boundary values is called Boundary value analysis. In BVA you usually get 6 test cases n-1, n and n+1 for upper limit and lower limit. Considering above example, BVA will have 1989, 1990, 1991, 1999, 2000 and 2001.

So, with this explanation. I hope concept of EP and BVA is clear. Now I would like to consider sample exam question from Test Analyst exam for solving.

Q: A company has set up an employee wellness program and combined it with the premium for health insurance:

The full standard premium for a health insurance policy is $400.

The program have the following rules:

1) Employees who make a pledge — on the honor system — that they don’t smoke, or that they take a stop-smoking class, and have a BMI below 30, get 10% off their contribution toward the full standard insurance premium.

2) Employees who fill in a “health risk assessment” with more health details will be rewarded with a $25 reduction in premium.

3) Employees who participate in a yearly health control at the company
a) receive a $50 reduction in their premium for having a BMI of 27.5 or less, and a $25 reduction for having a BMI below 30. And 
b) if they are non-smokers, they receive an additional $50 reduction in their premium, and those that have joined a stop-smoking class receive a $25 reduction.

Smokers pay an additional premium of $75.

How many test cases are needed to achieve 100% test coverage of equivalence partitions of the input parameters, when testing this specification by applying the equivalence partitioning test design technique and what will be the maximum and minimum resulting premium?

Solution: 
Lets first identify Valid and Invalid partition for each class

Class
Invalid range
Valid range
BMI
>=30
<=25.5 and 27.5 - 30
Assessment
No
Yes
Health Control
No
Yes
Smooking
No
Yes, Stop smoking
Looking at table above, both BMI and Smoking have 3 values, hence 3 test cases are needed to touch each class at least once.

The maximum premium is for the least healthy: smokers that won’t quit and don’t sign the pledge pay $400 + $75 = $475

The very healthy pay:

Full standard premium: $400
Rule 1: -10% ($40) for not smoking
Rule 2: -$25 for the assessment
Rule 3: -$50 for health control and BMI<=27,5
-$50 for health control and not smoking

So, $400 - $40 - $25 - $50 - $50 = $235

Let us consider another easy sample question

Q. A diamond retailer is introducing a new stock taking system. Each diamond is assigned a
character that represents the colour. The valid domain for the character ranges from D to Z. The
color is then graded using the following scale:

Color
D-F
G-J
K-M
N-R
S-Z
Grade
Colorless
Near colorless
Faint Yellow
Very light Yellow
Light Yellow

Which of the following test sets will provide the best equivalence partitioning coverage?
A. D, F, G, H, K, M, N, P, T, Z
B. D, G, K, N, S
C. A, E, H, L, P, T, §
D. E, H, L, M, U, €

Solution:  Lets us identify valid and invalid ranges






Looking at the partition above if you want to consider one value for each partition and mapping this with answer set C is the correct answer.

Let us consider one last example covering BVA

Q. For a tax system the earnings € 4.000 are tax free, the following € 1.500 are charged at 10%, the
following € 28.000 at 20% and the remainder above 40%. All values are rounded to € 1.
What test case could result from a boundary value analysis?

Answer:
A. 1500
B. 33501
C. 4499
D. 28001

Solution:  Lets us identify boundary values for each partition







So, considering boundary values in the picture above and trying to map that to answer set, the correct answer is B which is one of the Boundary values from 3rd partition in the picture above.

Comments

  1. Equivalence Partitioning And Boundary Value Analysis >>>>> Download Now

    >>>>> Download Full

    Equivalence Partitioning And Boundary Value Analysis >>>>> Download LINK

    >>>>> Download Now

    Equivalence Partitioning And Boundary Value Analysis >>>>> Download Full

    >>>>> Download LINK TM

    ReplyDelete
  2. Worxremotely brings employee wellness programs like doctor on call, hydration goals, self-exercise facilitations, virtual events

    ReplyDelete
  3. In addition to --> "Looking at table above, both BMI and Smoking have 3 values, hence 3 test cases are needed to touch each class at least once." - would be nice to note that - Singleton wise testing is applied after partitions are defined, to result with just 3 test cases.

    ReplyDelete

Post a Comment

Please leave your comments here