Rubber duck debugging

Short description: Code debugging method

A rubber duck in use by a developer to aid code review

SparkFun debugging rubber duck

In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. 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 (usually) inanimate objects, or pets such as a dog or a cat. Teddy bears are also widely used.[2]

## Contents

* 1 Approach
* 2 In popular culture
* 3 See also
* 4 References
* 5 External links

## Approach

Many programmers have had the experience of explaining a 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.[3] More generally, teaching a subject forces its evaluation from different perspectives and can provide a deeper understanding.[4] By using an inanimate object, the programmer can try to accomplish this without having to interrupt anyone else, and with better results than have been observed from merely thinking aloud without an audience.[5] This approach has been taught in computer science and software engineering courses.[6][7]

## In popular culture

On 1 April 2018, Stack Exchange introduced a rubber duck avatar on their websites as a new "feature" called Quack Overflow as an April Fools' Day joke. The duck appeared at the bottom right corner of the browser viewport, and attempted to help visitors by listening to their problems and responding with solutions. However, the duck merely produced a quack sound after apparently thinking and typing. It referenced rubber ducking as a powerful method for solving problems.[8]

## See also

* Code review
* Pair programming
* Socratic method
* Desk checking
* Duck test
* Duck typing
* Software walkthrough
* Eureka effect § The Aha! effect and scientific discovery
* Think aloud protocol
* Pointing and calling
* Rogerian method
* Worry dolls

## References

1. ↑ Hunt, Andrew; Thomas, David (1999). The Pragmatic Programmer: From Journeyman to Master. Addison Wesley. ISBN 978-0201616224. https://archive.org/details/isbn_9780201616224. p. 95, footnote.
2. ↑ Debugging, Rubber Duck. "Rubber Duck Debugging". https://rubberduckdebugging.com/.
3. ↑ Baker, SJ, The Contribution of the Cardboard Cutout Dog to Software Reliability and Maintainability, http://www.sjbaker.org/humor/cardboard_dog.html .
4. ↑ Hayes, David (25 June 2014). "The Psychology Underlying the Power of Rubber Duck Debugging". http://pressupinc.com/blog/2014/06/psychology-underlying-power-rubber-duck-debugging/.
5. ↑ Byrd, Nick; Joseph, Brianna; Gongora, Gabriela; Sirota, Miroslav (2023). "Tell Us What You Really Think: A Think Aloud Protocol Analysis of the Verbal Cognitive Reflection Test". Journal of Intelligence 11 (4): 76. doi:10.3390/jintelligence11040076. PMID 37103261.
6. ↑ Attwood, Jeff (2012). "Rubber Duck Problem Solving". https://blog.codinghorror.com/rubber-duck-problem-solving/.
7. ↑ Malan, David (2020). "Rubber Duck Debugging in CS50 IDE". https://cs50.noticeable.news/posts/rubber-duck-debugging-in-cs-50-ide.
8. ↑ "Stack Exchange has been taken over by a rubber duck!". 31 March 2018. https://meta.stackexchange.com/a/308578.

## External links

* Rubber Duck Debugging

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Rubber duck debugging. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Rubber_duck_debugging&oldid=3712741"