Apprentiship blog

What makes a good test

December 11, 2018

That was the question i had for today, “what makes a good test”, my short response was “adds value and checks our assumptions”, so some of today (in between meetings) was spent checking my assumption by asking co-workers “what do they consider a good test?“.

Top answer

The most common answer I was given was a good test documents expected behaviour.

Common Answers

  • A good test is human readable.
  • A good test is descriptive.
  • A good test should test one thing, such as the expected behaviour when x is given to y.
  • A good test should fail when the system/code begin tested is not working properly.
  • A good test acts predictably (doesn’t behave randomly).
  • A good test is small.
  • A good test detects bugs.
  • A good test does not need to be changed when the implementation is changes (stable to implementation changes)

Interesting answers

Admittedly I mostly asked developers, so there’s no surprise that a lot of the answers relate to writing technical tests. One on the scrum masters had a different perspective on tests, that some are technical tests such as unit tests written for and by software engineers) while others are more business-readable. Both cross over, but business-readable focuses more on what the consumer sees and interacts with, api endpoints and other integrations.

I guess “what is a good test” really depends on the context / domain of the test… good thing I checked my assumptions :)


Written by Marc McIntosh Find him on github