Shotgun debugging is the process of making relatively undirected changes to code in an attempt to fix a bug. This is essentially a process of guessing that may be used when a programmer has run out of ideas.The term shotgun debugging has slightly negative connotations as it implies that a developer doesn't understand the code or design. For example, cut-and-paste coding often leads to shotgun debugging as developers may lack understanding of their own code.In practice, highly skilled developers also use shotgun debugging from time to time. It is often faster to redesign and reimplement a section of code than to fix a difficult to reproduce bug.
Making changes to code in hopes of fixing a bug without knowing what is causing the bug.
Value
It is often easier to rewrite poorly designed code than fix it.Making code a little more robust often makes an error go away when you have been unable to determine a root cause after reasonable effort.
Cookies help us deliver our services. You have choices regarding these cookies. Please visit our privacy policy, cookie policy and consent tool to learn more.
Copyright 2002-2026 Simplicable. All rights reserved. This material may not be published, broadcast, rewritten, redistributed or translated. Report violations here.