by arkh · 5y ago · 0 comments
It means you code your test cases before you implement the functionalities. Those tests can (and IMO should) be behavior tests: then you can rip out all your code and replace it with whatever you like, even off-the-shelf software and your test suite will still run.
The excuse of those kind of tests being slow or hard to setup mean only one thing: we have to work on their tooling.
Testing behavior from the user perspective should be the goal, these are the kind of tests that bring most value in the long run.
I think a way to smell you're too far gone on this way is when you write tests only to get code coverage.
With behavior tests, code coverage should become a tool to show where your dead code is so you can remove it.