Rubber duck debugging

Last updated

A rubber duck in use by a developer to aid debugging Rubber duck assisting with debugging.jpg
A rubber duck in use by a developer to aid debugging

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

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]

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

Related Research Articles

Computer programming or coding is the composition of sequences of instructions, called programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of procedures, by writing code in one or more programming languages. Programmers typically use high-level programming languages that are more easily intelligible to humans than machine code, which is directly executed by the central processing unit. Proficient programming usually requires expertise in several different subjects, including knowledge of the application domain, details of programming languages and generic code libraries, specialized algorithms, and formal logic.

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.

<span class="mw-page-title-main">Pair programming</span> Collaborative technique for software development

Pair programming is a software development technique in which two programmers work together at one workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently.

<span class="mw-page-title-main">Debugger</span> Computer program used to test and debug other programs

A debugger or debugging tool is a computer program used to test and debug other programs. The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its execution and monitor changes in computer resources that may indicate malfunctioning code. Typical debugging facilities include the ability to run or halt the target program at specific points, display the contents of memory, CPU registers or storage devices, and modify memory or register contents in order to enter selected test data that might be a cause of faulty program execution.

Cargo cult programming is a style of computer programming characterized by the ritual inclusion of code or program structures that serve no real purpose. Cargo cult programming is symptomatic of a programmer not understanding either a bug they were attempting to solve or the apparent solution. The term cargo cult programmer may apply when anyone inexperienced with the problem at hand copies some program code from one place to another with little understanding of how it works or whether it is required.

Shotgun debugging can be defined as:

Computer science is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. One well known subject classification system for computer science is the ACM Computing Classification System devised by the Association for Computing Machinery.

A think-aloudprotocol is a method used to gather data in usability testing in product design and development, in psychology and a range of social sciences.

The following outline is provided as an overview of and topical guide to software engineering:

Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before software is fully developed, and tracking all software development by repeatedly testing the software against all test cases. This is as opposed to software being developed first and test cases created later.

<span class="mw-page-title-main">Oberon-2</span> Programming language

Oberon-2 is an extension of the original Oberon programming language that adds limited reflection and object-oriented programming facilities, open arrays as pointer base types, read-only field export, and reintroduces the FOR loop from Modula-2.

In computing, an abstraction layer or abstraction level is a way of hiding the working details of a subsystem. Examples of software models that use layers of abstraction include the OSI model for network protocols, OpenGL, and other graphics libraries, which allow the separation of concerns to facilitate interoperability and platform independence. Another example is Media Transfer Protocol.

In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions.

<i>The Pragmatic Programmer</i> 1999 non-fiction book by Andrew Hunt and David Thomas

The Pragmatic Programmer: From Journeyman to Master is a book about computer programming and software engineering, written by Andrew Hunt and David Thomas and published in October 1999. It is used as a textbook in related university courses. It was the first in a series of books under the label The Pragmatic Bookshelf. A second edition, The Pragmatic Programmer: Your Journey to Mastery was released in 2019 for the book's 20th anniversary, with major revisions and new material which reflects new technology and other changes in the software engineering industry over the last twenty years.

In the field of pedagogy, learning by teaching is a method of teaching in which students are made to learn material and prepare lessons to teach it to the other students. There is a strong emphasis on acquisition of life skills along with the subject matter.

<span class="mw-page-title-main">Windows Error Reporting</span> Crash reporting technology

Windows Error Reporting (WER) is a crash reporting technology introduced by Microsoft with Windows XP and included in later Windows versions and Windows Mobile 5.0 and 6.0. Not to be confused with the Dr. Watson debugging tool which left the memory dump on the user's local machine, Windows Error Reporting collects and offers to send post-error debug information using the Internet to Microsoft when an application crashes or stops responding on a user's desktop. No data is sent without the user's consent. When a crash dump reaches the Microsoft server, it is analyzed, and information about a solution is sent back to the user if available. Solutions are served using Windows Error Reporting Responses. Windows Error Reporting runs as a Windows service. Kinshuman Kinshumann is the original architect of WER. WER was also included in the Association for Computing Machinery (ACM) hall of fame for its impact on the computing industry.

Simulation software is based on the process of modeling a real phenomenon with a set of mathematical formulas. It is, essentially, a program that allows the user to observe an operation through simulation without actually performing that operation. Simulation software is used widely to design equipment so that the final product will be as close to design specs as possible without expensive in process modification. Simulation software with real-time response is often used in gaming, but it also has important industrial applications. When the penalty for improper operation is costly, such as airplane pilots, nuclear power plant operators, or chemical plant operators, a mock up of the actual control panel is connected to a real-time simulation of the physical response, giving valuable training experience without fear of a disastrous outcome.

Comment programming, also known as comment-driven development (CDD), is a (mostly) satirical software development technique that is heavily based on commenting out code.

In computer programming and software development, debugging is the process of finding and resolving bugs within computer programs, software, or systems.

<span class="mw-page-title-main">Extreme programming</span> Software development methodology

Extreme programming (XP) is a software development methodology intended to improve software quality and responsiveness to changing customer requirements. As a type of agile software development, it advocates frequent releases in short development cycles, intended to improve productivity and introduce checkpoints at which new customer requirements can be adopted.

References

  1. Hunt, Andrew; Thomas, David (1999). The Pragmatic Programmer: From Journeyman to Master . Addison Wesley. ISBN   978-0201616224. p. 95, footnote.
  2. Debugging, Rubber Duck. "Rubber Duck Debugging". rubberduckdebugging.com. Retrieved 14 September 2023.
  3. Baker, SJ, The Contribution of the Cardboard Cutout Dog to Software Reliability and Maintainability .
  4. Hayes, David (25 June 2014). "The Psychology Underlying the Power of Rubber Duck Debugging". Press Up via Internet Archive. Archived from the original on 9 July 2014. Retrieved 10 September 2021.
  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 . PMC   10146599 . PMID   37103261.
  6. Attwood, Jeff (2012). "Rubber Duck Problem Solving". codinghorror.com.
  7. Malan, David (2020). "Rubber Duck Debugging in CS50 IDE". noticeable.news.
  8. "Stack Exchange has been taken over by a rubber duck!". Meta Stack Exchange. 31 March 2018. Retrieved 1 April 2018.