--

Be careful with Unit Tests.

There are two kinds of Unit Tests: the QA unit tests, and the TDD unit tests.

The QA unit tests focus on testing small chunks of code and mock everything else.

The TDD unit tests focus on testing behaviors and avoids as much is it can all the mocks.

The TDD tests focus on behaviors because it needs to refactor. If the test focus on the code, you cannot refactor without changing the test, and loosing all its value. But if the test focus on the behavior, you have room to change the code.

--

--

David Rodenas PhD
David Rodenas PhD

Written by David Rodenas PhD

Passionate software engineer & storyteller. Sharing knowledge to advance our skills. Join me on a journey of discovery in the world of software engineering.

No responses yet