Testing and Code Analysis
When you are testing your application, the IDE provides tools for using JUnit and TestNG, as well as code analyzers, in particular FindBugs.
The IDE lets you create tests, using wizards and templates, for the popular JUnit and TestNG test frameworks.
Once you have created tests for your Java classes, you can run them individually or all at the same time.
The Test Results window shows the results of the tests you run.Writing JUnit Tests in NetBeans IDE
Video of Using TestNG in NetBeans IDE
Static analysis tools are integrated into the IDE. Using code patterns, predefined by the IDE, by contributors, or yourself, you can search your codebase for common syntax errors or problems.
In particular, the IDE provides support for the popular open source FindBugs tool. FindBugs is a static analysis tool that lets you identify bugs in Java code.