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've read a number of papers and books on equivalence partitioning but can't seem to get my head around this one part.

My question is: Are these valid equivalence partitions?

Let say I have a program that adds together the points each player gets in a game of snooker and each game is part of a match. When a game has completed the winner is announced and when the match has completed (after 3 games) the match winner is announced.

Would partitions that depend on a series of inputs be valid? Such as:

Player 1 wins the game

player 2 wins the match

share|improve this question
add comment

1 Answer

The answer is no.


Equivalence partitioning is used for input or output values of a software component, so that you can derive test cases using representative values of the partitions.

Example:

If you want to test a function which determines the winner of a game after it has ended, and there are two input parameters pointsPlayer1 and pointsPlayer2, the domains of these parametes would be

0 <= pointsPlayer1 <= maxValue and 0 <= pointsPlayer2 <= maxValue

maxValue is the maximum number of points in a game, you have to use the concrete maximum value for snooker for this placeholder.

You have do divide the domain in ranges from which you expect the software component to behave equal for each value in these ranges.

The following "valid" partitions can be used:

  1. pointsPlayer1 < pointsPlayer2
  2. pointsPlayer1 > pointsPlayer2

Partition 1 is used for the test cases where player 2 wins Partition 2 is used for the test cases where player 1 wins

You have to consider an additional condition for deriving your test cases:

pointsPlayer1 + pointsPlayer2 <= maxValue

"Valid" partitions are used to test the "good" cases (valid parameter values). The "bad" cases, i.e. invalid parameter values, should also be tested. "Invalid" partitions are used for this. "Invalid" partitions would be for example:

  1. pointsPlayer1 < 0
  2. pointsPlayer1 > maxValue
  3. pointsPlayer1 + pointsPlayer2 > maxValue

and so on.

share|improve this answer
add comment

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.