Programs must run correctly or they are of little value. The careful planning and testing of a program is essential, as is writing maintainable code which assists future updating.
Before starting to write code to solve a problem, the use of computational thinking techniques can be used to prepare - by analysing, understanding and solving the problem that is presented. It becomes easier to understand and resolve the problem through the process of decomposition and by breaking it down into smaller parts.
Example
If a user is coding a revision quiz, they would start by breaking down the task into smaller steps such as knowing:
how many questions there are
what score will be given to the questions
how to keep track of the score, timings and timeouts
how to display the results
how many attempts are available to the user.
Abstraction
Another technique that can be applied is abstraction, which involves concentrating only on the information required to solve the problem. Abstraction involves ignoring the details that aren’t important in coding the solution, such as the colours of the buttons. Instead, the focus is on the logical flow through the quiz.