how to test or describe endless possibilities?

Posted by koen on Stack Overflow See other posts from Stack Overflow or by koen
Published on 2010-03-06T15:41:55Z Indexed on 2010/03/08 8:06 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

Example class in pseudocode:

class SumCalculator
  method calculate(int1, int2) returns int

What is a good way to test this? In other words how should I describe the behavior I need?

test1: canDetermineSumOfTwoIntegers

or

test2: returnsSumOfTwoIntegers

or

test3: knowsFivePlusThreeIsEight

Test1 and Test2 seem vague and it would need to test a specific calculation, so it doesn't really describe what is being tested. Yet test3 is very limited.

What is a good way to test such classes?

© Stack Overflow or respective owner

Related posts about TDD

Related posts about unit-testing