code quality dds

Code QualityList of Figures

1.1Examples of the various software quality views: in use, external, internal, process3
1.2Book map: elements of software quality6
1.3Conflicts between quality characteristics8
1.4Example of an annotated listing10
1.5UML-based diagram notation12
2.1Reflective implementation of toString, using annotations23
2.2Associating code with data, using the Strategy pattern32
2.3Establishing handlers through interface implementation34
2.4Explicit management of an object's private resource36
2.5Debugging code in the sendmail MTA daemon38
2.6Detecting null pointer references through static analysis45
2.7Managing the use of a resource with wait and notify53
2.8Use of the flawed double-checking locking pattern54
2.9The relationship between memory and resource leaks65
2.10Allocating and freeing file descriptors in the NetBSD kernel66
2.11Definition of a font's glyphs in automatically generated source code70
2.12Locations of global variable definitions (left) and references (right) in the NetBSD source code72
2.13Use of types by the NetBSD kernel global variables73
2.14Encoding a string into a modified UTF-8 format81
2.15Retransmission of a command sequence in a SCSI device driver90
2.16Recovering data from a failing disk94
3.1Buffer overflow in the FTP daemon108
3.2A race condition in the PPP daemon code113
3.3Time-of-check-to-time-of-use exploitation of the pppd vulnerability.114
3.4Time-of-check-to-time-of-use exploitation sequence diagram114
3.5Unsafe use of strcat117
3.6strcat correctly applied on a dynamically sized buffer117
3.7Insecure scrubbing of the environment126
3.8Secure scrubbing of the environment127
3.9Failing to check an error return in the traceroute implementation132
3.10Trojan horse code embedded in the TCP Wrappers program144
4.1Experts caution against optimizing code155
4.2EJP illustrates the Pareto Principle in the HSQLDB code165
4.3Example of gprof output for the vfprintf function168
4.4Propagation of processing times in a call graph170
4.5Relative performance of some common algorithm classes174
4.6System calls of a simple cat invocation184
4.7System calls for local IPC in a logger invocation186
4.8System calls in remote DNS IPC for a ping name query188
4.9The effect of thrashing on runtime performance192
4.10The user ID to name cache code196
4.11Caching database row entries198
5.1A structure padded to ensure optimal alignment (top) and packed to conserve memory (bottom)219
5.2Ordering the structure elements from largest to smallest, ensuring alignment and memory conservation220
5.3UML class diagram of the OpenCL algorithm inheritance tree223
5.4The C++ virtual tables of three OpenCL algorithm classes224
5.5Java objects pointing to instance data225
5.6Java objects with a handle pointing to instance data and class data226
5.7Types of memory resources227
5.8Process memory organization227
5.9A modern computer's storage hierarchy231
5.10Size distribution of 1 million allocated objects249
5.11Lifetime distribution of 1 million allocated objects250
5.12Memory pool snapshots illustrating memory fragmentation251
5.13Example of an external memory fragmentation scenario252
5.14Example of an internal memory fragmentation scenario253
5.15A memory allocation profile of the Apache HTTP server254
5.16A memory allocation profile of the sed stream editor256
5.17Report from the valgrind memory leak test tool260
5.18A memory leak in the C regular expression library261
5.19Typical contents of a stack frame265
5.20Contents of a stack frame266
5.21Stack size snapshots270
5.22Relationship between data and stack size271
5.23Relationships between source file and object file size275
5.24Inheritance in the ACE address types277
6.1Providing portability through an isolation layer292
6.2The integer 0x04030201 stored in a little-endian and a big-endian architecture298
6.3Examples of GUI portability strategies307
6.4Message handling using the catgets interface317
6.5Message handling using the gettext interface317
6.6Message-localization process using the GNU gettext tools319
6.7Accessing localized messages in a Java servlet321
7.1Measuring extended cyclomatic complexity330
7.2Program growth and maintainability index over time in the FreeBSD kernel and user programs330
7.3Distribution of maintainability indices for all FreeBSD modules331
7.4Weighted methods per class metric: for each HSQLDB class (left); number of Eclipse classes for different values (right)334
7.5Depth of inheritance tree metric: for each HSQLDB class (left); number of Eclipse classes for different values (right)335
7.6HSQLDB: inheritance tree of classes with a high DIT metric and the number of methods they define336
7.7Number of children metric for Eclipse classes337
7.8Coupling between object classes: for each HSQLDB class (left); number of Eclipse classes for different values (right)338
7.9Response for a class: for each HSQLDB class (left); number of Eclipse classes for different values (right)339
7.10Lack of cohesion in methods: for each HSQLDB class (left); number of Eclipse classes for different values (right).342
7.11Public and private classes in the org.hsqldb package343
7.12An unstable package in Tomcat345
7.13A stable package in the Eclipse distribution345
7.14Relationship between afferent and efferent couplings in Eclipse346
7.15Instability distribution of the Eclipse packages (left) and third-party bundled packages (right)347
7.16Stable dependencies in the junit packages348
7.17Less stable dependencies in the mx4j packages348
7.18Instability over abstractness for the Eclipse packages350
7.19Cyclic dependencies in Xerces and Eclipse351
7.20Maintainability index versus module size for all FreeBSD modules366
7.21Function length distribution for 65,000 C functions367
7.22Lack of regularity in processing a user response369
7.23A regular control structure for processing a user response370
7.24Different break and continue scopes in the same code block371
7.25Common coupling in the ed's DES CBC implementation383
7.26Common coupling relationships in the ed's DES CBC implementation384
7.27Reading and using a disk's partition kernel in the NetBSD kernel387
7.28The design of delta caching in the Low Bandwidth X (LBX) extension398
7.29Implementation of delta caching in the Low Bandwidth X (LBX) extension400
7.30Unwanted relationships between servlet container elements410
7.31Separating classes, using the chain of responsibility design pattern411
7.32Common lines between two different Catalina files415
7.33A formatted comment that is difficult to modify (left) and one that is easy to modify (right)418
7.34Declaring a variable within the innermost block420
7.35Directly interpreting a directory's data in the Seventh Edition Unix425
7.36Playing loose with types in pre--Java 1.5 code426
7.37Ad hoc unit testing in a C library's fmod implementation435
7.38Unit testing with the JUnit test framework436
7.39Test coverage (left) and branch coverage (right) of Perl's source code versus the number of executed test cases443
7.40Use of assertions in the regular expression engine446
7.41A simplified graph of include file dependencies453
7.42Documentation dependencies456
8.1Quadratic equation cancellation errors and the effect of precision490
8.2Absorption errors when calculating the area of a far-away triangle491
8.3Code verifying a floating-point result498

Book homepage | Author homepage

Valid XHTML 1.0! Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0 Creative Commons License Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.
Last modified: 2006-01-04