Chapter 13. Debugging

image with no caption

Programmers often find that they spend more time debugging a program than actually writing it. Good debugging skills are invaluable. In this chapter, we’ll discuss debugging in R.

Fundamental Principles of Debugging

 

Beware of bugs in the above code; I have only proved it correct, not tried it.

 
 --Donald Knuth, pioneer of computer science

Though debugging is an art rather than a science, it involves some fundamental principles. Here, we’ll look at some debugging best practices.

The Essence of Debugging: The Principle of Confirmation

As Pete Salzman and I said in our book on debugging, The Art of Debugging, with GDB, DDD, and Eclipse ...

Get The Art of R Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.