August 9, 2009 AT 12:21 am

Can We Teach Debugging?

Debugging 2
Interesting question – thoughts? Flatline writes –

Can we teach people how to debug? We often talk about “the art of debugging”, but is it really an art? Is it a science? A mixture of both?

Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!

Maker Business — DoD Education Program

Wearables — Don’t be a dummy

Electronics — Even lower power!

Biohacking — Biohacking: Getting Ripped with Brian Konash Partner Acrobatics Base

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


  1. Just teach reasoning. Everything else follows.

  2. I think an orthogonal question is can people teach experience? In order to debug problems reasonably complex problems requires a lot of experience. For things like debugging small motors or simple circuit boards the experience needed isn’t that great and a general understanding of the topic goes a long way. My day job is graphics device drivers and in that case if you take to equally smart people one who has 5 years of graphics driver experience and one with very little experience, it will normally take 5 times or more time for the inexperienced developer to fix the problem. It takes practice and experience to become a good debugger.

  3. I teach programming, often in workshop courses where the amount of time is not sufficient for everything to sink in in a meaningful way. The approach that’s worked for me is to point to common problems to get students thinking in terms of heuristics. In PHP, for example, start with “Did you end the line before the error with a semicolon?” and work you way down to more obscure issues. When you run across an error, point out that it is of a type–a pattern that you can look for. Knowing the 90% cases gets you further down the road to the 10% more quickly.

    Working within good frameworks (either explicit ones with a capital “F” or implicit rulesets) also helps. My own debugging ability improved when I switched to Rails from PHP a few years ago and found myself driving between the painted lines that programmers who were Much, Much Better Than Me had put there (naming conventions, baked-in tests, etc). Balking at those restrictions forced me to justify my preferences; sometimes, I found myself with a better understanding of why I liked to do things my way, but most of the time, I realized that theirs was a better way.

    Ultimately, though, the learning curve is like playing an instrument. Debugging is to programming what scales are to the guitar.

  4. Debugging definitely includes many techniques that can be taught:
    Binary search (remove half of the circuit/code and test its output)
    Probing (either a literal probe, or a print statement)
    Test harnesses (either a code driver or a testing circuit)

  5. From Twitter:
    “@adafruit hmm. its becoming really apparent that arduino has unleashed a vast multitude of people who know basically zero about the debugging process. and that this is the biggest problem at the moment”

    I am guessing Ladyada got yet another question on her forums like “I built your kit but it didn’t work. Can you help me fix it?”

    I agree that debugging is neither art nor science, but rather it is a teachable craft. Getting folks from zero knowledge to non-zero is possible, as even explaining some basics of debugging will put them way ahead of where they are now. The “scientific method” of hypothesis/test/analysis plus breaking the problem down into simpler parts, as stated by Flatline, is a start. How to use a DVM. How to unit test software, etc. All teachable skills.

    The kit providers could also be helping a little more by providing a few hints about how the circuit should operate. http://jyetech.com/Products/LcdScope/105-06200-00AJ.pdf is an example of providing some simple info on correct voltages at key points.

    In the Arduino space, the problem is a bit more “interesting”, as the bugs can be hardware, software, or both. But again, there are techniques to deal with that.

    The problem of teaching debugging may seem daunting, but if we just break it down into parts…

  6. Only in the sense that it is a skill, like music or drawing or athletics which can be coached, but the person needs to develop it.

    Malcolm Caldwell in Outliers notes that for both coding and symphony orchestra musicians, it takes 10,000 hours to become good. The Beatles did it in strip clubs in Germany. Bill Gates and the person who did the BSD TCP stack did it on timesharing machines (the latter exploiting a bug that gave him infinite timeshare). My friend bought his Atari ST, and I watched him as he grew from noob into expert (beating other professionals though he was an Auto worker – who has now singlehandedly coded several mission critical systems at his factory).

    Or all the good programmers who have degrees (I don’t) spent their evenings overclocking their PCs in college and writing things in DOS that still run faster than the current Windows equivalent.

    You can provide a map, and if it is followed, they will get to the goal.

    That is both the secret and problem with things like the PX90 or any exercise program or even diet. You have to do it. Daily. Consistently. I hate exercise (but am on a programming contract and they have this really wonderful swimming pool where I’m staying). But if I do at least 20 minutes trying for an hour every day I’m not horribly sick, I’ll get fit. It works but you have to do it. Or when I was practicing daily for singing in sunday choir (Latin mass) I quickly developed my music.

    It is the Nike theory: Just do it.

    It does require a base of talent, but perseverance is more important.

  7. @siliconfarmer, actually people who have difficulties with [adafruit] kits are not a problem at all . in fact, there are very few people who have problems with kits i sell that can’t perform basic debugging. thats because the docs provide a lot of hints and directions on how to test them. and if there is a problem, usually we can resolve it very quickly. πŸ™‚

    the actual problem is something else: there are 50,000 arduino users many of whom have never used any sort of electronics platform before. while there are tutorials on how to make servos move, leds blink, etc. there is a flood of users who want to do something more than that and don’t know how to synthesize new projects, new code, new libraries. this is fantastic because its the point of arduino. but there is not a large enough support network for them because the beginners massively outnumber the ‘skilled’ users :/

    to paraphrase: this isnt about debugging a project that exists – because usually projects are documented somewhat, have wiring diagrams or schematics, etc – but debugging projects that dont exist. in order to be able to help these massive numbers, its going to take more than writing a tutorial on how to use a multimeter (non-scalable) but perhaps figure out how to teach people to write tutorials on how to use a multimeter. does that make sense?

  8. I recommend reading this wiki. It is a story that will bring some humor relevant to this discussion.


  9. “figure out how to teach people to write tutorials on how to use a multimeter”

    Sorry, but that may be above my pay grade.

    I think the issue is one of motivation and return on investment. Obviously, there are a pool of people out there with experience in debugging. There are forums, instructables, and blogs where they could post tutorials on using multimeters and other debugging tools. But what do they gain if they start write up general debugging tutorials? Probably just a lot of newbies asking them for specific help with their projects.

    You also expanded the scope to teaching new users how to create their own designs. That is definitely in the too hard basket for me. A BSEE/CS degree, a decade or more of reading Byte magazine, a good mentor or two, and years of practice. That is my recipe.

    Anyone out there care to take on web/paper publishing an Arduino-equivalent of Byte or Circuit Cellar?

  10. @siliconfarmer we absolutely know where you are coming from. what you do is extremely helpful and appreciated by all, and we’re not asking you to do more than that. πŸ˜€

    however, i think you’ve ‘hit the nail on the head’ with your comments. the internet is great for sharing projects and kinda bad for teaching.

    however! we have some plans to attack this issue, stay tuned πŸ™‚

  11. So the Internet is a mixed bag in my view, I grew up pre-internet and never found anyone nearby with an interest in electronics, my only source of parts was Radio Shack (not well stocked even back then) and so I was basically futzing around on my own, leaving a long trail of burned out components and half working projects garned from lifeless books wondering what I did wrong. But what I did have was that time to struggle and think about things.

    Don’t take me wrong, I love the Internet. The information available on the Internet is a god send. And after using pics and AVRs bare for a while, I really appreciate the simplicity of the Arduino platform. Just because I understand DDRB=0x70;PORTB|=0x78; doesn’t mean I want to use it all the time.

    I mentor kids in the FIRST program (and you should too!) and I deal with a lot of kids (and adults) learning for the first time. Too many time a mentor wants to “help” by showing someone how to fix a problem, and that’s not always the best way to teach someone. You have to teach them how to ask questions and give them the skills (like using a multimeter) to help them find the problem themselves. As a mentor you’ve got to encourage beginners to risk making mistakes and showing them the process you use to find problems.

  12. Who is that in the photo? Eckert or Mauchly?

  13. Step 1: Lose the jacket.


  14. I think the internet if full of people that ask stupid lazy questions. If they overcome their laziness then they will probably find their answer. It’s just it seems from some forums that I’ve read questions that intend me to write the code for the question asker.
    The best you can do is package your tutorial/project as a module that can be used with others or by itself. Inform the user what behavior to expect from the project and what not. If the user can’t figure out how to use a multimeter, Fuck ‘Em. Nuff said.

Sorry, the comment form is closed at this time.