Ch 1 · 12 Software Development · AS & A Level Computer Science 9618
Topic 1 of 1 in Software Development — AS & A Level Computer Science 9618 — 89 lessons.
Introduction
Large programs are built by teams over months, so they need a planned process. This lesson covers the program development life cycle and three models of it, structure charts and state-transition diagrams for design, types of error, testing methods and test data, and maintenance. (Syllabus topic 12: sections 12.1–12.3.)
Key ideas — 12.1 (a) The program development life cycle
A development life cycle is a structured sequence of stages for producing software. Its purpose is to make sure the software meets the user's requirements, is delivered on time and to budget, and can be managed and maintained.
🧑🏫 Teacher's explanation
Think of building a software system like building a house. You wouldn't just start laying bricks (coding) without first checking if the client wants a kitchen or a garage (analysis), drawing up blueprints (design), and checking if the plumbing works before you put up the walls (testing). If you skip the blueprints, you might find the stairs lead into a ceiling, which is a nightmare to fix later.
📖 Definitions
🔍 Worked example — Easy
Identify which stage of the life cycle is being described: 'A developer is creating a flowchart and defining the data structures to be used in the program.'
🔍 Worked example — Standard
A software company releases a new version of a banking app because the government changed the tax laws, requiring the software to calculate interest differently. Identify the type of maintenance.
🔍 Worked example — Exam-style
A developer is using a 'Waterfall' life cycle. They have finished the Analysis and Design stages. What is the next logical stage in the sequence?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Identify the stage of the development life cycle where the new tax rules would be investigated. [1] (b) Identify the type of maintenance required to update the system for these new tax rules. [1] [2 marks]
Key ideas — 12.1 (b) Life cycle models
Different programs need different life cycles: a safety-critical system with fixed requirements suits one approach; a website whose users keep changing their minds suits another.
🧑🏫 Teacher's explanation
Imagine you are building a house. If you use the Waterfall method, you follow a strict blueprint: you lay the foundation, then the walls, then the roof. You cannot decide to add a basement once the roof is on without tearing the whole thing down. This is great for a skyscraper where requirements are fixed and safety is paramount.
📖 Definitions
🔍 Worked example — Easy
A company is building a flight control system for a new commercial jet. The requirements for engine thrust calculations are mathematically proven and must not change during development. Which life cycle is most appropriate?
🔍 Worked example — Standard
A startup wants to build a new social media app. They want to release a 'Minimum Viable Product' (MVP) to a small group of users to see which features are popular before spending their entire budget. Which model should they use?
🔍 Worked example — Exam-style
Compare Waterfall and RAD in terms of 'User Involvement'.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Identify the most suitable software development life cycle for this project. [1] (b) Justify your answer by explaining one benefit and one drawback of this model in the context of this project. [3] [4 marks]
Key ideas — 12.2 (a) Structure charts
A structure chart shows how a problem is decomposed into modules, in a hierarchy, and the parameters passed between them.
🧑🏫 Teacher's explanation
Imagine you are organizing a massive music festival. You can't just say "run the festival"; that's too big. You break it down into smaller, manageable tasks: "Book Artists," "Set up Stage," and "Sell Tickets." Each of these tasks is a 'module.' Now, these tasks need to talk to each other. The "Book Artists" task needs to tell the "Set up Stage" task how many people are coming so they know how big the stage should be. This information being passed between tasks is exactly what a structure chart does.
📖 Definitions
🔍 Worked example — Easy
A structure chart shows a main module 'CalculateTotal' calling a sub-module 'ApplyDiscount'. 'CalculateTotal' passes 'SubTotal' (an INTEGER) down to 'ApplyDiscount'. 'ApplyDiscount' returns 'FinalPrice' (a REAL) back to 'CalculateTotal'. Derive the pseudocode for the main module 'CalculateTotal'.
🔍 Worked example — Standard
A structure chart shows a module 'ProcessOrder' calling 'CheckStock'. 'CheckStock' passes a flag (Boolean) back to 'ProcessOrder'. If the flag is TRUE, 'ProcessOrder' calls 'UpdateInventory'. Derive the pseudocode for 'ProcessOrder'.
🔍 Worked example — Exam-style
A structure chart shows 'Main' calling 'GetData' (returns INTEGER) and then 'ProcessData' (takes INTEGER, returns INTEGER). 'ProcessData' is inside an iteration loop (curved arrow) that runs 5 times. Derive the pseudocode for 'Main'.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Draw/Describe the structure chart hierarchy. (b) Derive the pseudocode for the 'GradeSystem' module, assuming the system only calls 'PrintResult' if 'CheckPass' returns TRUE. [4 marks]
Key ideas — 12.2 (b) State-transition diagrams
A state-transition diagram documents an algorithm (or system) that can be in one of a number of states, and shows how events (inputs) cause transitions between them.
🧑🏫 Teacher's explanation
Imagine you are playing a video game where your character can be in different modes: 'Walking', 'Jumping', or 'Falling'. You cannot go directly from 'Walking' to 'Falling' without first being in the 'Jumping' state. A state-transition diagram is a map of these modes and the specific triggers that move you from one to another.
📖 Definitions
🔍 Worked example — Easy
A simple light switch has two states: 'OFF' and 'ON'. Identify the transitions needed to complete the diagram.
🔍 Worked example — Standard
A digital thermostat has three states: 'Heating', 'Idle', and 'Cooling'. The system starts in 'Idle'. If the temperature is too low, it transitions to 'Heating'. If the temperature is too high, it transitions to 'Cooling'. If the temperature is optimal, it stays in 'Idle'. Draw the logic for the transitions.
🔍 Worked example — Exam-style
A security keypad requires a 2-digit code: '1' then '2'. The system starts in state 'START'. If '1' is pressed, it moves to 'GOT1'. If '2' is pressed while in 'GOT1', it moves to 'UNLOCKED' (final state). If any other key is pressed at any time, it returns to 'START'. Represent the transitions for the input '1' → '3'.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Describe the transitions required to move from 'LOCKED' to 'UNLOCKED' and identify the state the system enters if the user enters '1' then '5'. [3 marks]
Key ideas — 12.3 (a) Types of error
Errors are found by the translator (syntax), by testing with known results and dry runs (logic), and by testing with unusual data (run-time). Correcting an error means identifying the faulty line and rewriting it.
🧑🏫 Teacher's explanation
Imagine you are following a recipe to bake a cake. A syntax error is like the recipe saying "Add 2 eggs and then the oven is blue"—the instruction makes no sense in the English language, so you can't even begin cooking. A logic error is when the recipe is perfectly readable, but it tells you to add 2 cups of salt instead of 2 cups of sugar; you follow the instructions perfectly, but the cake tastes terrible. A run-time error is when you are halfway through baking and suddenly the oven explodes or you realize you have no flour left; the process was going fine until a specific event caused it to stop abruptly.
📖 Definitions
🔍 Worked example — Easy
Identify the error type in the following pseudocode snippet:
🔍 Worked example — Standard
A programmer writes the following code to calculate the average of three numbers: a, b, c.
🔍 Worked example — Exam-style
A program contains an array DATA[1:10] and the following code:
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
The programmer realizes that if the user enters a negative value for the radius, the program still calculates an area, but a negative radius is physically impossible.
Key ideas — 12.3 (b) Testing methods
🧑🏫 Teacher's explanation
Imagine you are building a complex LEGO castle. Before you show it to your friends, you might check if the individual towers are sturdy (this is like testing modules). Then, you snap the towers onto the base to make sure they fit (this is integration testing). You might even use a cardboard block as a temporary placeholder for a tower you haven't built yet (this is a stub).
📖 Definitions
🔍 Worked example — Easy
A programmer is performing a dry run of the following pseudocode using a trace table.
🔍 Worked example — Standard
A developer is using black-box testing for a function calculateTax(income: REAL). The specification states: If income is ≤ 10000, tax is 0. If income is > 10000, tax is income × 0.2.
🔍 Worked example — Exam-style
A system consists of three modules: Main, InputData, and ProcessData. Main calls InputData, which returns a value to Main. Main then passes that value to ProcessData.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) The developers have completed the 'Login' module and the 'Check Balance' module. They now want to ensure that the 'Check Balance' module correctly receives the user ID passed from the 'Login' module. Identify the type of testing being performed. [1]
Key ideas — 12.3 (c) Test strategy, test plan and test data
Test data types, for a field that must be an integer from 1 to 100:
🧑🏫 Teacher's explanation
Imagine you are building a high-tech coffee machine. Before you sell it, you need a plan to ensure it doesn't explode or serve cold coffee. A test strategy is your high-level manual: it says, "We will test the heating element using water, and we will let a professional chef try it (Alpha testing) before we give it to a local cafe (Beta testing)."
📖 Definitions
🔍 Worked example — Easy
A program accepts an integer for 'Age' where the valid range is 0 ≤ Age ≤ 120. Identify one piece of Normal data and one piece of Abnormal data.
🔍 Worked example — Standard
A field accepts a score from 0 to 100 inclusive. List the Extreme data and the Boundary data.
🔍 Worked example — Exam-style
A system accepts a temperature in Celsius between -50 and 50. Complete the following test plan row: Test Data: -51, Purpose: Test error handling, Expected Result: [?], Actual Result: [?].
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Complete the test plan table for the following test cases:
Key ideas — 12.3 (d) Maintenance
Programs need continuing maintenance because errors are found after release, the environment changes, and users want improvements.
🧑🏫 Teacher's explanation
Think of software like a smartphone operating system. When you first get it, it works fine. But eventually, you notice a small bug that crashes an app (that's a fix needed), the phone needs to work with a new type of Bluetooth version (that's an adaptation), and you wish it had a 'Dark Mode' to save battery (that's an improvement).
📖 Definitions
🔍 Worked example — Easy
A banking application calculates interest using a rate of 0.05. A new government regulation changes the interest rate to 0.055. Identify the type of maintenance required.
🔍 Worked example — Standard
A developer notices that a sorting algorithm takes O(n^2) time. They rewrite it to use a more efficient O(n log n) algorithm to make the software faster for the user. Identify the maintenance type.
🔍 Worked example — Exam-style
A programmer is tasked with updating a payroll system. The task involves:
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) The company identifies that the system crashes when processing more than 10,000 transactions at once. Identify the type of maintenance required to fix this. [1] (b) The government changes the tax rate from 20% to 21%. The company must update the software to reflect this. Identify the type of maintenance required. [1] (c) Users request a new feature that allows them to view their spending in a pie chart. Identify the type of maintenance required. [1] [3 marks]
Worked example
A function CalcGrade has not been written yet, but the main program that calls it must be tested. Explain how a stub would be used, and state the types of test data for a mark field of 0–100.
🔍 Worked example — Easy
A programmer is developing a module CalculateTax. The main program calls CalculateTax(amount). The actual tax logic is not yet written. Describe the stub and the test data for amount where the valid range is 0 ≤ amount ≤ 1000.
🔍 Worked example — Standard
Identify the error type: A program is designed to calculate the average of 5 numbers. The code uses total / 4 instead of total / 5. What type of error is this, and what test data would reveal it?
🔍 Worked example — Exam-style
A system accepts ages from 0 to 120. Provide one normal, one abnormal, and one extreme/boundary test data point.
⚠️ Common errors
Common mistakes
Practice
Answers: (1) Each stage is completed in order before the next starts, and each stage's output feeds the next; drawback e.g. the user sees the program only at the end / changes are difficult. (2) Prototypes are produced quickly and refined with constant feedback, so the client can see and change the app as their requirements become clear. (3) To show the decomposition of a problem into modules in a hierarchy, and the parameters passed between the modules. (4) (a) syntax; (b) logic; (c) run-time. (5) White-box tests the paths through the code using knowledge of the code; black-box tests inputs against expected outputs without looking at the code. (6) 10 and 11; 18 and 19. (7) e.g. changing the program to work on a new operating system, or to use a new tax rate set by law.