Rubber duck debugging

From Wikipedia, the free encyclopedia
Jump to: navigation, search
A rubber duck in use by a developer to aid code review

Rubber duck debugging, rubber ducking,[1] and the rubber duckie test[2] are informal terms used in software engineering to refer to 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 his code by forcing himself to explain it, line-by-line, to the duck.[3]

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.[4] By using an inanimate object, such as a rubber duck, the programmer can try to accomplish this without having to involve another person.

This concept is also known as "Talk to the Bear", dating from Kernighan's The Practice of Programming.[5]

Similar terms[edit]

  • Confessional debugging[6]
  • Rubber plant debugging
  • Cardboard programmer or programmer's dummy[4][7]
  • Cone of answers[8]
  • Thinking out loud[9]
  • Frog debugging

See also[edit]

References[edit]

  1. ^ "Rubber Ducking", Portland Pattern Repository, C2 .
  2. ^ "The Rubber Duckie Test", Technically Speaking, Google, Mar 2009 .
  3. ^ The Pragmatic Programmer: From Journeyman to Master. Addison Wesley. ISBN 978-0201616224.  p. 95, footnote.
  4. ^ a b Baker, SJ, The Contribution of the Cardboard Cutout Dog to Software Reliability and Maintainability .
  5. ^ The Practice of Programming 
  6. ^ McConnell, Steve. "Code Complete, First Edition". Retrieved 2012-08-20. 
  7. ^ "Cardboard Programmer", Portland Pattern Repository, C2 .
  8. ^ "Cone of Answers", Portland Pattern Repository, C2 .
  9. ^ "Thinking out Loud", Portland Pattern Repository, C2 .

External links[edit]