Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm trying to do revision on past paper questions on equivalence class testing and this is a question I'm getting rather confused about. As I understand it, there are three bits to defining this equivalence class (see bottom of Q for snippet). There is: 'age', 'claims', and 'condition'. To solve this question, one should state the actions, followed by the age brackets, then in another case, they should state the condition?

Something along these lines:

condition = {(50% increase, 25% increase, £100 + letter, £75, £400, £200) | 0 <= age <= 25, 26 <= age <= 100, 0 <= age <= 25, 26 <= age <= 100, 0 <= age <= 25, 26 <= age <= 100}
age = {(0 <= age <= 100)}
claims = {(0 <= claims <= 10)}

Would I be correct in assuming that the final product would be as follows:

c0 = {age is an element of condition | age | claims}
c1 = {age is an element of ¬condition | age | claims}
c2 = {age is an element of condition | ¬age | claims}
c3 = {age is an element of condition | age | ¬claims}

Thanks, I greatly appreciate your help! :-)

Practice Question

share|improve this question

2 Answers 2

You have six valid equivalence classes and four invalid equivalence classes. As Jeff says, there are 2 valid age classes and 3 valid claims classes, so in combination you've got six:

  1. 0 <= age <= 25 AND number of claims = 0
  2. 26 <= age <= 100 AND number of claims = 0
  3. 0 <= age <= 25 AND number of claims = 1
  4. 26 <= age <= 100 AND number of claims = 1
  5. 0 <= age <= 25 AND 2 <= number of claims <= 10
  6. 26 <= age <= 100 AND 2 <= number of claims <= 10

The invalid classes are:

  1. Age < 0
  2. Claims < 0
  3. Age > 100
  4. Claims > 10

A real-world test would include these as possible tests because each should trigger a different error (yes, this is outside the scope of the question):

  1. Invalid data entered for age.
  2. Invalid data entered for claims.
  3. Too old to insure.
  4. Too risky to insure.
share|improve this answer

This is interesting, because normally you will see equivalence classes in terms of a single variable with other inputs held constant. I would think that the equivalence classes for two variables would depend on whether they are independent or dependent. In this case, the variables appear to be independent, since there are no overlapping resultant values. (In other words, you cannot predict the resulting value based on a single variable value.) Based on that, I would say that the number of equivalence classes would be 6, based on two age classes and three claims classes (and based on the preconditions stated).

Outside of the test question itself, in the real world I would also add negative equivalence classes for each of the assumed boundary conditions, which would result in additional classes (e.g. attempting to enter a claim of < 0 and an age of over 100). However, that wouldn't apply in the mythical test question world. ;o)

Your Venn diagram would show the overlap of the classes for each of the independent variables.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.