Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

junit test case generator

Is there a good tool out there to automatically generate jUnit test cases based on some primitive template? This is so that test cases can be written by engineers who do not have a lot of Java or jUnit background. As background information, this is for black box testing. If there is some other alternative to run regression tests than using jUnit, I would also appreciate hearing about it.

Thx

like image 451
bob Avatar asked Nov 04 '10 22:11

bob


People also ask

Can we generate JUnit test cases?

Creating a JUnit Test Case in EclipseTo use JUnit you must create a separate . java file in your project that will test one of your existing classes. In the Package Explorer area on the left side of the Eclipse window, right-click the class you want to test and click New → JUnit Test Case.

How do you automatically generate test cases?

To record the test case, click on the TestCase Studio icon on the toolbar. Now keep performing your steps, it will automatically record all the user actions. You can save the recorded steps by clicking on the Download Test Case button.

How do you create a test case in Java?

Right-click the test root folder or package in the test root folder in which you want to create a new test and select New | Java Class. Name the new class and press Enter . Press Alt+Insert and select Test Method to generate a new test method for this class.

Can we automate JUnit?

Besides manual testing, JUnit is preferred equally for automation testing. It can also be used along with the Selenium WebDriver to automate tests for web applications. It provides a unique way to write structured, short, and better test cases.


1 Answers

Parasoft's JTest is a commercial tool but it is quite good for:

  • generating unit tests for an existing codebase
  • creating regression tests

For a free solution you can try the JUnit generation functionality of the CodePro Analytix Eclipse plugin.

like image 101
Csaba_H Avatar answered Sep 18 '22 19:09

Csaba_H