© Karl Beecher 2018
Karl BeecherBad Programming Practices 101https://doi.org/10.1007/978-1-4842-3411-2_10

10. Testing

Karl Beecher1 
(1)
Berlin, Germany
 

Objectives

In this chapter, you’ll learn:
  • How to protect your code from tests that threaten to reveal bugs, in particular by
    • retaining authorship of tests;

    • doing the bare minimum necessary; and

    • writing untestable programs.

  • How to write tests that cause havoc for your colleagues, in particular by
    • making a test’s success dependent on its environment;

    • creating work for testers by unnecessarily widening the focus of a test; and

    • adding volatile, uncontrollable elements.

Prerequisites

Before reading this chapter, it will help if you’re familiar with the following:
  • The basic concepts of unit testing and integration ...

Get Bad Programming Practices 101: Become a Better Coder by Learning How (Not) to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.