[Webtest] 100% test coverage

Dierk Koenig webtest@lists.canoo.com
Tue, 29 Jul 2003 17:40:33 +0200


Hiall,

I'm happy to announce that Canoo WebTest is now covered 100% by its
selftests.
You can explore this under
http://webtest.canoo.com/webtest/clover/index.html

The coverage is achieved by a combination of unit tests and
functional selftests. No manual test is involved.

There are a few classes that were excluded from the statistics.
These are classes that I do not expect to be covered 100%:
- The selftest dummy webapp
  is very likely also covered 100% but I haven't found an
  easy way to sneak in the report.
- The httpunit package
  is only a playground without any functional purpose.
- The security package
  contains wrappers around the JDK JSSE implementation.
  I just didn't take the challenge to test this, yet.
  Any help is appreciated.
- The "Throw" class in the "self" package
  is a weird thing. It encapsulates the testing of
  exception handling. Testing its error scenarios is
  fairly complicated as would involve tweaking JUnit.
- Append.java
  should actually be removed from WebTest as it does
  not belong there.(Tool-Task for testing XSLT with WebTest)
- AllTests
  to allow uncovered points of starting TestSuite execution.

I deliberately included the JUnit test classes.
That helped me finding tests that were not included in any
suite and test-methods that re-named in order to suppress
their execution (like "testMe()" to "_testMe()").

Overall, the exercise took some time but was not too
complicated. Seeing the green bar growing was a good
motivation.
During the exercise, it appeared to me that untested code
is very likely to be duplicated or even multiplied.
Especially centralizing the error handling improved both,
coverage and code appearance.
Re-visiting the code for coverage purposes certainly
improved the codebase.

Finally, I'd like to emphasize that 100% test coverage has
nothing to with "code complete" and certainly not "error-free".

cheers
Mittie


*******************************************
Dierk Koenig
Canoo Engineering AG
Kirschgartenstrasse 7
CH-4051 Basel
Tel +41 61 228 9444
Fax +41 61 228 9449
mailto:dierk.koenig@canoo.com
http://www.canoo.com

ULC - Grant your Servlets a Swing Look&Feel
http://www.canoo.com/ulc
*******************************************