A "Unit" In A Test Is Not The Class Under Test
Hi,
What is actually a “Unit” in a Unit Test?
Dumb question, you might say.
But it’s an interesting one. For many years, like most people who talk about this topic, I believed:
A unit is a class that I want to test.
And maybe you saw it that way too. And you certainly had a few problems with it.
For example, the symptoms of resulting Coupling
What happens when we write a UserServiceTest class? We have - without realizing it - established a semantic coupling between the UserService class and the UserServiceTest.
