DEV Community

loading...

Discussion on: Do devs really need to test?

Collapse
aleksikauppila profile image
Aleksi Kauppila

Overtesting is a serious problem

Does this really exist? I would be interested in hearing some examples. 🙏

I can definitely see a problem in time spent in testing. And that is most likely spent in manual testing because of not having knowledge on how, on what level and what exactly to test.

Thanks for a great post! 🍻

Thread Thread
d_ir profile image
Daniel Irvine 🏳️‍🌈 Author

It might be something I’ve just dreamed up, or maybe there’s a better name for it, but here’s how I think of overtesting.

Overtesting is what happens when your write tests that cover more surface area than necessary. One way this happens is relying on end-to-end tests instead of unit tests. Greater surface area means more chance for tests to break when code is changed. In other words, you get brittle tests.

Hopefully that makes sense?

Thread Thread
jessekphillips profile image
Jesse Phillips

Each test is additional code which must be maintained. If the tests need to be updated with every code change, even though the functionality they are expecting to test isn't changing, it becomes a liability.

Clearly that isn't because there are too many tests, but it kind of is. The mantality this come from is that every test is valuable. While you could write another test, clearly this is covering more and may find an issue it just isn't this time.

Thread Thread
aleksikauppila profile image
Aleksi Kauppila

It makes!

I think this is due to focusing the tests on the wrong level.

Too small or inappropriate details are verified in a test that is done by eg. Calling the service over HTTP.

Forem Open with the Forem app