CHANNELS
 
 
 
 
 
 
 
 
ON THE WEB
 
 
 
 
PRINT EDITION
 
 
 
 
BZ MEDIA
 
 
 
 
ADVERTISER LINKS
 
 
 
 
 
 
 
AS OF 11/19/2008 7:01AM EST
Guest View: Make Quality a Deliverable
Stories Columns Opinions Resources

By Dan Rubel

July 15, 2008 — 

In recent weeks, some technologists have asserted that unit testing’s popularity has peaked, partly because of the decline of commercial product providers. I beg to differ. While Agitar and Enerjy have exited the business, their departure speaks to the value of their tools, not to the health of unit testing. In fact, by my account, the practice is alive and well. If you’re depressed about unit testing, though, here’s some juice to get your wheels turning.

The buck stops with you on all things quality. However, to justify time and attention to quality, you must choose definitive standards and metrics and apply them consistently. Treat quality as a deliverable, establishing thresholds against which your organization must measure up prior to each release. For example, require JUnit or NUnit tests and employ code coverage to determine where testing needs to improve. Decide if code can be released with high- or medium-severity audit violations. Sometimes it can, sometimes it can’t.

Once you have set standards and have adequate testing in place, you must monitor improvements over time. By applying a common set of standards and metrics and recording trends, you can produce more consistent results, reduce maintenance costs and increase the return on investment of your software development.

Indeed, every team can improve code quality through their build process. If you’ve already automated yours, server-based code quality processes are a good next step. As you examine how to incorporate those processes into your build system, recognize these key roles in your organization:

Developers and architects help to define such criteria as audit rules.
Development managers approve criteria and use current status and trend reporting to show code quality improvements, faster time to market and so on.
Build masters implement and monitor code quality processes within the build.
Quality assurance people write automated tests for the process.

Choose one of these people to lead the change. Use two criteria: Pick someone who can champion the need to improve code quality and exert sufficient influence over the build system to ensure standards are implemented and enhanced over time.

Now, let’s discuss nightly vs. continuous builds. This choice must be based on the complexity of the build and the time it takes the build to run. When practical, run a continuous build to provide rapid feedback shortly after code is checked in. If your build takes many hours, however, you may need to scale expectations, perhaps running it nightly or twice a day.

Do a clean, full build daily. Though incremental builds are faster, you run the risk that new source changes may be missed or temporary data may not be properly deleted. Therefore, once a night, delete all cached source and build data, check out all code from source code control again and trigger a full build.

Use scripts to run your builds. Scripting provides a repeatable process that promotes consistency and eliminates the chance of errors associated with manual steps.

In addition, run unit tests as part of the build system. During a nightly build, such tests validate that code is doing what it’s supposed to do. If a build breaks, you know you have introduced a problem—the build isn’t good unless the test passes. Even better, run tests as part of a continuous build to generate immediate feedback that the code checked in most recently is of good quality.

Ensure that a sufficient amount of your code is being tested through automated code coverage analysis. Perhaps the most common reason for measuring code coverage is to evaluate the effectiveness of test code at exercising all possible paths through the application. First, instrument code to collect data from your automated build system; then, exercise the code by running it through unit tests.

Glean data about code coverage from your build system, measuring and reporting where the code is not being executed. Measure the number of basic blocks of code that complete normally without exceptions, and correlate it back to the source code on a line-by-line basis. Doing so will provide information on code that was executed, partially executed or not executed at all. Armed with that information, you know where your tests need improvement.

Incorporate code auditing into the build process to ensure that your code complies with established coding standards. Address such areas as security, performance and common coding errors, and configure rules to incorporate your company’s chosen best practices. Note that practices such as code audit are incredibly scalable; once you define criteria, you can apply it to any size code base. If you are applying audits to a pre-existing project, start small by cherry picking a few audits, fix the violations found and incrementally add audits over time.

What’s more, you should evaluate your applications against coding benchmarks to assess code characteristics across projects or for individual developers. Capture metrics from the build system and tailor metrics preferences according to your project requirements.

In the end, extract and report the results of your code quality analysis in a convenient, meaningful way. Require management reports on the Web for 24x7 access across the enterprise. Track metrics such as total code audit violations over time, violations based on severity level of the project or package and violations occurring in certain parts of the system. Seeing trends in the code audit data is critical because it lets you determine where changes are needed, leveraging information on the evolution of quality to improve it.

If you’re out there to succeed, then quality is a high-priority deliverable. Use unit testing and other methods described here to get the job done.

Dan Rubel is co-founder CTO of Instantiations, Inc., which offers Java Eclipse software quality and productivity solutions.


Related Search Term(s): Testing & troubleshooting


Share this link: http://www.sdtimes.com/link/32495
 


 
 
 
 
 
 
 
 
 
 
SUBSCRIBE TODAY!
 E-Newsletters:
  News on Mon/Thurs.  More info
  Test & QA Report  More info
  EclipseNews  
  SPTech Report  More info
 
 
 
PDF & PRINT EDITION
* Requires Resource Account!  LOGIN or SIGN UP

Download Current Issue!
ISSUE 11/15/2008 PDF

Need Back Issues?
DOWNLOAD HERE

Receive The Print Edition?
SUBSCRIBE HERE
 
REGISTER
 
GET NOTIFIED!
About all of the latest Resources
 
 
SD TIMES 100
It's time once again to
recognize the organizations
or individuals that have
demonstrated leadership in
their markets.