4 ms·
They'd soon be drowning in individual tests. And it wouldn't necessarily fit to separate them, considering all those 3 have to be tested on each skill usage. On
by d0100 10y ago
They'd soon be drowning in individual tests. And it wouldn't necessarily fit to separate them, considering all those 3 have to be tested on each skill usage. One shot has to obey those 3 rules.
Making each an individual test would triple the test time, pollute the test codebase and not bring any advantage.
- chrislloyd 10y agoThe advantage in splitting up the assertions is that you get more visibility. If one test fails and not the other two that's extra information you can use to debug you wouldn't have if you have all 3 in one test.
- chii 10y agoIf that test fails, the dev will just run it locally with a debugger attached. The cost of extra time in the test for the normal passing case isn't worth it.
- quacker 10y agoRight, but consider if all three test cases fail. Then devs (who didn't write those tests) need to determine what those three test cases are and if they're all the same issue or not, which takes time. Ideally, if just one assert fails, it will produce an error message/logs with enough info to tell what went wrong. Having tests produce great error messages is way more valuable than arbitrary rules about assertion density.
- finishingmove 10y ago> Making each an individual test would triple the test time, pollute the test codebase and not bring any advantage. Would it really? None of what you said here is true.
- quacker 10y agoI think it is true. I mean, tripling the number of test cases when you already have 5500 of them is going to slow down your dev process in a significant way.