ritwik (1) [Avatar] Offline
#1
I am a newcomer to Junit Testing. I greatly enjoyed reading the Junit in Action book and surely learnt quite bit on the topic.. I would however feel more comfortable on subject and be able to write decent test cases, if I could examine existing open source projects with test cases in Junit. Can the authors or any other users of this forum suggest open source projects with great test cases. I would prefer projects that do not have very large codebases like jboss. Something easier for a newcomer to grasp. My intention is to understand how Unit tests were used in the given project & what level of granularity was the testing done in the example project.
It would also be nice if some one could make up problem sets (since I am academically minded) and ask the reader to code unit tests on that.. We can then compare the test solutions derived by the authors to that of the reader.
vmassol (51) [Avatar] Offline
#2
Re: Suggestions On Opensource Projects with Good Test Cases
Hi,

Here are some small code base open source projects with nice tests (there are so many others too):
- Jakarta Cactus (for example of Cactus tests)
- qdox (http://qdox.codehaus.org/, check http://qdox.codehaus.org/clover/index.html)
- checkstyle (http://checkstyle.sourceforge.net/clover_html/)

As for the exercice, I'd suggest you pick any open source project you like. For example you can pick one from the above and write unit tests for methods that are not tested. Then, submit what you wanted to test along with your unit tests and we will review it.

Thanks
-Vincent