Why do I need to learn about design, documentation, and testing?
Learning how to write a program to solve the requirements is just a part of being a good software developer. Unfortunately, in a course like this one, your work usually ends after you implement a working version of a program and submit it for grading, so you don’t get the complete experience. However, in real life, programs would then go to production (i.e., would start being used by real users) and the maintenance phase would begin. For the rest of the life of a program, it would receive updates to correct problems or add/modify features.
Many studies have been conducted over the years, which have shown that the cost of maintaining software is usually 60-80% of the total cost of the software. (See this page for an example.) This means that over the whole life of any software, the company that builds it will probably spend around 20-40% of the total cost of the software to create the first version, and 60-80% of the cost will go towards modifying the program after it starts being used.
Therefore, it is important to design and write the software in a way that will facilitate its maintenance in the future. If the software is properly constructed, the maintenance costs over time will be reduced. To accomplish this, we have to answer questions such as:
How do we ensure that the programmers who will need to modify the code in the future understand how it works?
How do we make it easier to modify a part of the program without breaking it?
How do we make it easier to modify a part of the program without having to rewrite the whole program from scratch?
When we modify a program, how do we ensure that we didn’t introduce new bugs into parts of the program that were working before?
There are many answers to the questions above. However, there are three simple guidelines that, if followed when creating the initial version of the software, will greatly help solve all these issues. They are:
Documentation that helps programmers understand what the code does and how it works.
Design that separates the different parts of the program into modules and reduces the dependencies between them, so that it’s possible to modify a part with minimal impact on the others.
Test plans and automated test scripts that help verify if the program is working after each modification.
Therefore, we will teach you how to follow these guidelines throughout this course so you can develop good programming habits that will help you write code that is easy to maintain. You should already have learned how to write good documentation in your previous courses and we will ask you to continue doing so (check the Coding Guidelines for details). We will teach you good object-oriented design practices and design patterns that will help you design programs that are easy to implement and maintain. And we will teach you about automated tests and will ask you to create them for your assignments.
This will all help you practice the skills and habits of a great software developer, that not only knows how to solve the requirements, but also knows how to write code with great quality that is easy to understand and maintain.