Applying the program development life cycle to a scenario

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Applying the program development life cycle to a scenario

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A school wants a program to record quiz marks out of 20. Students list the inputs, processes and outputs, and ignore details like the font on screen. Which stage and method is this?
A Testing, using boundary test data
B Analysis, using abstraction and requirements
2. A developer draws a hierarchy chart to split a library system into smaller sub-problems, then writes a flowchart for one of them. Which stage is this?
A Coding
B Design
3. Which choice describes the coding stage with iterative testing?
A Write the program in small parts and test each part as you go
B Write the whole program first and only test it at the very end
4. A program accepts a mark from 0 to 100. In the testing stage, which set contains normal, extreme and abnormal data?
A 55 (normal), 0 (extreme), -5 (abnormal)
B 55 (abnormal), 0 (normal), -5 (extreme)
5. A range check accepts ages 11 to 16. Which values are the boundary test data for this check?
A 10, 11, 16 and 17
B 11, 13 and 16 only

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Analysis: abstraction, decomposition, requirements AOnly normal data is used, so abnormal, extreme and boundary data are missing, such as -5, 0, 100 and 101
2Testing: normal, abnormal, extreme, boundary data BDecide what the problem is, ignore unneeded detail, split it into sub-problems and list the inputs, processes, outputs and storage needed
3Design stage: show the solution as a plan, and plan validation and verification for input CRun the finished program with different types of test data and compare actual results with expected results
4Coding stage: write the program from the design and test each part as you go DThe stages are in the wrong order: requirements belong to analysis, which comes before design
5A student writes pseudocode first, then lists the requirements of the program EWrite a loop, then run it and fix errors before adding the next part
6Testing a mark range of 0 to 100 using only the test data 50, 60 and 75 FFlowchart or pseudocode with a range check and double entry check

Definitions

PDLC

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
// ________ stage: abstraction, requirements
2.
REPEAT INPUT Age UNTIL Age >= 1 AND Age __ 100
3.
// Boundary data for 1 to 100: 0, 1, 100, ___
4.
// Test data of ________ type: -5, abc
5.
INPUT Age INPUT AgeCheck IF Age __ AgeCheck THEN

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A INPUT Mark
B WHILE Mark > 0 AND Mark < 100
C INPUT Mark
D ENDWHILE
Question 2
A 1 Analysis: draw a flowchart
B 2 Design: draw a flowchart
C 3 Coding: write the program
D 4 Testing: use test data
Question 3
A Range check: age 11 to 16
B Normal: 14
C Abnormal: 12
D Extreme: 11 and 16
Question 4
A Code the INPUT section
B Skip testing until the end
C Code the calculation
D Test it again
Question 5
A Abstraction: add every detail
B Bus app: keep stops and times
C Bus app: ignore bus colour

Answer Key

Applying the program development life cycle to a scenario
Section A: Quick Questions
Q1
B — Analysis, using abstraction and requirements
Q2
B — Design
Q3
A — Write the program in small parts and test each part as you go
Q4
A — 55 (normal), 0 (extreme), -5 (abnormal)
Q5
A — 10, 11, 16 and 17
Section B: Match the Pairs
Q1
Analysis: abstraction, decomposition, requirements → Decide what the problem is, ignore unneeded detail, split it into sub-problems and list the inputs, processes, outputs and storage needed
Q2
Testing: normal, abnormal, extreme, boundary data → Run the finished program with different types of test data and compare actual results with expected results
Q3
Design stage: show the solution as a plan, and plan validation and verification for input → Flowchart or pseudocode with a range check and double entry check
Q4
Coding stage: write the program from the design and test each part as you go → Write a loop, then run it and fix errors before adding the next part
Q5
A student writes pseudocode first, then lists the requirements of the program → The stages are in the wrong order: requirements belong to analysis, which comes before design
Q6
Testing a mark range of 0 to 100 using only the test data 50, 60 and 75 → Only normal data is used, so abnormal, extreme and boundary data are missing, such as -5, 0, 100 and 101
Section C: Definitions
Q1
PDLC — Program development life cycle: analysis, design, coding, testing. Apply it to a scenario by saying what is done at each stage and which methods and test data are used.
Section D: Fill in the Blanks
Q1
// Analysis stage: abstraction, requirements
Q2
REPEAT INPUT Age UNTIL Age >= 1 AND Age <= 100
Q3
// Boundary data for 1 to 100: 0, 1, 100, 101
Q4
// Test data of abnormal type: -5, abc
Q5
INPUT Age INPUT AgeCheck IF Age <> AgeCheck THEN
Section E: Spot the Error
Q1
B — The design must re-ask while the mark is INVALID. Invalid means below 0 OR above 100. The broken line loops for valid marks. It should be WHILE Mark < 0 OR Mark > 100.
Q2
A — Analysis is where you find the requirements, using abstraction and decomposition. A flowchart is a design method, so it belongs in stage 2.
Q3
C — Abnormal data must be rejected by the range check. 12 is inside 11 to 16, so it is normal data. A correct abnormal value is -5.
Q4
B — Coding uses iterative testing. You test each section as you write it, not only at the end. Line 2 should be to test the section with test data.
Q5
A — Abstraction in analysis means keeping only the details needed and removing unnecessary ones. It does not mean adding every detail.