• Online, Self-Paced
Course Description

Defensive programming is a methodology for writing code that is not prone to present or future errors potentially caused by unexpected user inputs or actions. In this course, you will explore the fundamentals of defensive programming including inspections, testing, input validation, error handling, planning, methods, variables, assertions, and iterative design.

Learning Objectives

Introduction to Defensive Programming

  • start the course
  • describe the potential risks faced by software applications
  • identify the key reasons why risks are recurring issues
  • recognize the key features of defensive coding
  • list some key approaches that prevent problems during the planning stage

Defensive Programming C/C++ Techniques

  • recognize what a clean code is
  • identify the key features of iterative design
  • use pseudocode to develop programming solutions
  • use assertions in your programming code
  • apply pre and post conditions to C/C++

Inspections and Testing for C/C++

  • identify how to perform low-level design inspections
  • describe the benefits of testing your code
  • recognize how to write testable code in C/C++
  • recognize how to perform unit tests using Visual Studio for C/C++

Defendable Code in C/C++

  • create examples of defensible methods in C/C++
  • identify the techniques for applying defensive techniques for method parameters and return values in C/C++ methods
  • recognize how to implement variable declarations for defendable code
  • identify how to use if and switch statements in creating defendable code

Working with Errors in C/C++

  • identify error-handling techniques to promote defensive coding
  • demonstrate how to use exceptions to handle errors
  • create a C/C++ application that incorporates error codes and messages into its error handling
  • recognize how to use error processing and global objects
  • identify how to handle errors locally in C/C++ code
  • recognize how to anticipate potential errors in C/C++ code

Practice: Creating Defensible Code

  • use defensive coding techniques to create clean testable methods

Framework Connections