• Partnership for Advanced Computing in Europe (PRACE)
  • Vlaams Supercomputer Centre Logo

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.

6,086 enrolled on this course

green bug
  • 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 seconds what 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 seconds words: “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 seconds So, you’ll minimize the time and frustration spent on finding and fixing them.

Skip to 1 minute and 35 seconds Welcome 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

Learning on this course

On every step of the course you can meet other learners, share your ideas and join in with active discussions in the comments.

What will you achieve?

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

  • Develop good written software codes
  • Produce clear and useful software documentation
  • Identify software bugs
  • Solve software 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?

Since 2009 I'm an HPC consultant for the Flemish Supercomputer Center, doing support and training (also for PRACE and EuroCC). I've a PhD in physics and CS on topics in machine learning.

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.

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?

Partnership for Advanced Computing in Europe (PRACE)

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

Vlaams Supercomputer Centre

The Flemish Supercomputer Center (Vlaams Supercomputer Centrum - VSC) is a partnership between the five Flemish universities and their university associations: Associatie Universiteit & Hogescholen Antwerpen, Universitaire Associatie Brussel, Associatie Universiteit Gent, Associatie KU Leuven and Associatie Universiteit-Hogescholen Limburg. This consortium brings together knowhow in scientific and technical computing in Flanders.

Learning on FutureLearn

Your learning, your rules

  • Courses are split into weeks, activities, and steps to help you keep track of your learning
  • Learn through a mix of bite-sized videos, long- and short-form articles, audio, and practical activities
  • Stay motivated by using the Progress page to keep track of your step completion and assessment scores

Join a global classroom

  • Experience the power of social learning, and get inspired by an international network of learners
  • Share ideas with your peers and course educators on every step of the course
  • Join the conversation by reading, @ing, liking, bookmarking, and replying to comments from others

Map your progress

  • As you work through the course, use notifications and the Progress page to guide your learning
  • Whenever you’re ready, mark each step as complete, you’re in control
  • Complete 90% of course steps and all of the assessments to earn your certificate

Want to know more about learning on FutureLearn? Using FutureLearn

Do you know someone who'd love this course? Tell them about it...

You can use the hashtag #FLdebugging to talk about this course on social media.