2 ms·
If you try to abstract away tests, you often just end up re-implementing the same abstractions used in the actual code, and you can end up not catching unfounde
by ummonk 7y ago
If you try to abstract away tests, you often just end up re-implementing the same abstractions used in the actual code, and you can end up not catching unfounded assumptions that your abstraction is making in both the tests and the code. There is a scope for having test helpers / utils to make tests easier to write, but you should be minimalist with these.
- 3pt14159 7y agoI agree, but some test helpers are reasonable. It's about balance and readability of the tests in question. Otherwise integration tests end up being a hundred lines of code.
- rbanffy 7y agoTests should also be treated as a form of documentation. A test should reflect the way you'd use the code in real life as closely as feasible.
- ajuc 7y agoThe problem with abstractions in testing is - you should test it :)