Skip to main content

Equivalence partitioning

Equivalence partitioning:


Equivalence partitioning is a method for deriving test cases. In this method, classes of input conditions called equivalence classes are identified such that each member of the class causes the same kind of processing and output to occur.

In this method, the tester identifies various equivalence classes for partitioning. A class is a set of input conditions that are is likely to be handled the same way by the system. If the system were to handle one case in the class erroneously, it would handle all cases erroneously.

Equivalence partitioning drastically cuts down the number of test cases required to test a system reasonably. It is an attempt to get a good 'hit rate', to find the most errors with the smallest number of test cases.

To use equivalence partitioning, you will need to perform four steps:

  • Determining conditions to be Tested
  • Defining Tests
  • Designing test cases
  • Identifying Final set of Test Cases

Defining Tests

A number of items must be considered when determining the tests using the equivalence partitioning method, like:
  • All valid input data for a given condition are likely to go through the same process.
  • Invalid data can go through various processes and need to be evaluated more carefully. For example,
  • a blank entry may be treated differently than an incorrect entry,
  • a value that is less than a range of values may be treated differently than a value that is greater,
  • if there is more than one error condition within a particular function, one error may override the other, which means the subordinate error does not get tested unless the other value is valid.
Defining Test Cases

Create test cases that incorporate each of the tests. For valid input, include as many tests as possible in one test case. For invalid input, include only one test in a test case in order to isolate the error. Only the invalid input test condition needs to be evaluated in such tests, because the valid condition has already been tested.

EXAMPLE OF EQUIVALENCE PARTITIONING

1. Conditions to be Tested

The following input conditions will be tested:
  • For the first three digits of all social insurance (security) numbers, the minimum number is 111 and the maximum number is 222.
  • For the fourth and fifth digits of all social insurance (security) numbers, the minimum number is 11 and the maximum number is 99.
2. Defining Tests

Identify the input conditions and uniquely identify each test, keeping in mind the items to consider when defining tests for valid and invalid data.

The tests for these conditions are:
  • The first three digits of the social insurance (security) number are:
  1. = or > 111 and = or <>
  2. <>
  3. > 222, (invalid input, above the range),
  4. blank, (invalid input, below the range, but may be treated differently).
  • The fourth and fifth digits of the social insurance (security) number are:
  1. = or > 11 and = or <>
  2. <>
  3. > 99, (invalid input, above the range),
  4. blank, (invalid input, below the range, but may be treated differently).
Using equivalence partitioning, only one value that represents each of the eight equivalence classes needs to be tested.

3. Defining Test Cases

After identifying the tests, create test cases to test each equivalence class, (i.e., tests 1 through 8).

Create one test case for the valid input conditions, (i.e., tests 1 and 5), because the two conditions will not affect each other.

Identify separate test cases for each invalid input, (i.e., tests 2 through 4 and tests 6 through 8).

Both conditions specified, (i.e., condition 1 - first three digits, condition 2 - fourth and fifth digits), apply to the social insurance (security) number.

Since equivalence partitioning is a type of black-box testing, the tester does not look at the code and, therefore, the manner in which the programmer has coded the error handling for the social insurance (security) number is not known. Separate tests are used for each invalid input, to avoid masking the result in the event one error takes priority over another.

For example, if only one error message is displayed at one time, and the error message for the first three digits takes priority, then testing invalid inputs for the first three digits and the fourth and fifth digits together, does not result in an error message for the fourth and fifth digits. In tests B through G, only the results for the invalid input need to be evaluated, because the valid input was tested in test case A.

4. Suggested test cases:
  1. Test Case A - Tests 1 and 5, (both are valid, therefore there is no problem with errors),
  2. Test Case B - Tests 2 and 5, (only the first one is invalid, therefore the correct error should be produced),
  3. Test Case C - Tests 3 and 5, (only the first one is invalid, therefore the correct error should be produced),
  4. Test Case D - Tests 4 and 5, (only the first one is invalid, therefore the correct error should be produced),
  5. Test Case E - Tests 1 and 6, (only the second one is invalid, therefore the correct error should be produced),
  6. Test Case F - Tests 1 and 7, (only the second one is invalid, therefore the correct error should be produced),
  7. Test Case G - Tests 1 and 8, (only the second one is invalid, therefore the correct error should be produced).

Comments

Superb blog.
Please can you add my website i.e http://www.makemoneykingdom.com in your favorite link.

Thanks
Anonymous said…
Good write-up. I certainly appreciate this site.

Thanks!
http://hen64.org/blogs/post/2851
http://www.aglea.com/modules.php?name=Your_Account&op=userinfo&username=AlysiaIvonne
Feel free to visit my web page :: bioethics
Anonymous said…
This article is genuinely a fastidious one it helps
new internet visitors, who are wishing in favor of blogging.


Have a look at my homepage ... best golf courses arizona
OffiDrivers said…
if there need software or driver visit here
Official Drivers Download Hp Printer
Official Drivers Download Samsung
Official Drivers Download Sony
<a href='http://www.offidrivers.ga" rel="nofollow">Official Drivers Download Toshiba</a>
OffiDrivers said…
<a href='http://www.offidrivers.ga">Official Drivers Download Acer</a>

Popular posts from this blog

Internet is harmful for you: Google thinks so

Click the image to see it in full size:



Today, for a few minutes Google suddenly started warning all of its indexed sites as Harmful to your computer! Perhaps it was a glitch in their algorithm, but we managed to make a snap of it for the record.

Istqb,cste inforamtions and training centers in India

About istqb:
The ISTQB was officially founded as an International Testing Qualifications Board in Edinburgh in November 2002 and it is responsible for the "ISTQB Certified Tester", which is an international qualification scheme.

ISTQB is the parent body responsible for approving various national boards in addition to other tasks such as defining the syllabi for various certifications.
website url:
www.indiantestingboard.com FAQ :http://208.116.30.129/faq.htm

for examination and preparation and sample question papers available in below link

will be helpful for ISTQB http://india.istqb.org/resources.htm

http://www.geekinterview.com/quiz/Testing

join yahoo groups:
in this group you can ask your queries about istqb examinations and certification related doubts and sample papers to certified testers..foundation level and advance level question keep on raised by members.

ISTQB-India@ yahoogroups. com

CSTE information:

QAI, India, the premier knowledge corporation in the software engineerin…

Cyclomatic complexity

Cyclomatic complexity is a software metric (measurement). It was developed by Thomas McCabe and is used to measure the complexity of a program. It directly measures the number of linearly independent paths through a program's source code. It is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the commands of a program. A directed edge connects two nodes if the second command might be executed immediately after the first command.


Definition

M = E − N + 2P

where

M = cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components.

"M" is alternatively defined to be one larger than the number of decision points (if/case-statements, while-statements, etc) in a module (function, procedure, chart node, etc.), or more generally a system.

Separate subroutines are treated as being independent, disconnected components of the program's control flow graph.