by vfc1 · 8y ago · 0 comments
The tests break and we have to fix them not because a bug was found, but because something else changed that affected the test.
Most of the time spent with tests is not to catch bugs. When was the last time that you caught a significant bug with a test?
I think if we are shipping a framework to thousands of users its great that it has unit tests, but if its an in-house application built by a team of 10 developers, I doubt that the tests are doing anything useful.
But what happens is that these best practices that are used by developers of libraries are then used blindly at the level of application code, without pausing to think if those are indeed best practices in that particular context.
Developing software at the leaves of the dependency tree (the application) is very different than developing libraries. Some things are the same while many others are not.
The end result in practice is a lot of wasted time and effort spent at the application level writing bad tests that yield no results, all in the name of the testing religion.
Because that is what it really is, its an unprovable belief system with a set of rituals that you absolutely must follow blindly, or else.
Tests only really catch bugs when you're refactoring the implementation of something while trying to keep its behavior the same. You're right, in many ways, tests exist to be broken. But they still serve their purpose. They either break because you unintentionally changed behavior and need to fix your code, or because you intentionally changed behavior and need to change your tests.
Constantly. This is an extremely surprising question to me, our unit tests catch bugs all the time.
This happens at least once a week, and that's just for me on a ~15 person team.
I work on a compiler and most of our tests are in terms of user visible effects from running snippets. If any of them break, it's either a rare test harness failure or a real bug.
Whether or not any particular spec violation is significant is another matter of course, but they're definitely genuine bugs.