Unfortunatelly, bugs are part of modern software development process. But some development teams produce significant less bugs rather than another ones.
What is the difference between such teams?
The first thing to get in mind is experience, because it looks too obvious that senior developer produces less bugs rather junior one. But I know a lot of cases where teams are not able to make stable sofware for months and such teams are fulfilled only by senior and middle developers.
The next thing to get in mind is testing, because test is a tool to verify that software works as expected.
Indeed, manual or automate testing by developer is able to fix bugs with the lowest cost. And usually successful teams perform testing at all development stages from requirements analysis to deploy software to production ready environment. But testing in nature is process to fix already created bugs and it does not prevent creation of new ones.
So, is it possible do not produce bugs at all?
And before I answer to question let’s look where bugs born.
Where bugs born
Software development process looks like a process of house building where developers add new features brick by brick. And new brick, namely blocks of code, brings to software new features and unfortunatelly new bugs.
So, adding new code lines produces bugs and most of them born at new code, but there are another places where bugs may born. So let’s looks on bugs birthplace:
Of course, new code has the highest probability to produce new bugs and therefore, new code lines usually are in focus of testing process. But it does not mean that all bugs are appeared there, because new code lines usually plug to existed codebase.
And there are quite high probability to produce new bugs at places where new code contacts to old one. It means that new bugs may be appeared at old code on the border of new code lines. And the goal of regression testing is verify that old features work properly after codebase has changed.
But sometimes software may be too complicated and some new bugs could be appeared in old code that far away from new one. Probability of such cases is quite low, especially for young application. Usually steps to reproduce such bugs are complicated and really hard to investigate and test.
So, to summarize, there are three places where bugs may born:
1. Inside new code
2. Inside old code on the border of new one.
3. Inside old code that far away from new one
Codequake
Recently, I have compared software development process to process of house building. Defenetly, it looks similar but it is not the same.
For example, it is almost not possible to put one more brick in the middle of already built wall when house is building, but it is easy to do such trick at software development. And to be honest, such trick happens regulary. It means new code regulary is added into the middle of existed code base. So, let’s depict such situation:
I depict bugs birthplace as circle and highlight their creation probability by color.
And when new code is added, it produces waves of destruction at existed codebase like earthquake. Moreover, codebase is shaked toughly if new code simultaneously has added at many places. And such “improvements” are able to break application at all.
So it is a really pity because a lot of developers have to change numereous files at every task and produce a lot of bugs. For me, it looks like sailor hits ship plating to plug something to it and then fix cracks to prevent water pouring into the ship.
But is it only developers fault of bug creations?
Bug causes
Of course, developers produce bugs because they have to add new code. Therefore they have some responsibility at bug creation process, but it is only part of a big picture.
I split bugs into two groups in order to simplify my research of bug causes:
- Technical bugs
- Business logic bugs
Technical bugs
Techinal bugs are errors like Null pointer exception, Out of Memory error, performance issues and etc.
Such bugs are appeared if developer do not predict it or make mistake. Therefore only developers are responsible for such bug creation. Such bugs may be real annoying and block software delivery to customer or testing process.
Techical bugs causes:
- developer has low skill
- lack of time when developer is overloaded by tasks and tryies to complete every task as soon as possible
- low development culture on project
(developers do not follow best practice, do not use modern development tools) - lack of testing
(manual and/or automate like unit, integration testing)
Business logic bugs
Any software has goal of existence. It means there is reason why software has created. And usually the reason is business value.
So, software does some actions in order to provide some business value. And such actions are instructions that developers code into software. Therefore, developers have to add new code when business value changes.
And new code brings new bugs.
But business logic bugs are appeared before developer adds any code lines to software. It is really strange at first glance because bugs are fixed in the code at the end, but business logic code is result of human communication. Therefore, if there are bugs at project team communication then it maps to codebase and defenetly bugs would be there.
Let’s look on business logic bug causes:
- bugs at human communication on project
(between team members, between team and customer and etc.) - consequence of technical bug
Conclusion
So, is it possible do not produce bugs at all?
It is quite philosophical question like: “is possible to live without mistakes?”
All people make mistakes and project teams behave the same way when develop software because all people make mistakes.
Hopelly, there are a lot of technics and practices at software development that help to reduce bugs production. And I strongly recommend to follow them and keep in mind all causes that lead to bug creation.