[jsword-devel] Feature found

Joe Walker joe at eireneh.com
Sat May 22 03:30:20 MST 2004


Hi,

DM Smith wrote:
> Next question. Should we do testing with asserts on, off or both? Or is 
> code inspection sufficient to ensure that the asserts have no side 
> effects and that the code does the right thing when the condition arises 
> and the assert is not present?

I think it depends on what sort of testing you are doing.
If I can split testing into development testing and acceptance testing, 
generally speaking I would expect asserts to be on in development 
testing because you expect things to break, and off in acceptance 
testing because you don't.

With acceptance testing, we test what the user gets, so asserts need to 
be off, like the user gets. With development testing we want to see 
faults so asserts are on.

So where does JUnit lie? I think JUnit tests have 2 uses, TDD and 
regression.
For TDD you expect failure so asserts should be on. For regressions 
tests, you expect success so asserts off.
However that said, one of the points of JUnit is the low cost of 
execution, so it should be easy to run with both.

Sensible?

Joe.




More information about the jsword-devel mailing list