1 Managing code quality
This chapter covers
- The purpose and the structure of this book
- Various techniques to improve the code quality
- Advantages and disadvantages of static analysis
- Approaches to make static analysis more useful
- Testing and assertions
Every software developer introduces bugs to the code. There’s no way to avoid them completely. Some of the bugs cause very subtle change in program behavior and nobody cares about it. Other bugs may cost millions of dollars, lost spacecraft, or even human lives. Many of them are in the middle: they don’t have disastrous effects but they annoy users and require hours of debugging and fixing.
Some bugs are caused by misunderstanding of the specification requirements, miscommunication between the software development team and the customer, and so on. Another category of bugs comes from the miscommunication between the developer and the machine. That is: the developer correctly understands the problem but writes the wrong code, so the machine solves the problem incorrectly. This book is devoted to the latter category.