Skip to content

Software Development

A-Level Computer Science · Topic 12

Train
12.1

Program development life cycle

Syllabus
Candidates should be able to: Notes and guidance
Show understanding of the purpose of a development life cycle
Show understanding of the need for different development life cycles depending on the program being developed Including: waterfall, iterative, rapid application development (RAD)
Describe the principles, benefits and drawbacks of each type of life cycle
Show understanding of the analysis, design, coding, testing and maintenance stages in the program development life cycle

Source: Cambridge International syllabus

A development life cycle 开发生命周期 is the set of stages from idea to finished, maintained software. It exists to plan, manage and control a project — to build the right product, on time, with good quality.

A software team in a stand-up meeting Software is built by teams who follow a development life cycle to stay coordinated

A flowchart with process boxes and decision diamonds A flowchart plans a program's logic during the design stage of the cycle

Why a life cycle is needed

It manages complexity (break a big program into phases), coordinates teams, tracks progress with milestones, builds in testing, records design decisions for later, and manages risk.

Why there are different ones

No single life cycle fits every project, so several development life cycles exist. The choice depends on the size and complexity, how clear the requirements 需求 are at the start, how much change is expected, the risk level, the team, and the deadline.

Common models

  • Waterfall 瀑布模型 — a linear sequence (Analysis → Design → Coding → Testing → Maintenance), each stage finished before the next. Clear and well-documented; good for stable requirements, but poor at coping with mid-project change, and the customer sees nothing working until the end.
  • Iterative model 迭代模型 — repeated passes, each producing a partial version that is reviewed and refined. Catches problems earlier; good when requirements are discovered over time, but harder to estimate.
  • Rapid Application Development 快速应用开发 (RAD) — heavy use of a prototype 原型 and user feedback. Very fast first delivery; good for changing requirements, but depends on user availability and suits smaller systems.
  • Agile 敏捷 — short iterations ("sprints"), constant collaboration and testing. Flexible and adaptive, but needs a committed customer and a skilled team.

Five boxes (Analysis, Design, Coding, Testing, Maintenance) cascading down, each leading to the next The waterfall model: each stage is finished before the next begins

A Design-Build-Test-Review cycle with a repeat loop back to Design, and version bars growing taller each pass until complete The iterative model: repeated passes refine the program

Three parts built in parallel as prototypes that refine with user feedback, then combine into the final system Rapid application development: teams work on parts in parallel

The standard stages

  • analysis — find what the program must do; gather and document requirements.
  • design — decide how: data structures, algorithms, modules, interface, file layouts.
  • coding (implementation 实现**)** — write the source code following the design.
  • testing — run against test data and fix bugs.
  • maintenance 维护 — after release, keep it working and useful.
Explore

The program development life cycle

Step through the stages every project passes through. Getting the requirements right in analysis matters most — a mistake caught in testing is far costlier to fix than one caught early.

Explore

Software process lab

Classify development examples by the stage or tool they belong to.

Vocabulary Train
English Chinese Pinyin
development life cycle 开发生命周期 kāi fā shēng mìng zhōu qī
requirements 需求 xū qiú
waterfall 瀑布模型 pù bù mó xíng
iterative model 迭代模型 dié dài mó xíng
rapid application development 快速应用开发 kuài sù yìng yòng kāi fā
prototype 原型 yuán xíng
agile 敏捷 mǐn jié
implementation 实现 shí xiàn
maintenance 维护 wéi hù
12.2

Program design tools

Syllabus
Candidates should be able to: Notes and guidance
Use a structure chart to decompose a problem into sub-tasks and express the parameters passed between the various modules/procedures/functions which are part of the algorithm design Describe the purpose of a structure chart Construct a structure chart for a given problem Derive equivalent pseudocode from a structure chart
Show understanding of the purpose of state-transition diagrams to document an algorithm

Source: Cambridge International syllabus

Structure chart

A structure chart 结构图 shows the hierarchical decomposition 分解 of a program into modules (subroutines 子程序) and the parameters 参数 passed between them. Each module is a rectangle; lines link caller (above) to callee (below); small arrows show data going down and results coming back up. The design can then be turned into equivalent pseudocode 伪代码.

                CalculatePay
            /        |         \
       GetEmployee  CalculateBonus  CalculateTax
       Returns:     Takes: sales    Takes: gross
       employeeID   Returns: bonus  Returns: tax

It is a design-stage tool, and you can read the procedure signatures off it.

A structure chart with Convert temperature at the top and INPUT, Convert to Celsius and OUTPUT modules below, with temperature parameters on the links A structure chart: modules with the parameters passed between them

State-transition diagram

A state-transition diagram 状态转换图 shows the states 状态 a system can be in and the events that move it between them — good for vending machines, traffic lights, user interfaces. State-transition diagrams are used to document the behaviour of an algorithm or system. Each state is a circle; each transition is an arrow labelled with the event.

   coin inserted               item selected
[Idle] ──────────────→ [Awaiting selection] ──────────→ [Dispensing]

It makes missing transitions easy to spot ("what if a second coin is inserted while awaiting selection?").

A state diagram: Locked to Waiting for second digit to Waiting for third digit to Unlocked, with correct-digit and wrong-digit transitions A state-transition diagram for a door lock with code 259

Explore

Software process lab

Classify development examples by the stage or tool they belong to.

Vocabulary Train
English Chinese Pinyin
structure chart 结构图 jié gòu tú
decomposition 分解 fēn jiě
subroutines 子程序 zi chéng xù
parameters 参数 cān shù
state-transition diagram 状态转换图 zhuàng tài zhuǎn huàn tú
states 状态 zhuàng tài
pseudocode 伪代码 wěi dài mǎ
12.3

Errors

Syllabus
Candidates should be able to: Notes and guidance
Show understanding of ways of exposing and avoiding faults in programs
Locate and identify the different types of errors syntax errorslogic errorsrun-time errors
Correct identified errors
Show understanding of the methods of testing available and select appropriate data for a given method Including dry run, walkthrough, white-box, black-box, integration, alpha, beta, acceptance, stub
Show understanding of the need for a test strategy and test plan and their likely contents
Choose appropriate test data for a test plan Including normal, abnormal and extreme/boundary
Show understanding of the need for continuing maintenance of a system and the differences between each type of maintenance Including perfective, adaptive, corrective
Analyse an existing program and make amendments to enhance functionality

Source: Cambridge International syllabus

  • syntax error 语法错误 — breaks the language's grammar (missing bracket, misspelled keyword). Caught at translation time; the program won't run until fixed.
  • run-time error 运行时错误 — happens while running (divide by zero, file not found, array index out of range). The program crashes or raises an exception; fix by adding checks.
  • logic error 逻辑错误 — the program runs but gives wrong results (using + for -, an off-by-one loop, conditions in the wrong order). The hardest to find; the only sign is wrong output, so use careful testing and tracing.

A pipeline from write code to translate to run to output: a syntax error stops it at translation, a run-time error crashes during the run, and a logic error runs fine but gives the wrong output When each error shows up: syntax at translation, run-time during the run, logic in the output

Vocabulary Train
English Chinese Pinyin
syntax error 语法错误 yǔ fǎ cuò wù
run-time error 运行时错误 yùn xíng shí cuò wù
logic error 逻辑错误 luó jí cuò wù
12.3

Testing methods

  • dry run 手工跟踪 — trace the code on paper, writing each variable's value in a table.
  • walkthrough 走查 — a team review of the code.
  • white-box testing 白盒测试 — designed from the code's internal structure, covering every statement, branch and loop.
  • black-box testing 黑盒测试 — designed from the specification only: feed inputs, check outputs.
  • integration testing 集成测试 — combine modules and test the interfaces between them.
  • alpha testing α测试 — by the developers/in-house before release; beta testing β测试 — by a limited group of real users in their own environment.
  • acceptance testing 验收测试 — by the customer, to decide if the product is fit for purpose.
  • stub — a placeholder for a module that does not exist yet, so the structure can be tested top-down.

Black-box testing works from the specification; white-box tests the code's internal paths Black-box tests the specification; white-box tests the code paths

Vocabulary Train
English Chinese Pinyin
dry run 手工跟踪 shǒu gōng gēn zōng
walkthrough 走查 zǒu chá
white-box testing 白盒测试 bái hé cè shì
black-box testing 黑盒测试 hēi hé cè shì
integration testing 集成测试 jí chéng cè shì
alpha testing α测试 α cè shì
beta testing β测试 β cè shì
acceptance testing 验收测试 yàn shōu cè shì
stub zhuāng
12.3

Test strategy and test plan

A test strategy 测试策略 is the high-level approach — which kinds of testing, who does them, when, and the criteria to move on. A test plan 测试计划 is the detailed list of tests — each with input data, expected output, and a column for the actual output.

Choosing test data

For each field or condition, include three kinds:

  • normal data 正常数据 — typical values inside the valid range (for marks 0–100: 50, 75).
  • abnormal data 异常数据 — values that should be rejected (-10, 200, "abc").
  • extreme data 极端数据 — the largest and smallest values still accepted (0 and 100).
  • boundary data 边界数据 — values at the edges, where off-by-one errors hide (each accepted extreme and the rejected value just outside it: 0/-1, 100/101).

A number line for a mark field 0 to 100: normal values 50 and 75 inside, the extremes 0 and 100 at the accepted boundaries, and abnormal values -1, 101, -10 and 200 rejected outside Test data for a 0–100 field: normal inside, extremes at the boundaries, abnormal outside

Worked example. A field accepts an exam mark from 0 to 100. Give test data of each kind with its expected result. Normal: 50 - accepted, a typical value inside the range. Abnormal: -10, 200, "abc" - all rejected, being out of range or the wrong data type. Extreme: 0 and 100 - the largest and smallest values that are still accepted. Boundary: the pairs straddling each edge - -1 rejected alongside 0 accepted, and 100 accepted alongside 101 rejected. Every value must carry its expected result, or the test plan proves nothing. Extreme and boundary are the pair most often confused: an extreme value sits inside and is accepted, while a boundary test is always a pair either side of the edge - which is exactly where off-by-one errors hide.

Vocabulary Train
English Chinese Pinyin
test strategy 测试策略 cè shì cè lüè
test plan 测试计划 cè shì jì huà
normal data 正常数据 zhèng cháng shù jù
abnormal data 异常数据 yì cháng shù jù
boundary data 边界数据 biān jiè shù jù
extreme data 极端数据 jí duān shù jù
12.3

Maintenance

Most of a program's lifetime cost is in maintenance. Three kinds:

The three kinds of maintenance: perfective, adaptive and corrective Three kinds of maintenance: perfective, adaptive and corrective

  • perfective maintenance 完善性维护 — improving performance or features even though it works (a faster query, a new option).
  • adaptive maintenance 适应性维护 — keeping it working in a changing environment (a new OS, a new API, a legal change).
  • corrective maintenance 纠正性维护 — fixing bugs found in use.

A program may need all three throughout its life.

Vocabulary Train
English Chinese Pinyin
perfective maintenance 完善性维护 wán shàn xìng wéi hù
adaptive maintenance 适应性维护 shì yìng xìng wéi hù
corrective maintenance 纠正性维护 jiū zhèng xìng wéi hù
12.3

Amending an existing program

When asked to add a feature or fix a bug:

  1. read the existing code until you understand the algorithm and data flow.
  2. find where the change goes — which subroutine, which lines.
  3. make the change as small as possible — don't rewrite working code.
  4. update related parts — every caller of a changed parameter list, every routine using a changed data structure.
  5. test the new behaviour and the old (regression testing 回归测试 — check you broke nothing).
  6. document the change.

Clear comments, meaningful names, decomposed subroutines and a structure chart make a program much easier to amend — which is why the design tools matter even after the first release.

Vocabulary Train
English Chinese Pinyin
regression testing 回归测试 huí guī cè shì
12.3

Exam tips

  • Compare development models (waterfall, iterative, RAD) and know the stages of the program development life cycle.
  • Distinguish syntax, logic and run-time errors and how each is found.
  • Choose test data of three kinds — normal, boundary and erroneous — and give an example of each for the stated range.
  • Distinguish the types of maintenance (corrective, adaptive, perfective).

Log in or create account

IGCSE & A-Level