Why writing unit tests means something else to different people

submited by
Style Pass
2021-06-22 07:00:07

When I discuss TDD with a new co-worker I first try to classify his approach to TDD. I do the same when I start working on a new codebase. I look at the codebase and try to find out if the codebase was written with a mockist or classicist TDD approach.

For me, the main difference is that classicist testers try to write the test so that they do not break when you change the implementation (e.g refactoring). Mockist don’t care so much about this, they focus on isolating the unit.

Interesting fact: Originally, unit tests are called unit tests because they can be executed independently from any other tests. Not because they test a single unit (see: [01], [02]).

Leave a Comment