| || |
Code generation of JUnit test cases
I'd like to know the experiences of people with regard to automatic(?) code generation of JUnit test cases. I'm refering to projects which do not work the XP way, but still would like to have high % of unit testing (meaning, unit test code is done at the end), and to projects that need to deal with legacy code.
(a) What has been your experience with tools which auto-generate test cases that give a good % of code coverage when tested with code coverage tools, such as Clover?
I've worked with
- open source options mentioned in http://www.junit.org/news/extension/...ion/index.htm, but these only generate the skeleton of the methods
- JTest, which generates pre-determined values for primitives, and does nothing about Java value object classes, and expects the programmer to add in the "other" test cases - which in effect turns out to be a lot.
I guess what I'm looking for is a tool that "understands" the code and generates unit test cases for all the branches and conditions in the code, in order to achieve maximum code coverage. Is there any such beast out there?
(a1) Has anyone worked with TogetherJ/XPTest (http://www.extreme-java.de) for generating JUnit test cases? I didnt see too much of high-lighting on the TogetherSoft site on this one... What have been your experiences?
(a2) On a related note, does anyone know of XMI-compatible JUnit generators, which would remove the dependency on the UML tool?
(b) What has been your experience with mock objects? Have they been too cumbersome a process for the average project size (say, 100 classes, with 10 value object classes)?
(c) Building functional test cases: I've heard of JFunc; what are the other options, and how do they compare?
Thank you very much,