I was recently sent an article on different testing methodologies. Thanks Danny.

The article covered a topic that I think many people may forget about when thinking of how to write tests. That topic is Equivalence Partitioning. Equivalence Partitioning is used to help minimize the number of tests you write while still having very good testing coverage.

It basically groups scenarios into a set needing only a single test to cover it. The example used in the article was a simple program that would display “Success” when a number between 1 and 5 was entered ( if only all problems were this simple).

A developer implements logic such as;

if(IntegerEntered >= 1 && IntegerEntered <= 5) DisplayMessage(Success);

In this implementation the values 1,2,3,4, and 5 are equivalent from a testing point of view. Additionally, any number <= 0 is equivalent and any number >= 6 is equivalent.  Thus you only need to implement 3 tests to have 100% coverage in this scenario instead of a test for every imaginable number.

It is possible do spend all of your time testing. Every possible scenario would take forever to test for. We need to assign the appropriate value to a test and implement the highest of those. Typically the more complex or vital a process the more time you may want to spend writing automated testing for it.

The article Proper test case design for testing – equivalence partitioning is a good refresher and has some other very good methodologies that can be used.

 

What have you found works well.

Let us know in the comments below.