Example
As an example we have a simple method that takes two integers and multiplies them.
public int calculate(int x, int y) {
return x*y;
}
As part of the TDD process before creating the calculate method two test cases were written. The first one testing single digits.
assertTrue(4 == calculate(2, 2));
The second test case testing two digits integers.
assertTrue(100 == calculate(10,10));
It’s now the TestED eclipse plugin kicks in when the developer got two passing test for one method, in this case the method “calculate”. In the Problems tab within eclipse a few hints are given, here are some examples.
What happens if you test the method "calculate" with a negative integer as input?
What happens if you test the method "calculate" with only "-2147483647" as input?
What happens if you test the method "calculate" with only "2147483647" as input?
What happens if you test the method "calculate" with only zeros as input?
Similiar suggestions/hints are given if there is only a string as input for a method.