DEV Community

Cover image for Test it, dang it!
Hubert Lewandowski
Hubert Lewandowski

Posted on

Test it, dang it!

There are plenty of open-source enthusiasts who help develop this environment. As a result, we have all sorts of solutions that contribute to the overall development or comfort of technology.

So what's the problem?

Well, the trouble is that it does not always go in the right direction. Many people jointly develop code, fix bugs (although more often they report πŸ™ƒ), add new functionality and new bugs on occasion. Worse, sometimes it can be backdoors (such as the one discovered in XZ Utils).

It is also common for the list of reported problems to grow and sometimes endless, with developers unable to keep up with fixing them and often times stop responding completely to reports. You can especially see these situations among popular tools, which are often components of larger tools and sometimes (horror of horrors!) systems.

There's criticism, but a solution?

No, I don't have and there is not yet a solution for this. Such situations also occur in closed-source code, and they will arise because that's the nature of development - bugs happen. On the other hand, it is possible to significantly reduce the occurrence of such situations by, for example, testing.

Testing can only prove the presence of bugs, not their absence.
~Edsger Dijkstra

Testing helps prevent the creation of problematic code. This is one where chaos reigns, where one change can trigger a number of others in an uncontrolled manner. Taking care of clean code and thoughtful design greatly helps reduce this risk, but very often the testing aspect is ignored.

It is the testing that helps verify whether, despite our well-thought-out solution, we didn't make a mistake somewhere with the assumption related to our idea.

Won't productivity suffer?

Initially yes, and often newcomers to software testing are weary of the process. However, the more complex software becomes, the more testing helps to maintain control and point out where something has gone wrong.

In addition, there is the aspect of proficiency, and new concepts present challenges for beginners. If you are starting out in testing, remember that practice makes perfect, and over time when you become proficient writing good unit tests it will become natural.

Some may wonder that why mention something so fairly obvious? After all, this whole "testing" exists for something, doesn't it? This is true, but many people avoid it like the plague. They usually consider that how one creates something relatively simple and there is no need to dwell on it because it just worksβ„’.

Though, this is a healthy approach if you actually create something you won't develop later. For me it gives a bit of a vibe off like there's no assurance that the tool does it job, as it should, and won't mess up with the work I want to use it on.

However, if you want to create or collaborate on large projects that are constantly evolving, then I highly encourage you to try and develop software testing skills. It doesn't matter which technique you use to write them; what matters is that you do it and these tests allow you to prevent future problems.

Top comments (0)