Automatic generation of unit tests for Java?

Viewed 85638

Any tool for automatically generating unit tests for Java code?

UPDATE: Primary intended use is to quickly generate unit tests for legacy code that is going to be refactored. No need to automatically keep the tests in sync with the code after automatic generation.


Almost same question was asked here, but the answer was for .NET instead of Java (Pex was the accepted answer):

Automatic generation of Unit test cases for .NET and Java

6 Answers

All three products have a try before you buy option, so you could use them to compare the generated code against a small subset of your application.

NetBeans does it automatically from Java source files (I guess the other IDEs too).

Maybe you could take a look into the junit plugin (link is currently down :-()?

I think Agitar had a tool like this called AgitarOne. I think you can still get it but make sure the company is still there.

Related