DEV Community

Betsy Nelson for 7pace

Posted on

How humans cause bugs đź•·

There are tons of reasons bugs happen. Just like there are tons of reasons a person might make a mistake in any part of their life, developers make mistakes while coding, and then you have bugs. However, understanding some of the most common reasons bugs happen can help you try to avoid those scenarios more often. While it’s impossible to completely eliminate all mistakes in your team’s work, these are the top reasons bugs make their way into software projects, and what you can do to prevent them from happening on your team and your projects.

1. Code Is Written by Humans 👨🏻‍💻

The top reason bugs happen? Because it’s written by humans, and humans aren’t perfect.

What you can do about it:

You’ll never be able to do away with 100 percent of human error. But studies show that people who work longer hours are much more likely to make mistakes, so if your team is working sprints that include a ton of overtime, that may be contributing.

You may also get bugs because your engineers lack experience and practice. Combat this by looking for experienced engineers for your team, offering wages that will attract talented developers, and offering educational experiences that help your team continue to grow their skills.

2. Miscommunication đź’¬

Communication breakdowns can present on your team and in their code in multiple ways.

Bugs can be the result of incorrect communication about the project and its requirements. They can also come from a lack of communication, either about the project requirements, or between team members who are collaborating, leading to problems when they attempt to integrate their code. If the customer isn’t clear about what they want the project to accomplish, bugs can result because of guesswork on the engineers’ end. Making changes to the requirements during the coding process is also a great way to get bugs, as is adding features to existing code when the working developer or team isn’t familiar with that base code.

What you can do about it:

Beat bugs caused by miscommunication by getting clear guidelines from the client before beginning the project, making sure all engineers are aware of those guidelines, and by fostering an environment of open communication and collaboration between team members working together on a project.

3. Deadlines Are Unrealistic đź’˘

A very common cause for bugs in your code is deadlines that your engineers can’t realistically meet. Whether it’s because they’re working long hours to try to hit the deadlines, or because they’re taking shortcuts to try to finish a project on time, unmanageable timelines are far more likely to result in buggy code.

What you can do about it:

Combat this by having experienced project managers setting deadlines, and by keeping open communication with your team. If they’re struggling to meet deadlines, or having to work long hours to do so, your timelines likely need to be adjusted. If you’re struggling to figure out how long it’ll take your team to do work, try experimenting with calculating your pace.

4. Third-Party Tools Have Their Own Bugs 🧰

Sometimes third-party tools can make the development process easier, or they’re even necessary for a project. Tools like Debugger, Compiler, plug-ins, external APIs, shared DLLs, class libraries, and more might be useful for getting a project done, but if they have bugs of their own, they may create bugs in your code.

What you can do about it:

This is tough to avoid, since you often don’t have control over the code and functionality of a tool designed by someone else. If it’s an open source tool, you may be able to tweak it, but that takes time and skill away from your own project. If you find that a third-party program or tool is consistently resulting in bugs in your own code, it may be that the best thing you can do is just start avoiding that program or tool.

Testing issues 🧪

There might not be enough time for testing. Bugs might be found but not fixed. Sometimes even the most obvious things get missed. But you should know about the Pesticide Paradox. In 1990, software engineer Boris Beizer coined the term “Pesticide Paradox” in his book, Software Testing Techniques. He was referring to the phenomenon that, the more you run particular tests on your software, the more immune it becomes to those tests. Even though it’s been nearly 30 years since Beizer introduced the idea, engineers still see the Pesticide Paradox in action today.

What you can do about it:

Never get complacent about your testing process. The way to beat the Pesticide Paradox is by changing up your test suite, reviewing it and making updates as often as possible to ensure it’s keeping up with product changes as they’re made.

TDLR;

As long as software is coded and tested by humans, bugs will always exist. There’s no way to eradicate them completely, as annoying as they may be. But by knowing what causes them, you have a better chance of finding and squashing them. I went into (a lot) more detail about this here.

Top comments (0)