public String doSomething(SomeClass inputParameter) {
...
if(result != null)
result.trim();
return result;
}
Well as you (probably) know the method will return untrimmed result. This turned into a nasty bug found during UAT testing, which took us couple of hours to find and solve. But this type of bug could be easily found with unit tests (if written properly). This is one of the reasons why I like Test Driven Development.
No comments:
Post a Comment