Nigel Cheshire

Subscribe to Nigel Cheshire: eMailAlertsEmail Alerts
Get Nigel Cheshire: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: Java Developer Magazine

Java Developer : Article

Using Java Development Tools to Enforce Best Practices

Part Two of a Two-Part Article

A source code control system is also beneficial to individual developers wanting to:

• Adhere to best practices
• Create archives for future developers
• Provide a reference point for differences between versions
• Keep a progress journal
• Maintain a central repository/backup

Static Code Checking Software
Static code checking tools help developers conform to coding standards. These tools point to lines of code within files and offer details on how to adhere to these standards. Some code checkers will document possible security violations and provide links directly to the line of code that is causing the violations.

Static code checking tools include hundreds of rules such as:

• Detecting empty finally blocks that can slow code and confuse maintenance programmers.
• Identifying tab characters because editors can interpret them differently in source files, destroying the visual structure of the code.
• Locating multiple on-demand import statements that can clutter your namespace, making it difficult to figure out which class a static member comes from. These statements can also be difficult to read when different classes have static members with the same identifier.

Ideally, development managers should be able run code checking tools against all the code in their repository at one time; thus, providing a global view for tracking their team’s performance and providing feedback for improvement.

Testing Frameworks
All developers understand the need to test their own code, but few take the time or make it a priority. The result is a vicious cycle of development teams performing too few tests and producing poor-quality code, while spending an increasing amount of time in the debugging phase.

Testing frameworks enable developers to write tests as they code. They write the code, test it using the framework and change the code until it meets the expected results. With testing framework software, developers get immediate feedback from this testing process of writing, saving and rerunning their own unit tests.

Framework software also provides an iterative process that collects tests cumulatively over the lifespan of the software. As the software changes to meet user needs, so do the test cases within the framework. Using a testing framework increases programmer productivity and program stability, while reducing debugging time. Each bug found during software development is one less that may have to be identified and corrected later in a production environment.

Coverage Tools
Coverage tools let developers know how much of their code is covered by unit tests. This helps developers identify the areas of code that require further testing. Ideally, all code should be covered by unit tests.
Java development tools exist that report on the class, method, line and basic block level; with coverage statistics aggregated at the method, class, package and all class levels. With this data, development managers can plot code coverage over time per developer. This gives the development manager the ability to coach new employees to help bring them up to speed more quickly, while rewarding those who are already doing their part to improve the team’s overall code quality.

The Cycle Can Be Broken!
The vicious cycle of fixing bugs during production and missing release dates, which has become the ‘industry norm’, needs to and can be broken! Though there is no substitute for experienced software development talent; implementing best practices, processes and tools will help organizations to raise the skill set of its entire development team. As a result, development teams can focus on quality early in the development cycle, where bug fixes cost the least.

By implementing best practices such as unit testing and adherence to coding standards, while utilizing tools like source code control systems, testing frameworks and coverage tools, in the application environment; organizations will empower experienced developers to get the job done faster and enable new developers to build upon their existing skills.

In the end, development organizations will be better equipped to balance bug-fixing activities with application enhancements while continuing to meet their corporate objectives by producing quality software applications, on time and within budget.

More Stories By Nigel Cheshire

Nigel Cheshire is CEO of Enerjy Software, a division of Teamstudio Inc. He oversees product strategy and has been driving the company's growth since he founded it in 1996. Prior to founding Teamstudio, Inc., Nigel was co-founder and principal of Ives & Company, a CRM solutions consultancy. He holds a Bachelor of Science degree in computer science from the University of Teesside, England.

Comments (2)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.