Question
Asked 6 January 2015

Does anyone know of a good JUnit test generation tool?

I'm looking for a tool to generate unit tests (pref. JUnit) for a given Java code base.
It is meant to be used by students in a course on s/w reverse engineering and reengineering. The student will explore various tools (e.g., metrics, style).
In the past, I tried AgitarOne to generate tests, but those tests require a specific plugin just to run them and do not seem to work with standalone tools outside its suite (e.g., EclEmma). Besides, AgitarOne is rather heavy and its usage policy of for academia is rather restrictive.
Does anyone know of some tool that does not have such problems?

Most recent answer

All Answers (7)

Peter M. Kruse
Assystem Germany GmbH
You might also be interested in other participants of the Java Unit Testing Competition (2 rounds already done, 3rd round announced): http://sbstcontest.dsic.upv.es/
2 Recommendations
I did this study around 2 years back, I guess this would be useful for you...
Amjed Tahir
Massey University
I found CodePro Analytix to be practical...
This is a complete Eclipse code analysis tool for Java programs. The tool will help you to generate unit tests (JUnits) as well as measuring Code and Test Coverage levels.
Akash Tripathi
Indian Institute of Information Technology Design and Manufacturing Jabalpur
You can use CodePro Analytix. It is open source. Besides generating Junit test  cases, it also have number of features. Try it once. 

Similar questions and discussions

Do you know any papers on verification of dependency injection modules/IOC containers?
Question
3 answers
  • Jens von PilgrimJens von Pilgrim
Dependency injection (DI) is a great pattern/principle to make code better configurable and testable. 
Using a framework (in Java) such as Guice (or any other JSR 330 implementation), or some other so called "inversion of control (IOC) container", really simplifies using DI. But even the most simple usages are often problematic. E.g. (with an JSR330 annotation with field injection):
class C {  @Inject X x; }
This class must not be created via new in normal client code, because then x cannot be injected. Also, assuming X is an interface, there needs to be a configuration (binding) for X.
I'm wondering if there exist any work on verifying these kind of situations. Are there any IDEs or tools implementing such verification (e.g., creating at least a warning if, given the example above, C is created via new or if no binding for X is detected)? Of course there are many more problems, such as DI cycles etc. 
Do yo know any research addressing these and other issues?
So far, I have only found a single paper [HH13], but this paper only scratches the surface. It defines two constraints which are to be satisfied: Compatibility (a binding T to an injected type D must be a subtype: T<:D) and completeness (for all D: exists binding T). Unfortunately, the paper does not handle cases such as scoping, multiple modules etc. And even the simple case of new constructor call as shown in the example is not handled.
[HH13] Hudli, Shrinidhi R. ; Hudli, Raghu V.: A Verification Strategy for Dependency Injection. DOI 10.7763/LNSE.2013.V1.16. In: Lecture Notes on Software Engineering 1 (2013), Nr. 1, S. 71–74

Related Publications

Conference Paper
The rise of agile methodologies and open source software has led to the creation of several new tools designed to help software engineers construct better applications. One particular emphasis of these new tools is the creation of unit tests. This paper describes a qualitative assessment of the reverse engineering capabilities of three unit testing...
Article
Viele Architekturreviews sind mit dem Problem konfrontiert, dass die zu betrachtende Architektur weder modelliert noch dokumentiert oder auch nur ausreichend erforscht ist. Eine solche Situation ist im Rahmen der Softwareentwicklung nicht unbekannt, speziell bei Legacysoftwaresystemen tritt dies häufiger auf. Die in solchen Fällen genutzten Methode...
Article
The key to applying computer-aided software engineering to the maintenance and enhancement of existing systems lies in applying reverse-engineering approaches. However, there is considerable confusion over the terminology used in both technical and marketplace discussions. The authors define and relate six terms: forward engineering, reverse engine...
Got a technical question?
Get high-quality answers from experts.