0984

Problem Solving and Design

Algorithm Design and Problem Solving · 4 question types

Most programming projects follow a standard sequence of stages, sometimes called the program development life cycle.

Analysis

The analysis stage is about understanding the problem clearly before any code is written.

The deliverable is a requirements document that lists:

  • What the program must do (functional requirements: "the program shall calculate average attendance").
  • Any constraints (non-functional requirements: "must run on a school computer", "must complete in under 5 seconds").
  • The success criteria that say when the requirement has been met.

This is where and abstraction are most useful: the programmer breaks the big problem into sub-problems and identifies only the data and behaviour that matter.

Common exam question

Abstraction and decomposition in the analysis stage

Question: Describe what is meant by abstraction, identify the component parts a problem is broken into at the analysis stage, or describe the analysis stage of the program development life cycle (2–3 marks).

Asked in 2 of the 17 papers. For abstraction each separate idea is a mark: simplifying the problem, removing the unnecessary detail (or selecting only the elements that are needed) and filtering out the irrelevant characteristics of those elements. "Simplifying the problem" alone is one mark; say what gets removed or kept for the second.

The component parts of a decomposed problem are inputs, processes, outputs and storage, and any three earn the three marks. Describing the analysis stage is one mark per point, and a task's name and what it does are separate points: abstraction; discarding the irrelevant detail; decomposition; splitting the problem into inputs, processes and outputs; identifying the problem; identifying the solution's requirements; researching it by collecting data; an example of that research.

Design

The design stage produces a blueprint for the solution before any code is written.

Common ways of describing a design:

  • Structure diagrams show how the program is decomposed into modules.
  • Flowcharts show the step-by-step flow of control (topic 19).
  • Pseudocode is a code-like notation that is language-independent (topic 19).
Top-down structure chart: a main module broken down into get-data, process-data and show-results sub-modules
Source: Top-down structure chart by Save My Exams
Common exam question

Methods used to design and present a solution

Question: Identify three different ways the design of a solution can be presented, describe three methods used to design and construct a solution, or tick the one method of construction in a list (1–6 marks).

Asked in 4 of the 17 papers. The three credited methods are always structure diagrams (structure chart is accepted), flowcharts and pseudocode. When a description is wanted, naming each method is one mark and describing it a second: a structure diagram is a hierarchical diagram that breaks the program down into its sub-programs; a flowchart is a diagram of the ordered steps the program takes; pseudocode sets out what the program does in plain language.

In the tick-box versions the other options are not design methods at all (abstraction, test data, a variable, procedures, processes, sub-systems), so the answer is the structure diagram.

Coding

The coding stage turns the design into a working program in a chosen programming language.

Each module is coded according to the design. Programmers run iterative tests as they write: as soon as a module exists, it gets tested; as soon as something fails, it gets debugged before the team moves on.

Testing

The testing stage exercises the finished program with carefully chosen to confirm it meets every requirement.

The whole program is run many times, with different inputs, to find any remaining bugs and confirm the requirements are met. Section 6 covers the test-data categories you should know.

Common exam question

Naming and describing the stages of the life cycle

Question: Identify the first stage, pick three stages out of a list of words, state one other stage, or identify and describe one or two stages other than analysis (1–6 marks).

Asked in 5 of the 17 papers. The stages are analysis, design, coding and testing, and analysis is the first. Only these four are credited: decomposition, pseudocode, input and variable sit in the word list as distractors, and the schemes for the "other stage" questions list just design, coding and testing.

When a stage must be described, its name is one mark and a matching description the second: design sets out the details of the solution, using standard methods such as flowcharts; coding is writing the program, with iterative testing as it is written; testing runs the program to find errors and checks that it meets its requirements. In the six-mark version the third mark for each stage is that second half of the description.

Where the program goes next

After testing, programs are usually released (or deployed) and then enter a maintenance phase, where bugs are fixed and new features added over the program's life. The syllabus stops at testing, but in real life maintenance is often the biggest stage of all.