2 ms·
I don't think good developers write bad tests. Developers inexperienced in writing tests for the type of task they are working on write bad tests. But also, gi
by watwut 8y ago
I don't think good developers write bad tests. Developers inexperienced in writing tests for the type of task they are working on write bad tests.
But also, given how standard setUp method is and how often it is used, putting set up config there is not forcing anyone to "read your entire test suite". It forces them to read setUp method and that should be no shock to whoever is making the test. I dont mind doing it the way author suggests, but I also think that difference between the two is minimal.
Helper methods deserve equal treatment in code and tests. Operating on two different layers of abstraction as well as other complains he has about their bad use would be same bad in main code.
Likewise, most other problems are also bad in code under test code. Helper methods should not bury critical values or interact with state unless it is very clear from their name. Overly concise names are bad too and trying to save key strokes is pointless. Pointless constants (FOUR=4) are pointless.