Ensuring internal quality of software

Internal quality (aka structural quality or architectural quality[3][9][10]) is an assessment on the quality of the code and its underlying architecture. It differs from external quality which assesses how good the software is in relation to the requirements. Nowadays, as building large scale applications is becoming increasingly common, assessing it, is becoming increasingly important.

The time when one person was writing and maintaining software has long since passed. Nowadays, software is usually developed by hundreds of people. For example, Windows NT 1.0 (1993) was developed by 200 developers and 140 testers and it had about 4-5 millions of code. In comparison, Windows XP (2001) was developed by 1,800 developers and 2,200 testers and had over 40 million lines of code[1]. In fact, nowadays the number of people involved in software development process is so large that lines of codes give the only small indication of what the process was really like[2].

Bad internal quality is not necessarily a consequence of bad design, but more of the constantly changing user requirements and the design not being adjusted accordingly. This is when we step away from the perfect world and take the journey to the realms of software engineering. In order to maintain a high internal quality, the code should be 'clean' to begin with and then adjusted accordingly with the changing requirements[3]. Clean means: maintainable, flexible, portable, reusable, readable, testable and understandable[6]. These characteristics are difficult to measure objectively. However unless met, introducing new features or fixing bugs becomes increasingly complex, time-consuming and consequently more expensive[3]. However, investing in internal quality has medium to long-term benefits. Although the internal quality should be virtually imperceptible to end users, this is not always the case, because “difference between internal and external characteristics isn’t completely clear-cut because at some level internal characteristics affect external ones”[4].

One way to write high internal quality software is to use test-first programming i.e. writing the test code before writing the production one[7]. This is the main principle in test-driven development. It turns out, that test-driven development is very effective as shown in the study by David Janzen. Unit tests give a good feedback about the architecture of the software[4]. The definition of a good unit test[8]:

  1. Automated and repeatable
  2. Easy to implement
  3. Can be used in the future

Those who want really reliable software will discover that they must find means of avoiding the majority of bugs to start with and as a result, the programming process will become cheaper. If you want more effective programmers, you will start to discover that they should not waste their time debugging – they should not introduce bugs to start with.”[5]

 

However, the code will require refactoring, this is almost unavoidable in a large project[3], but thinking about the architecture of the software is very important, to begin with. Even if new bugs are introduced, good coverage of unit tests should allow intermediate feedback[3].

References

[1] L, O’Brien (2005, Dec 05). “How Many Lines of Code in Windows?”. Knowing .NET [Online]. Available: http://www.knowing.net/index.php/2005/12/06/how-many-lines-of-code-in-windows/ [Accessed: Mar. 11 2013] [2] RedSunBeer (2004, Sep 15). “How to estimate a software project in man-hours?”. Code Project [Online]. Available: http://www.codeproject.com/Articles/8137/How-to-estimate-a-software-project-in-man-hours [Accessed: Mar. 11 2013] [3] S. Bergmann and S. Priebsch, Real-World Solutions for Developing High-Quality PHP Frameworks and Applications. Indianapolis, IN: Wiley Publishing, Inc, 2011.

[4] S. Freeman and N. Pryce, Growing Object-Oriented Software, Guided by Tests. Boston, MA: Pearson Education, Inc, 2010.

[5] Edsger W. Dijkstra, “The humble programmer,” Communications of the ACM 45, Issue 10 (October 1972): 859–866. ISSN 0001-0782.

[6] D. Lacey. “Internal and External Quality”. 31 October 2010. [Blog entry]. Mike long’s Blog. Available: http://meekrosoft.wordpress.com/2010/10/31/internal-and-external-software-quality/ [Accessed: 11 Mar 2013] [7] Wikipedia. " Test-driven development " [Online]. Available: http://en.wikipedia.org/wiki/Test-driven_development [Accessed: Mar. 11, 2013].

[8] R. Osherove, The Art of Unit Testing with Examples in .NET. Greenwich, CT: Manning Publications Co., 2009.

[9] Wikipedia. "Software Architecture " [Online]. Available: http://en.wikipedia.org/wiki/Software_architecture [Accessed: Mar. 11, 2013].

[10] Wikipedia. "Software Quality " [Online]. Available: http://en.wikipedia.org/wiki/Software_quality [Accessed: Mar. 11, 2013].