3 ms·
It really depends what one is building. As you point out, in your example, testing is very useful since it allows you to be confident that your code works. Som
by jfim 6y ago
It really depends what one is building. As you point out, in your example, testing is very useful since it allows you to be confident that your code works.
Some of the backlash around testing is about testing things that really shouldn't need to be. If there's a mandate from some clueless management that all code must be covered by tests and the new code is simple data containers, then one ends up having to write tests for methods like getValue() { return value; }, which is a bit absurd.
I'm assuming the author of the article is in the latter situation, not the situation you describe where tests are actually useful.
- commandlinefan 6y ago> write tests for methods like getValue() { return value; } Well, if you're just measuring code coverage (which is what clueless management obsesses about), as long as something that uses that getter is tested, it will be covered and won't need its own separate unit test. And if it isn't covered, that means you're not using it in which case you can probably get rid of it...