Hollis Tibbetts

Subscribe to Hollis Tibbetts: eMailAlertsEmail Alerts
Get Hollis Tibbetts: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: SOA & WOA Magazine, Java Developer Magazine, Software Testing Journal

Article

Software Quality Best Practices: Healthy Software

Great Software IS Great Marketing

Consider the following scenario-typical in many application development organizations. A major new release of an application has just gone into production. Although the development and QA teams endured many late nights of coding and testing, and consumed large quantities of delivered pizza, the project missed its ship date. Still, customers are happy with the product and are giving positive feedback. By many definitions, the team has produced a quality product.

Then, a new, large business opportunity requires the rapid implementation of a significant new feature in the product. The tired and over-worked development team struggles with how, or even if, it can meet the new requirement. They are concerned that the new feature will break the existing product and predict a lengthy development cycle.

Schedule overruns, tired staff, and difficulty in changing or adding functionality are sure indications that something is wrong with your software: your software is unhealthy. It is poorly specified, architected, and designed; it lacks comprehensive documentation, and automated unit and system tests. Changing even the smallest part of its code is fraught with risk as no one fully understands the implications.

The cost of unhealthy software
The impact of unhealthy software is significant and even has a quantifiable effect on the value of the business.  The total payroll for individuals in the US software workforce approaches US$120 Billion per year.  According to industry experts such as Capers Jones, nearly US$75 Billion of that can be attributed to software repair.  This amount is equivalent to one-fifth of the profits reported by the largest 500 corporations in the United States.  Stated another way, if corporations were able to convert this $120 Billion into profits, they would increase their market capitalization by an incredible USD$2 Trillion, based on current S&P500 multiples.   Other studies, such as the May 2002 NIST report estimated a smaller amount for the value of potentially recoverable costs--$21 Billion.

The costs associated with the consequences of defective software are even more severe.  The NIST report estimates that over $38 Billion of end-users' time is wasted.  And the Standish Group reported downstream business costs-"collateral damage" of nearly $300 billion.

The path to healthy software
Many solutions have been proposed to help remedy the problem, including requirements management, modeling tools, incremental development, component-based development, service orientation, and automated system tests. All of these solutions add value, but none have as much impact as Developer Testing.

It makes so much sense: developers create the code that embodies the design and also harbors the software's defects. Enabling developers to validate the correctness of their code at the time they write it creates cascading positive effects that have tremendous beneficial impact on software health:

  • Developers can fix simple coding errors at a very low cost, without negatively affecting other modules.
  • They are able to fix the design flaw that led to the error, not just remove the manifestation of the error. Testable code is better code.
  • They keep the tests with their code and run them often. Any changes that introduce errors at later stages of the development cycle are immediately observed and fixed.
  • The tests developers create serve as an executable specification. Other developers can understand what each developer's software module does from these tests, and write their own software such that it interacts correctly - further promoting proper design.
  • The final software product they deliver comes with a body of executable unit tests that cover all of its code, branches, and outcomes. Developers will be confident of the software's quality and make changes with speed and certainty.

Figure 1: Developer Testing results in healthier applications.

As the above graph indicates in red, in the absence of Developer Testing, developers work without significant feedback on software quality until the QA team begins testing, which is usually late in the development cycle.

By then, software health has deteriorated to the point where it is typically impossible to fully restore. At a minimum, it would be difficult and expensive to do so.

In contrast, the above chart shows in green that a team using Developer Testing keeps its software healthy throughout the development cycle. The project will be completed earlier, with more confidence, and less stress. And the resulting product will be highly reusable and extensible. The team has delivered healthy software.

Developer Testing defined
Developer Testing (also called unit testing, or programmer testing) has gained significant acceptance in the recent years, fueled by the adoption of agile development processes such as XP and Scrum. The popular Developer Testing framework JUnit has been downloaded more than 1 million times and is now included with most IDEs.

Here is how we define Developer Testing for software development teams:

  • For every software unit created, developers also create meaningful tests that can be automatically executed to verify that the software functions correctly.
  • Developers do not check in a unit of software before the tests for that unit pass.
  • Developers add the tests to a repository of unit tests that verify that all units of the integrated system function correctly.
  • This collection of unit tests is executed frequently, and the team commits to keep the tests passing at every stage of the development process.

Teams that practice Developer Testing usually use some form of build automation. By integrating new code into a fully built system on a regular basis, it is possible to detect and fix regressions early, particularly when the process includes running a comprehensive body of unit tests.
Broadening the adoption of Developer Testing

If Developer Testing provides so many benefits, why is it done so rarely? The answer, to a large degree, is that current approaches rely too much on extensive manual effort:

  • Writing tests is a combinatorial problem. Every branch in code requires multiple tests. To accomplish good coverage, developers must often write test code that is several times as long as the source code it is meant to test.
  • Maintaining tests becomes more of a burden as the number of tests grows and the associated code changes. As a result, tests often go out of date and, once they have, they lose their value and are no longer used.
  • Even if tests are up-to-date and are being run frequently, it can be hard to interpret their relevance. What part of the code has been tested, and what has not? Is the untested code likely to harbor defects? Without tools to interpret and direct the results, Developer Testing will only have marginal value.

Test execution frameworks like JUnit, build automation tools like Ant and Maven, and integration/automation tools like CruiseControl have had an enormously positive impact on the adoption of Developer Testing. What is still needed is a set of tools that help overcome the most significant barriers: the creation and maintenance of unit tests, and the management of Developer Testing efforts.

More Stories By Hollis Tibbetts

Hollis Tibbetts, or @SoftwareHollis as his 50,000+ followers know him on Twitter, is listed on various “top 100 expert lists” for a variety of topics – ranging from Cloud to Technology Marketing, Hollis is by day Evangelist & Software Technology Director at Dell Software. By night and weekends he is a commentator, speaker and all-round communicator about Software, Data and Cloud in their myriad aspects. You can also reach Hollis on LinkedIn – linkedin.com/in/SoftwareHollis. His latest online venture is OnlineBackupNews - a free reference site to help organizations protect their data, applications and systems from threats. Every year IT Downtime Costs $26.5 Billion In Lost Revenue. Even with such high costs, 56% of enterprises in North America and 30% in Europe don’t have a good disaster recovery plan. Online Backup News aims to make sure you all have the news and tips needed to keep your IT Costs down and your information safe by providing best practices, technology insights, strategies, real-world examples and various tips and techniques from a variety of industry experts.

Hollis is a regularly featured blogger at ebizQ, a venue focused on enterprise technologies, with over 100,000 subscribers. He is also an author on Social Media Today "The World's Best Thinkers on Social Media", and maintains a blog focused on protecting data: Online Backup News.
He tweets actively as @SoftwareHollis

Additional information is available at HollisTibbetts.com

All opinions expressed in the author's articles are his own personal opinions vs. those of his employer.