4 ms·
Depending on your use of the term "unit" and "integration" (testing taxonomy is bad), I tend to do the opposite, but with the addition of acceptance (user featu
by Huggernaut 7y ago
Depending on your use of the term "unit" and "integration" (testing taxonomy is bad), I tend to do the opposite, but with the addition of acceptance (user feature testing) to tie the whole thing together.
By this I mean that I unit test (as driven out by Discovery Testing i.e mocking collaborators) down the dependency graph until I hit a leaf node, which I will integration test against real external systems or black box unit test if the logic is self contained.
This sort of drives out a world where slow tests are kept to the leaf components, or the e2e acceptance, and everything else is quick with confidence in all the paths.
It certainly does lead to a world where refactoring is more costly because of the burden of these mocks but this isn't trying to follow Chicago TDD where the refactor step is part of the cycle, instead looking like London TDD where the testing puts pressure on the design itself, so refactors are far less common.
- ed_elliott_asc 7y ago> (testing taxonomy is bad) So true, it is terrible! What I say is: Unit tests - small tests that show the intent of one line of code or small set of lines, what the developer thought it was meant to do - can't prove correctness of an entire process Integration tests - test one specific process works (login success, login fail, etc.) starts to prove correctness of one part of an application Acceptance tests - larger, test that processes interact together and prove that multiple processes work Production tests - (roll out to x users and monitor or something similar) - prove that the entire application works, in production. Tests go from: Small to large, fast to slow, no risk to complete risk