DEV Community

Discussion on: Me: "I tested and it works, why do I have to write tests?"

Collapse
 
dinsmoredesign profile image
Derek D • Edited

The back end team at my work is pretty strongly against testing and I've never understood it. There's nothing more frustrating than a back end dev coming to me saying that the app is broken and they think it's the front end. If they had tests, they'd know it isn't, but I have to spend my time debugging their problem because they have no testing standards in place. Our QA team's job consists of lots and lots of manual testing (ie: over 1750 test cases when regression testing just one of our larger apps) and when they find something that's broken, no one knows if it resides on the front or back end, because there's no unit tests to tell them.

I've been implementing a lot of testing lately into our front end builds, but when there's nothing being doing on the back end, finding bugs can take weeks, which seems ridiculous when the tradeoff of writing tests might take a little more time, but at least we'll have confidence in finding issues when they arise, instead of going on a wild goose chase every time :'(

I think a lot of the mindset arises from the, "We're using a compiled language, it'll find the bugs for us," which is completely untrue. This is one of the reasons I struggle with the merits of TypeScript on the front end because it's not very often that my team creates bugs that actually have to do with types. Hiding behind the language as a means of testing is not a valid testing strategy.

Collapse
 
barakplasma profile image
Michael Salaverry

Some of the opposition to testing comes down to laziness and an inability to take responsibility for bugs.

RE: laziness:

Writing test code takes 15-30% more initial investment into code, and is only useful for the x% of code which ends up causing bugs. So most individual contributors would have to put in more hours to complete the same amount of work from management. Additionally, figuring out how to test some units is not trivial, and would require learning tangential to completing tasks. And when there is a QA department to handle the more frustrating part of programming, debugging and checking for errors, it is easier for the individual contributor to offload part of their work onto somebody else.

RE: taking responsibility

Having tests break means that the source of bugs becomes more obvious. When there is an opaque bug search process, it is easier for contributors to cover their own asses, and covertly patch bugs. In office politics, perception is reality; if the backend developers are willing to cast the blame onto the front end or API clients for bugs, it looks better for the backend. Even if the bug ends up being proven as a backend bug, the initial blame damage has been done, and managers convinced who to blame first in the future.

The only arguments I've seen work are

  1. Management recognizes, supports, and rewards quality; Quality is attained in part through testing.
  2. Most show stopping, up till 4am, bugs are caused by poor code maintenance, and the only way to get out of stressful firefighting mode is through rigorous testing. (This argument doesn't work if the Developer enjoys the thrill or has no life outside work.)
Collapse
 
david_j_eddy profile image
David J Eddy

This makes me sad. I'm sorry your back end team is so backwards. 😟