Online course in Tech & Coding

Defensive Programming and Debugging

Find out how to write clean and robust code as a programmer. Explore techniques to minimise the number of bugs during development.

  • Duration 5 weeks
  • Weekly study 4 hours

Learn how to identify and solve software bugs in your code

Want to improve your ability to identify and fix bugs in code?

On this course, you’ll discover how to reduce bugs during software development. You’ll learn with examples in both C and Fortran programming languages and understand how to catch bugs early using compiler features and writing tests for your code.

You’ll learn to find the bugs in your code using the best tools available including debuggers and code analysers. You’ll also look at parallel programs and explore tools for debugging parallel code at scale.

By the end of the course, you’ll feel confident writing high-quality and clean code.

Download video: standard or HD

Skip to 0 minutes and 9 secondswhat can you tell us about bugs? Okay, so there's the story. In 1947 a group of technicians at Harvard University were running their electromechanical computer and they noticed a lot of errors. So they opened up the computer and they found a moth. They found an actual bug! So they dropped the logbook, took the moth, pasted it in and wrote the following

Skip to 0 minutes and 38 secondswords: "first actual case of a bug being found". And from that day onward we've been using the word bug to refer to glitches and flaws in any system. So why are bugs bad? Seriously? Besides making your life as a programmer miserable, they can have really dramatic consequences. In 1996 the launch of an Ariane 5 rocket failed due to a bug in the inertial reference system. 40 seconds after launch the rocket exploded ... Just like with real bugs you want to prevent an infestation. So, it's crucial that you adopt a defensive programming style to reduce the number of bugs in your code. In this MOOC will discuss professional tools and advanced techniques for debugging serial and parallel programs.

Skip to 1 minute and 30 secondsSo, you'll minimize the time and frustration spent on finding and fixing them.

Skip to 1 minute and 35 secondsWelcome to our MOOC: "Defensive programming and debugging"

What topics will you cover?

  • Defensive programming: the use of good coding style, documentation strategies and good code testing
  • Preventing bugs: how to use compiler flags and static code checkers to identify bugs in an early stage
  • Finding bugs: debugging concepts and technics
  • Using the debugging tools GDB and Valgrind to fix serial programs
  • Debugging parallel code: using Intel Inspector and ITAC

When would you like to start?

  • Date to be announced
Add to Wishlist to be emailed when new dates are announced

What will you achieve?

By the end of the course, you'll be able to...

  • Develop good writen software codes
  • Produce clear and useful software documentation
  • Identify software bugs
  • Solve sofware bugs

Who is the course for?

This is an intermediate level course aimed at people with some programming experience. Although examples will be given in C and Fortran, the principles (and most of the tools) are transferable to other programming languages.

Who will you learn with?

Geert Jan Bex

Geert Jan Bex

HPC analist/consultant at Hasselt University and University of Leuven.

Mag Selwa

Mag Selwa

During my physics studies I got interested in research in computational physics/astrophysics. After several postdoctoral positions I joined VSC and I stay close to science by supporting our HPC users.

Ingrid Barcena

Ingrid Barcena

I have been for more than 20 years helping users to take the most of the HPC systems. Since 2013 I work at the HPC User Support Team at KU Leuven.

Who developed the course?

The Partnership for Advanced Computing in Europe (PRACE) is an international non-profit association with its seat in Brussels.