NetBeans 6 Tools Support
Three areas of improvements worth noting regarding tools in NetBeans 6 are the Profiler, HeapWalker, and the integration of JMeter. Of course, NetBeans offers other tool support, such as JUnit for built-in unit testing, Ant for script-based system builds, deployment, and testing, as well as multiple source code control systems. First, let's look at the Profiler.
It's important to know how your code behaves as thoroughly as possible, even during the development cycle. This means you need to watch it in the debugger, force the execution of error handling code paths that otherwise get executed in rare conditions, and perform black-box testing. When those steps are complete, it's helpful to get a view of your code as it runs from the computer's point of view. This is where the code profiler comes in to play.
Code profiling measures the execution time of your code as methods are called, classes are loaded, and memory is allocated and freed. The Profiler tool that comes with NetBeans will do this for you when you choose the Profile Main Project menu option from the Project menu. After starting your application in the Profiler, exercise it as thoroughly as possible, as applicable to the area you're testing. Afterwards, NetBeans will display a graph that shows which classes and methods were called most, which code took the longest to execute, and so forth (see Figure 5). This is a tool that most developers should already be familiar with.
A new feature in NetBeans 6 lets you explicitly insert profile points (to measure execution time within a certain block of code) without requiring you to add invasive instrumentation code (see Figure 6). You can time the execution of code, or take snapshots of memory usage to perform deltas with at a later time. Profile points can be tied to specific lines of code, events that your code handles, or they can be time-based.
The HeapWalker tool, traditionally available as a standalone application with the JDK, is enhanced for use within NetBeans. With it you can monitor garbage collection, view which classes use the most memory in terms of percentage, instance count, or size in bytes (see Figure 7), and you can drill down into specific instances of a class and inspect its memory usage (see Figure 8).
The integration of Apache JMeter lets you perform server performance testing, for both static and dynamic web resources. All of the statistics are integrated with NetBeans' graphical profiler display.
UML support has also grown in NetBeans 6. You can create projects based on UML, and then generate Java source code from the diagrams. New with this release, you can reverse engineer existing Java projects and create complete UML models from them. At that point, you can modify the UML, or the Java code, and the changes will be automatically round-trip integrated into the opposing view. The result is that both the Java code and UML models for your application will be kept in sync automatically. Additionally, the code that's generated is done so according to your customized code templates, and does not contain ugly code markers.
Other tools that are continually enhanced are the debugger and the GUI builder. For instance, with competing IDEs as well as previous versions of NetBeans, choosing to step over a line of source code that consists of multiple expressions (such as with if and for statements) would cause focus to remain on that line until all expressions were evaluated. With NetBeans 6, when you step over a line of source, all expressions are executed, and the focus moves to the next source line automatically. This feature alone is worth upgrading to NetBeans 6, in my opinion.
To aid in building applications with graphical user interfaces, new controls allow you to generate UI components directly from your data sources. From that point, the generated UI is automatically kept in sync with changes to the data source. Customizable boilerplate code is included to enable this feature.