Download NetBeans

NetBeans IDE Features

Testing and Code Analysis

Java editor features in NetBeans IDE
Click image for fullscreen preview

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

Code Analysis

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 old code constructs, common syntax errors, or other problems. For example, you can search through all your applications simultaneously for anonymous inner classes that have a single abstract method and upgrade them to Java 8 lambda expressions.

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.

Static Code Analysis in the NetBeans IDE Java Editor


See Also