What is a class under test?

What is a class under test?

You’ll hear that expression bandied around a lot when implementing TDD – test driven development. But what exactly does it mean? Class under test basically means the class that you are testing – it does not mean the class where all your tests are written.

For example, suppose you have a design of a car (blue prints) and you want to test whether:

  1. The car design has an engine.

Then in that particular case, the car design would be the class under test.

NB: This is to be differentiated from an object under test, which would be whether a particular car can drive forward – as opposed to testing things about the car’s design. It’s a nuance that I will revisit in later blog posts. Don’t worry about it if you don’t understand it 100%.

Written on December 6, 2016