In programming, as in everything else, to be in error is to be reborn.[...] The non-functional properties we can discern from reading a software system's code are associated with the product's non-functional requirements: the requirements that are not directly concerned with specific functions delivered by the system, but deal with broader emergent system properties. Some common non-functional properties are the various -ilities of a system: reliability, portability, usability, interoperability, adaptability, dependability, and maintainability. Two other significant non-functional properties concern the system's efficiency: its performance related to time constraints, and its space requirements. The skill of reading code to discern its non-functional properties is crucial for two important reasons. First of all, a failure to satisfy a non-functional requirement can be critical, even catastrophic. A system that gets some functional requirements wrong (most software products contains such errors) may well be able to operate in a degraded mode; users can be instructed to avoid using some part of the functionality. On the other hand, errors in non-functional properties are often showstoppers: an insecure web server, or an unreliable anti-lock break system (ABS) are worse than useless. In addition, non-functional requirements are sometimes difficult to verify. We can not write a test case to verify a system's reliability or the absence of security vulnerabilities. Therefore, both the critical nature of non-functional properties and the difficulty to verify them suggest that when dealing with non-functional requirements and the corresponding software properties we need to muster all help we can get. The ability to associate code with non-functional properties can be a powerful weapon in a software engineer's arsenal. Apart from the different perspective, Code Quality follows the successful recipe of its companion book Code Reading: focus on the reading of existing code, deal exclusively with real-world examples taken out of existing open source systems, reference all examples to their source, dissect code with annotated listings, provide meaningful exercises to strengthen a programmer's critical ability and skills, identify coding idioms and traps on the text's margin, summarize each chapter's advice in the form of maxims, tie practice with theory in the ``Further Reading'' section, and use the Unified Modeling Language (UML) for all diagrams. From the above recipe the most tricky ingredient was my self-imposed rule to avoid toy examples, drawing all code samples from existing open source projects. By following the rule, I often found myself spending hours to find an appropriate example: one that would illustrate the concept I was presenting, while also being understandable and short enough to include in the book. I found this exercise both intellectually simulating and a great way to impose discipline on my writing. Often, while searching for a particular weakness, I encountered other interesting elements worthy of discussion. At other times my search for an example of a theoretical concept proved fruitless: in those cases I could then credibly reason that the concept was not important enough in practice to include in the text.
— Alan J. Perlis
The rationale and motivation behind Code Quality are also the same as those that started Code Reading: the reading of code is likely to be one the most common activities of a computing professional, yet it is seldom taught as a subject, or formally used as a method for learning how to design and program. The popularity of open source software has provided us with a large body of code that we can all freely read and learn from. A primer and reader, based on open source software, can be a valuable tool for improving one's programming abilities. I therefore hope that the existence of the two books will spur interest to include code reading courses, activities, and exercises into the computing education curriculum so that in a few years our students will learn from existing open source systems, just as their peers studying a language learn from the great literature.
Book homepage | Author homepage