Rubber duck debugging
Rubber duck debugging is an informal term used in software engineering for a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck.[1] Many other terms exist for this technique, often involving different inanimate objects.
Many programmers have had the experience of explaining a programming problem to someone else, possibly even to someone who knows nothing about programming, and then hitting upon the solution in the process of explaining the problem. In describing what the code is supposed to do and observing what it actually does, any incongruity between these two becomes apparent.[2] More generally, teaching a subject forces its evaluation from different perspectives and can provide a deeper understanding.[3] By using an inanimate object, the programmer can try to accomplish this without having to involve another person.
See also
- Code review
- The Aha! effect
- Pair programming
- Socratic method
- Software walkthrough
References
- ↑ The Pragmatic Programmer: From Journeyman to Master. Addison Wesley. ISBN 978-0201616224. p. 95, footnote.
- ↑ Baker, SJ, The Contribution of the Cardboard Cutout Dog to Software Reliability and Maintainability.
- ↑ Hayes, David (25 June 2014). "The Psychology Underlying the Power of Rubber Duck Debugging". Press Up. Retrieved 3 July 2015.
External links
- Rubber duck debugging: site honoring the method.
- Rubber Duck Problem Solving: Coding Horror blog.