Exhaustive Unit Testing

Stefan Behnel stefan_ml at behnel.de
Thu Nov 27 08:52:19 EST 2008


Steven D'Aprano wrote:
> If you don't test all the paths, then by definition you 
> have program paths which have never been tested. Unless those paths are 
> so trivially simple that you can see that they must be correct just by 
> looking at the code, then the chances are very high that they will hide 
> bugs.

Not to mention that you can sometimes look at awfully trivial code three
times and only see the obvious bug in that code the fourth time you put an
eye on it a good night's sleep later.

Expecting code paths in a nested if statement with nine conditions that are
not worth testing due to obvious triviality, is pretty hubristic.

Stefan



More information about the Python-list mailing list