how to test or describe endless possibilities?
bdd, tdd, testing, unit-testing
Solution
I would test the boundary conditions (max-int, min-int, zero, positive, negative) and some typical cases:
test1: sumOfPosAndPos
test2: sumOfPosAndNeg
test3: sumOfPosAndZero
test4: sumOfNegAndZero
test5: sumOfMaxIntAndMinInt
etc.
Problem
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?