33-debugging

33-debugging - Mehran Sahami CS 106A Handout#33 November 2...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Mehran Sahami Handout #33 CS 106A November 2, 2009 Debugging Thanks to Eric Roberts and Nick Parlante for portions of this handout. Much of your time as a computer programmer will likely be spent debugging. This phenomena is best described by a quotation from one of the first computer pioneers, Maurice Wilkes: As soon as we started programming, we found to our surprise that it wasn’t as easy to get programs right as we had thought. We had to discover debugging. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs. Maurice Wilkes, 1949 In order to be better prepared to undertake the more complex future debugging that you will be doing, we aim to give you here both a sense of the philosophy of debugging as well as to teach you how to use some of the practical tips that make testing and debugging easier. The philosophy of debugging Debugging is one of the most creative and intellectually challenging aspects of programming. It can also be one of the most frustrating. To a large extent, the problems that people face debugging programs are not so much technical as they are psychological. To become successful debuggers, you must learn to think in a different way. There is no cookbook approach to debugging, although Nick Parlante’s 11 Truths of Debugging (given below) will probably help. What you need is insight, creativity, logic, and determination. I've heard that Diet Coke ™ helps too, but this may be anecdotal… As computer scientists, it is important to remember that the programming process leads you through a series of tasks and roles: Task Role Design Architect Coding Engineer Testing Vandal Debugging Detective These roles require you to adopt distinct strategies and goals, and it is often difficult to shift your perspective from one to another. Although debugging can often be very difficult, it can be done. It will at times take all of the skill and creativity at your disposal, but you can succeed if you are methodical and don’t give up on the task. Debugging is an important skill that you will use every day if you continue in Computer Science or any related field. Even though it is the final task of those listed above, it is certainly not the least important. You should always plan ahead and allow sufficient time for testing and debugging, as it is required if you expect to produce quality software. In addition, you should make a concentrated effort to develop these skills now, as they will be even more important as programs become more complicated later in the quarter.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 The 11 Truths of Debugging 1. Intuition and hunches are great you just have to test them out. When a hunch and a fact collide, the fact wins. That's life in the city. 2.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/01/2009 for the course CS 106A taught by Professor Sahami,m during the Fall '08 term at Stanford.

Page1 / 13

33-debugging - Mehran Sahami CS 106A Handout#33 November 2...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online