- Notifications
You must be signed in to change notification settings - Fork45
Automated unit test generation and precise code analysis for Java
License
UnitTestBot/UTBotJava
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
👉 Find UnitTestBot onJetBrains Marketplace.
👉 Visit theofficial UnitTestBot website.
UnitTestBot is the tool forautomated unit test generation andprecise code analysis. It produces ready-to-usetestcases forJava — withvalid inputs and comments. It can even predict whether the tests fail or pass. You can analyze them, run them, show coverage — as if you've created them personally.
Thesymbolic execution engine paired with asmart fuzzing technique constitutes the core of UnitTestBot. It helps tofind errors andprevent regressions in the code in a much more efficient way — UnitTestBotmaximizes path coverage whileminimizing the number of tests and false positives.
UnitTestBot represents all the test summaries in ahuman-readable format. The intelligible test method names and comments help you to control the whole testing process. Test failed? The summary refers you to the related branch or the condition under test.
Try theonline demo to generate unit tests with one click.
Get to know thefull version of UnitTestBot plugin with this quick guide:
Install UnitTestBot plugin for IntelliJ IDEA
Try the most straightforward path to start using UnitTestBot plugin.
- Please check thesystem requirements.
- Open your IntelliJ IDEA.
- Go toFile > Settings... > Plugins > Marketplace.
- In the search field typeUnitTestBot — you'll see the UnitTestBot plugin page.
- Press theInstall button and wait until it changes toInstalled, then clickOK.
Now you can find the UnitTestBot plugin enabled in theFile > Settings > Plugins window.
Do you want to manually choose the build or to update the plugin? Please refer toInstall or update plugin in our user guide.
Generate tests with default configuration
Proceed to generating unit tests for the existing Java project. If you don't have one, create it using theJetBrains tutorial.
- Open your Java project in IntelliJ IDEA.
- Right-click the required package or a file in the Project tool window, scroll the menu down to the bottom andchooseGenerate Tests with UnitTestBot...
- In theGenerate Tests with UnitTestBot window tick the classes or methods you'd like to cover with unit tests andpressGenerate Tests orGenerate and Run.
Now you can see the resulting test class or classes in the Editor tool window.
Need to configure testing framework, mocking strategy or parameterization? Please check allconfiguration options.
Make use of generated tests
What can you do with the output?
- Tofind and fix the errors in your code:
Run the generated tests: right-click the test class or a folder with tests and chooseRun.
In the Run tool window you can see the tests failed with the brief failure explanation.
Fix your errors if needed.
- Toprevent regressions:
Having your errors fixed, run the tests again. "Passed"? Commit them as the regression suite.
Introduce changes in the code and run your tests as often as needed!
Tests failed? Decide whether it is a bug or a feature and generate new tests if necessary.
- Toview coverage:
Right-click the test class, chooseMore Run/Debug > Run ... with Coverage.
Want to know more about test descriptions or SARIF reports? Please learn how toGet use of test results.
UnitTestBot is an open source project. We welcome everyone who wants to make UnitTestBot better — introduce a new feature or report a bug. We have only one kind request for our contributors: we expect you to prove the necessity and quality of the suggested changes.
How can you do this? Refer to ourContributing guide.
Feel free to join theDiscussions!
And thank you for your time and effort! ⭐
Having troubles with using UnitTestBot? Contact usdirectly.
You can also tryUnitTestBot developed especially for C/C++.
You are welcome tocontribute to it too!
About
Automated unit test generation and precise code analysis for Java
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.