Debugging and testing are topics which are not usually the focus of university teaching.
We highly recommend The Practice of Programming by Kernighan and
Pike, which teaches much more than just writing code. Specifically, it covers testing,
debugging, portability, performance, and design alternatives.

  1. What was your last bug? What was your hardest bug?
  2. How would you debug a distributed program?
  3. A program works sometimes and fails other times - why?
  4. A program works sometimes and fails other times on the exact same input - why?
  5. How would you determine where a program spends most of its time?
  6. How does JUnit make the process of testing easier?
  7. List five ways in which C code can be non-portable. What can you do to make the code portable?
  8. Write tests for implementation of an isupper() function.
  9. Should you test private methods? Should you test one line methods?
  10. If you find and fix an error by adding debug code, should you remove the debug code afterwards? Should you leave them in with a conditional compilation flag or with a run time flag?
  11. What is a buffer overflow and how can hackers exploit it?
  12. How can you use Valgrind to solve segfault problems?
  13. How does Valgrind catch access uninitialized memory?