Year 11 · Computer Science · Summer 2

After the exams · Lesson 4 of 5

Build and show

Project7.1 The program development life cycle7.6 Test data

Year 11 · Computer Science · After the exams · Lesson 4 of 5

You will learn to

  • Test the finished project with normal, extreme and abnormal data.
  • Evaluate the project against your success list.
  • Demonstrate the project to the class and explain one problem you solved.

Year 11 · Computer Science · After the exams · Lesson 4 of 5

Success criteria

You have got it when you can say:

  • I can show a test table with expected and actual results.
  • I can say which lines of my success list are met, and which are not.
  • I can present my project and answer one question about it.

Year 11 · Computer Science · After the exams · Lesson 4 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last unit

    With even parity, the 7 data bits 0110100 need the parity bit…

    A It cannot be worked outB 1C 0

    B. 1

  2. Earlier this year

    NAND is…

    A AND followed by NOTB OR followed by NOTC NOT followed by AND

    A. AND followed by NOT

  3. Last year

    A truth table for 3 inputs has…

    A 3 rowsB 8 rowsC 6 rows

    B. 8 rows

Year 11 · Computer Science · After the exams · Lesson 4 of 5

Key words (1 of 3)

Program development life cycle
The four stages of making a program: analysis, design, coding and testing.
Abstraction
Removing details that do not matter so you can focus on the ones that do.
Decomposition
Breaking a problem into smaller parts that are easier to solve.
Structure diagram
A top-down diagram that shows how a system is split into sub-systems.

Year 11 · Computer Science · After the exams · Lesson 4 of 5

Key words (2 of 3)

Flowchart
A diagram of an algorithm using standard shapes joined by flow lines.
Pseudocode
A structured, code-like way of writing an algorithm that is not tied to one language.
Check digit
An extra digit calculated from the other digits, used to catch typing errors.
Normal data
Test data that should be accepted.

Year 11 · Computer Science · After the exams · Lesson 4 of 5

Key words (3 of 3)

Abnormal data
Test data that should be rejected.
Extreme data
The largest and smallest values that should be accepted.
Boundary data
The largest and smallest accepted values and the nearest rejected values next to them.

7.1 The program development life cycle · The explanation · step 1 of 5 · part 1 of 3

Four stages, in order

The program development life cycle is the set of stages a programmer goes through to make a program.

There are four stages: analysis, design, coding and testing.

It is called a cycle because problems found in testing send you back to an earlier stage.

7.1 The program development life cycle · The explanation · step 1 of 5 · part 2 of 3

Four stages, in order (continued)

StageQuestion it answersWhat is produced
AnalysisWhat must the program do?A list of requirements
DesignHow will it do it?Structure diagrams, flowcharts, pseudocode
CodingCan we build it?Program code, tested as it is written
TestingDoes it work for all data?Test results with test data
?Why?

Planning before coding is faster overall. A mistake fixed in the design costs minutes. The same mistake found after coding can cost hours.

7.1 The program development life cycle · The explanation · step 1 of 5 · part 3 of 3

Four stages, in order (continued)

!Watch out

Learn the four names exactly. Cambridge uses analysis, design, coding, testing. Words like 'planning' or 'making' do not earn the mark.

7.1 The program development life cycle · The explanation · step 2 of 5 · part 1 of 3

Analysis: understand the problem

In analysis you find out exactly what the problem is and what the program must do. These needs are the requirements.

Abstraction means removing the details that do not matter, so you can focus on what does.

Decomposition means breaking a big problem into smaller parts that are easier to solve.

7.1 The program development life cycle · The explanation · step 2 of 5 · part 2 of 3

Analysis: understand the problem (continued)

e.g.Example
Problem: a school canteen wants a top-up system for student cards. Requirements: input the card number and amount, add the amount to the balance, show the new balance. Abstraction: the colour of the card and the student's hair colour do not matter. Keep card number, name and balance. Decomposition: read card → choose amount → take payment → update balance.

7.1 The program development life cycle · The explanation · step 2 of 5 · part 3 of 3

Analysis: understand the problem (continued)

?Why?

Abstraction stops you wasting time on details that will not affect the program. Decomposition turns one scary problem into several small, easy ones.

7.1 The program development life cycle · The explanation · step 3 of 5 · part 1 of 3

Design, coding and testing

In design you plan how the program will work. You decompose further and use structure diagrams, flowcharts and pseudocode.

In coding you write the program. You test each part as you write it. This is called iterative testing: write a bit, test it, fix it, repeat.

In testing you run the finished program with planned test data to check it works for every kind of input.

7.1 The program development life cycle · The explanation · step 3 of 5 · part 2 of 3

Design, coding and testing (continued)

e.g.Example
Canteen system: Design: a flowchart for 'take payment'. Coding: write 'update balance' and test it with one card before writing the next part. Testing: try a top-up of 10 euros (normal), -5 euros (abnormal) and the largest allowed amount (extreme).

7.1 The program development life cycle · The explanation · step 3 of 5 · part 3 of 3

Design, coding and testing (continued)

!Watch out

Do not mix up iterative testing and final testing. Iterative testing happens during coding, part by part. Final testing uses a full test plan on the finished program.

7.6 Test data · The explanation · step 4 of 5 · part 1 of 3

The four types of test data

Normal data: data that should be accepted. It is well inside the range.

Abnormal data: data that should be rejected. It is outside the range or the wrong type.

Extreme data: the largest and smallest values that should be accepted. Boundary data: the largest and smallest accepted values and the nearest values outside the range, which should be rejected.

7.6 Test data · The explanation · step 4 of 5 · part 2 of 3

The four types of test data (continued)

TypeRange 1 to 100Expected result
Normal50, 73Accepted
Abnormal-20, 250, "ten"Rejected with an error message
Extreme1 and 100Accepted
Boundary1 and 0, 100 and 1011 and 100 accepted; 0 and 101 rejected
?Why?

Most errors hide at the edges. A programmer types `<` when they meant `<=`, and only boundary data shows it.

7.6 Test data · The explanation · step 4 of 5 · part 3 of 3

The four types of test data (continued)

!Watch out

Extreme data is always accepted. Boundary data is a pair: the accepted edge value and the rejected value next to it.

There is something to try for this step in the IGCSE library.

The explanation · 1 more step

More on the lesson page

The lesson page has the rest of the explanation, step by step:

  • Worked example: a test plan

Open the lesson page