From the Rubber Duck Debugging Wikipedia Page:
Rubber duck debugging, Rubber Ducking, or the Rubber Duckie Test is an informal term used in software engineering to refer to a method of debugging code. The name is a reference to an apocryphal story in which an unnamed expert programmer would keep a rubber duck by his desk at all times, and debug his code by forcing himself to explain it, line-by-line, to the duck.
To use this process, a programmer meticulously explains code to an inanimate object, such as a rubber duck, in the expectation that upon reaching a piece of incorrect code and trying to explain it, the programmer will notice the error. In describing what the code is supposed to do and observing what it actually does, any incongruity between these two becomes apparent.