Improve the quality of your J2EE-based projects

Effective tools, gates, and accountability can help ensure your system's success

Many people incorrectly judge Java/J2EE-based systems on problems associated with maintaining the codebase, the number of bugs or inconsistencies in functionality, or poor performance. Fortunately, these problems have less to do with the Java/J2EE technology itself and more to do with the lack of a process focused on the quality of the system. To ensure success of large-scale Java/J2EE projects developed by a sizeable team, or across multiple teams, a team lead must:

  • Use tools that can measure quality
  • Define a set of gates and artifacts derived from the tools
  • Stress accountability to deliver, monitor, and enforce the results

This article explains how incorporating these three tactics into your development strategy can ensure that your team consistently produces quality projects.

Importance of tools

Have you ever heard of a construction company attempting to build a house without a power saw, electric drill, or a tool as fundamental as a hammer? True, a house could be built without today's new-fangled equipment, however, construction would take much longer, and the same level of quality would prove nearly impossible to achieve. You could build a hut with your bare hands, but you could build a mansion with the right tools.

Today's developers are no different than a person attempting to build a house. The tools are essential to the developer, both for increasing productivity and for enhancing quality. The tools developers use must enable them to produce the highest quality code possible in the shortest amount of time, which means that today's IDE is no longer simply a tool used to write, debug, and compile code. Instead, an IDE must help developers identify whether they are following proper coding conventions and known design patterns, if they are in compliance with industry standards such as Web services, if their code adheres to its contract, and if it performs per the requirements. In addition, when developers are not given the environments necessary to achieve continuous builds and automated testing, an IDE's capabilities become even more important to ensuring the system's quality.

Enter the Eclipse IDE, which provides built-in capabilities that, when used with several plug-ins, can aid in increasing the quality of both the codebase and the system. Eclipse is an open, extensible IDE built for anything and nothing in particular. Eclipse’s Java development environment is open source, free, and fully customizable. Eclipse both enables and promotes the addition of new capabilities via open source and commercially available custom-built plug-ins. By utilizing Eclipse, along with a key set of plug-ins illustrated in the Eclipse plug-in matrix shown in Figure 1, it is possible for a developer, and a team, to measure the quality of any J2EE- or Java-based system.

Figure 1. Eclipse plug-in matrix

Controlling the quality of a system is impossible if you cannot measure and monitor it. It is important to understand key areas in a system that warrant measurement. These areas include a system's maintainability, reliability, and performance. While this list is obviously not all-inclusive, these three items are highly suited as the basic building blocks for ensuring the quality of a system.

Maintainability involves the complexity associated with understanding the code or modifying the code, whether it is a bug fix or an enhancement. Well-documented code that follows known coding standards and industry design standards is easier to maintain than code with sparse documentation that doesn't follow any known standard development practices. Highly maintainable code allows changes to be introduced more quickly, thereby permitting the business to respond more rapidly to new requirements or change requests, and ultimately reducing the overall cost of both new features and ongoing maintenance.

Reliability indicates whether a method adheres to its contract and can be executed successfully. Unit tests are used to exercise a method's contract, thus verifying the reliability of the code segment. The quality of the unit tests, in turn, is verified via code coverage analysis. Many approaches are available for measuring code coverage, including, but not limited to, statement, decision, condition, path, and call analysis. The type and amount of coverage necessary to provide absolute reliability of a method is a popular discussion topic. For this article's purpose, simply note that reliability increases as the amount of code coverage increases.

Method reliability within a system is of the utmost importance as it represents, to some extent, a system's stability. Other problems, such as performance or scalability issues, could arise, which may not be as readily found even with extensive unit testing and coverage analysis. Thus, unit testing and coverage analysis are by no means a be-all, end-all solution to ensuring system stability; however, the ability to reliably execute methods consistently represents a good measuring stick of the system's reliability.

Performance is typically measured on a per-unit-of-time basis. A system's ability to process numerous requests, to the amount of information sent over the wire, to the response time of a particular system call, are all performance criteria measured based on a unit of time. It is important to know, to some extent, how the system will perform. To ensure this understanding, one could measure all major service methods or potential problem areas with expected high usages, long call stacks, or those pieces that represent the most common paths through the core architecture. Each approach provides a varying level of comfort with regard to performance. For large-scale systems, performance should be continually maintained and monitored during development to identify snags early and avoid unforeseen problems in production environments.

Let's now examine how the use of Eclipse and its plug-ins can help a development team, measure the maintainability, reliability, and performance of any Java- or J2EE-based system.

1 2 Page 1
Page 1 of 2