Making Defects Impossible

Matt Eland
The Startup
Published in
5 min readAug 30, 2019

--

Software bugs are bad, but repeated bugs of the same type can be beyond frustrating. How many times have we seen error messages containing strings like “Object reference not set to an instance of an object”? As software engineers, we can fight one-off occurrences as we find them, or we can aggressively look to eliminate common causes of defects as we identify them.

Whenever you see a defect, ask yourself how it was possible for that defect to exist, for it to remain undetected for however long it did, and what you can do to either eliminate the possibility of future defects like it or make it impossible for them to hide

Certainly we can’t eliminate all types of issues, but the types of issues we can strategically address at the design or language level is growing every year.

This article is written from the perspective of a .NET and JavaScript development manager, but the techniques may also be more broadly applicable to other languages.

Bear in mind that many of these techniques have tradeoffs in readability or other facets (particularly those related to functional programming), so choosing to go with them should not be automatic, but rather a careful decision made based on the skill level and familiarity of your team members, the state of the codebase, and the nature of the types of problems you’re trying to solve.

--

--

Matt Eland
The Startup

Microsoft MVP in AI, AI Specialist at Leading EDJE. Author of "Refactoring with C#".