13 A culture of quality

 

This chapter covers

  • How types complement your tests and make your code safer
  • The impact of code reviews and how to perform them effectively
  • Adopting linting and formatting and the advantages of doing so
  • Setting up monitoring to ensure your systems are healthy
  • How documentation affects your project’s quality

After 12 chapters on JavaScript testing, the 13th takes a little bit of a different direction. In this chapter, I will teach you new techniques that will complement your tests and help you foster a culture of quality in your projects.

These techniques amplify the impact of your tests. They make your tests safer, your code easier to understand, or catch errors that your tests wouldn’t be able to.

This chapter starts by demonstrating how type systems complement your tests. In this first section, I talk about the advantages of adopting type systems and use a practical example to elucidate what you must do to get the most significant safety benefits out of them.

Once I’ve covered type systems, I will highlight how important it is for team members to review each other’s code and how to fit this practice into your development process. Furthermore, this section contains plenty of advice on how to review code effectively.

To ease code reviews and help developers focus on code semantics instead of nitpicking, this chapter’s third section describes linting and formatting. It clarifies the difference between these two practices and reveals the benefits of each.

13.1 Using type systems to make invalid states unrepresentable

13.2 Reviewing code to catch problems machines can’t

13.3 Using linters and formatters to produce consistent code

13.4 Monitoring your systems to understand how they actually behave

13.5 Explaining your software with good documentation

Summary