5 Advanced backend testing techniques

 

This chapter covers

  • Eliminating nondeterminism
  • Techniques to running backend tests concurrently
  • How to reduce costs while preserving quality

Not even the most delectable cheesecake in the world is viable for a bakery if its margin profits are too small. If you’re making a cent on each slice, it will be challenging to have a successful business.

Additionally, for you to build a successful bakery, you must be able to bake flawless recipes consistently. Otherwise, if half of your macaroon batches aren’t sellable, your only result will be a financial loss.

Similarly, if your tests’ costs are too high because they take too long to run or because they’re too difficult to maintain, it will be challenging to build a successful software company.

Yet, for these quick and easy-to-update tests to be useful, they must be reliable and robust. If you can’t trust your tests, it doesn’t matter how quickly they run or how easy to update they are.

In this chapter, I’ll teach you testing techniques to help you make your backend tests quick, reliable, and easy to update while still preserving the quality of your bug-detection mechanisms.

You’ll learn about these techniques by improving the tests you’ve built in the previous chapter. As I demonstrate how to apply these techniques, I’ll also explain why they’re important.

5.1 Eliminating nondeterminism

5.1.1 Parallelism and shared resources

5.1.2 Dealing with time

5.2 Reducing costs while preserving quality

5.2.1 Reducing overlap between tests

5.2.2 Creating transitive guarantees

5.2.3 Turning assertions into preconditions

Summary