Explain why developers are bad at testing their work, like I am five

Did you find this post useful? Show some love!
DISCUSSION (14)

Your mom says you are good looking.

Generally, they're not. They're bad at manually testing their own code, because they're too close to it. Kind of like how an author writes a story, and then a proof-reader picks apart all the obvious mistakes they didn't notice.

Developers can be good at writing tests, they can be good at anticipating strange conditions and at writing their code defensively, but they can't always see the wood for the trees.

Indeed, so are you saying there is no cure?

People are bad at checking their own work.

Ever wrote a 10 page document, looking it over again and again, not seeing a single error. And then hand it over to somebody else who finds an error within a minute in the first paragraph?

You did not see the problem because your brain had made assumptions about the content.

The same happens with software. You've already filtered out problem states when you start testing.

Ben Halpern DEV.TO FOUNDER

Hey there, we see you aren't signed in. (Yes you, the reader. This is a fake comment.)

Please consider creating an account on dev.to. It literally takes a few seconds and we'd appreciate the support so much. ❀️

Plus, no fake comments when you're signed in. πŸ™ƒ

To make anything you need a special kind of mindset.
To break the same thing you need the opposite mindset.
Now just for the sake of argument lets suppose you are equally good at both said trains of thought.
It still takes time to adjust your mentality from one to the other.
So it's fair to say "point of view" is a factor.

Cheers.

Some do suggest developers are too protective of their own code, but I'm certain 99.99% of developers would actually prefer to get their code broken early on, rather than having to deal with shouting boss' boss 2-3 months after deployment.

In my opinion the actual reason is lack of time.

Once you are pressed for deadlines, there's direct conflict of interest, and it's easy for everything becomes about meeting the deadline and less about quality of both tests and deliverables.

What developers probably are bad at is asking for that additional time up-front for testing and fixes. Management of course can be as bad at allowing that extra time, so it's a team job to get it working.

There are of course some other factors like superior domain knowledge or lack of user empathy that could affect ability to come up with right tests, but these should be easier to overcome if necessary time is available.

Do you think that devs are bad at design a full coverage manual testing?

I personally don't think so - there might be people that are a bit better or less so, but I don't think developers automatically make bad testers, no.

Would you walk into a hole if you knew there is a hole in front of you? :) Thats what developers do when testing, they leave out the scenarios they know are bound to break the app. After a long day's work they want to feel good not disappointed.

You want to bake a cake for the family.
You like it really sweet, so you want to add extra sugar.
Your brother says it will be too sweet.
You tone it down a bit.
The whole family loves the cake.

I would explain the metaphor but I guess you'll understand.
A developer builds something in a certain way because he believes that's the right way. A tester double-checks if he agrees and if it works the way he would expect.

I think I'm pretty good at writing tests, with or without tdd. Corner an standard cases and regressions. The same reason why I love debugging complicated bugs I guess.

What I'm definitely bad at is e2e testing because it's always an afterthought and I don't have as much experience with it 😭

Fact:
Testing is hard
Time is limited
Breaking your code is as hard as writing your code
No one likes to do things twice

Opinion:
Its impossible to figure out how my code will break, where and under what circumstances
I can test as much as is possible using good tools and a little prior experience
Its good to scope out a good hiding place before your mistake brings down the app (that is totally a joke)

Classic DEV Post from Jan 12

What was the worst bug you've ever written?

So I just wrote my worst bug ever. The Practical Dev @thepracticalde...

READ POST
Follow @ben to see more of their posts in your feed.
Periklis Gkolias
In love with Python, but I admire all the stacks that offer solutions without testing my patience. Avid productivityist, great-food worshipper, always-smiling.
More from @perigk
What does it mean that a neuron fires, in layman terms? What is the output usually?
#machinelearning #neuralnetworks #explainlikeimfive
A comprehensive introduction to unit-testing and mocking with Python3
#mocking #unittesting #python #explainlikeimfive
Trending on dev.to
Frequent delivery - how?
#discuss #delivery
How to Improve Your Development Experience
#beginners #career #development #productivity
Juggling Multiple Languages Simultaneously
#discuss
Who's looking for open source contributors? (September 24 edition)
#discuss #opensource
Thoughts on interpreted vs compiled languages?
#discuss
Have you ever been in a hackathon
#discuss
Do you hide dev signatures in your code?
#discuss
Thoughts on Dashboard Design
#data #dashboard #dataanalysis #productivity