code quality dds

Code QualityTable of Contents

List of Tablesxv
List of Figuresxvii
Forewordxxii
Prefacexxv
 
1Introduction1
1.1Software Quality1
1.1.1Quality Through the Eyes of the User, the Builder, and the Manager2
1.1.2Quality Attributes4
1.1.3A World of Tensions7
1.2How to Read This Book9
1.2.1Typographical Conventions10
1.2.2Diagrams11
1.2.3Charts13
1.2.4Assembly Code13
1.2.5Exercises14
1.2.6Supplementary Material14
1.2.7Tools14
 
2Reliability17
2.1Input Problems17
2.2Output Problems21
2.2.1Incomplete or Missing Output21
2.2.2Correct Results at the Wrong Time23
2.2.3Wrong Format24
2.3Logic Problems26
2.3.1Off-by-One Errors and Loop Iterations26
2.3.2Neglected Extreme Conditions27
2.3.3Forgotten Cases, Condition Tests, or Steps29
2.3.4Missing Methods34
2.3.5Unnecessary Functionality37
2.3.6Misinterpretation40
2.4Computation Problems42
2.4.1Incorrect Algorithm or Computation42
2.4.2Incorrect Operand in an Expression43
2.4.3Incorrect Operator in an Expression47
2.4.4Operator Precedence Problems48
2.4.5Overflow, Underflow, and Sign Conversion-Errors49
2.5Concurrency and Timing Problems51
2.6Interface Problems56
2.6.1Incorrect Routine or Arguments57
2.6.2Failure to Test a Return Value59
2.6.3Missing Error Detection or Recovery62
2.6.4Resource Leaks65
2.6.5Misuse of Object-Oriented Facilities68
2.7Data-Handling Problems69
2.7.1Incorrect Data Initialization69
2.7.2Referencing the Wrong Data Variable71
2.7.3Out-of-Bounds References75
2.7.4Incorrect Subscripting77
2.7.5Incorrect Scaling or Data Units79
2.7.6Incorrect Data Packing or Unpacking80
2.7.7Inconsistent Data82
2.8Fault Tolerance85
2.8.1Management Strategy85
2.8.2Redundancy in Space87
2.8.3Redundancy in Time89
2.8.4Recoverability90
 
3Security101
3.1Vulnerable Code102
3.2The Buffer Overflow106
3.3Race Conditions112
3.4Problematic APIs115
3.4.1Functions Susceptible to Buffer Overflows115
3.4.2Format String Vulnerabilities118
3.4.3Path and Shell Metacharacter Vulnerabilities119
3.4.4Temporary Files121
3.4.5Functions Unsuitable for Cryptographic Use122
3.4.6Forgeable Data124
3.5Untrusted Input125
3.6Result Verification131
3.7Data and Privilege Leakage134
3.7.1Data Leakage135
3.7.2Privilege Leakage138
3.7.3The Java Approach140
3.7.4Isolating Privileged Code141
3.8Trojan Horse143
3.9Tools146
 
4Time Performance151
4.1Measurement Techniques156 (PDF 68K)
4.1.1Workload Characterization157
4.1.2I/O-Bound Tasks158
4.1.3Kernel-Bound Tasks161
4.1.4CPU-Bound Tasks and Profiling Tools163
4.2Algorithm Complexity173
4.3Stand-Alone Code179
4.4Interacting with the Operating System182
4.5Interacting with Peripherals190
4.6Involuntary Interactions191
4.7Caching194
4.7.1A Simple System Call Cache195
4.7.2Replacement Strategies197
4.7.3Precomputing Results199
 
5Space Performance207
5.1Data209
5.1.1Basic Data Types209
5.1.2Aggregate Data Types213
5.1.3Alignment215
5.1.4Objects222
5.2Memory Organization227
5.3Memory Hierarchies231
5.3.1Main Memory and Its Caches232
5.3.2Disk Cache and Banked Memory235
5.3.3Swap Area and File-Based Disk Storage238
5.4The Process/Operating System Interface239
5.4.1Memory Allocation239
5.4.2Memory Mapping241
5.4.3Data Mapping241
5.4.4Code Mapping242
5.4.5Accessing Hardware Resources244
5.4.6Interprocess Communication244
5.5Heap Memory Management246
5.5.1Heap Fragmentation247
5.5.2Heap Profiling254
5.5.3Memory Leaks256
5.5.4Garbage Collection262
5.6Stack Memory Management264
5.6.1The Stack Frame264
5.6.2Stack Space269
5.7Code274
5.7.1Design Time276
5.7.2Coding Time279
5.7.3Build Time280
 
6Portability289
6.1Operating Systems290
6.2Hardware and Processor Architectures296
6.2.1Data Type Properties296
6.2.2Data Storage298
6.2.3Machine-Specific Code300
6.3Compilers and Language Extensions302
6.3.1Compiler Bugs302
Nonstandard Extensions303
New Language Features304
Binary Compatibility306
6.4Graphical User Interfaces307
6.5Internationalization and Localization309
6.5.1Character Sets309
6.5.2Locale313
6.5.3Messages316
 
7Maintainability325
7.1Measuring Maintainability326
7.1.1The Maintainability Index327
7.1.2Metrics for Object-Oriented Programs333
7.1.3Dependency Metrics on Packages343
7.2Analyzability351
7.2.1Consistency353
7.2.2Expression Formatting354
7.2.3Statement Formatting356
7.2.4Naming Conventions357
7.2.5Statement-Level Comments360
7.2.6Versioning Comments362
7.2.7Visual Structure: Blocks and Indentation363
7.2.8Length of Expressions, Functions, and Methods364
7.2.9Control Structures368
7.2.10Boolean Expressions372
7.2.11Recognizability and Cohesion374
7.2.12Dependencies and Coupling377
7.2.13Code Block Comments389
7.2.14Data Declaration Comments393
7.2.15Appropriate Identifier Names394
7.2.16Locality of Dependencies394
7.2.17Ambiguity396
7.2.18Reviewability397
7.3Changeability403
7.3.1Identification403
7.3.2Separation408
7.4Stability418
7.4.1Encapsulation and Data Hiding419
7.4.2Data Abstraction423
7.4.3Type Checking425 (PDF 99K)
7.4.4Compile-Time Assertions428
7.4.5Runtime Checks and Inspection-Time Assertions431
7.5Testability432
7.5.1Unit Testing433
7.5.2Integration Testing437
7.5.3System Testing439
7.5.4Test Coverage Analysis441
7.5.5Incidental Testing444
7.6Effects of the Development Environment451
7.6.1Incremental Builds452
7.6.2Tuning Build Performance454
 
8Floating-Point Arithmetic465
8.1Floating-Point Representation466
8.1.1Measuring Error469
8.1.2Rounding470
8.1.3Memory Format472
8.1.4Normalization and the Implied 1-Bit474
8.1.5Exponent Biasing474
8.1.6Negative Numbers475
8.1.7Denormal Numbers475
8.1.8Special Values476
8.2Rounding478
8.3Overflow481
8.4Underflow483
8.5Cancellation487
8.6Absorption491
8.7Invalid Operations495
 
Source Code Credits503
Bibliography505
Index523 (PDF 142K)
Author Index563

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-04-14