Cambridge AS & A Level9608

Software development (2.4)

Computer Science 9608 Chapter Notes

What this chapter covers

Software development
ShareWhatsAppPost
Software development (2.4) notes

Unable to load PDF

The notes viewer could not load. Please refresh the page.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Software development (2.4) notes as text: skim, search, and jump between subtopics.

~16 min read

1. Aids to Development: Libraries & Generators

Modern software development rarely starts from scratch. Developers use tools to speed up the process and improve quality. Two key aids are program libraries and program generators. A Program Library is a collection of pre-written, pre-tested code modules that can be 'called' by another program to perform common tasks. For example, instead of writing code to calculate a square root, a developer can use a function from a math library. A Program Generator is a tool that automatically writes source code based on a specification or model. They are often used to create 'boilerplate' code, such as the basic structure of a file, or to generate complex user interfaces by allowing a developer to drag and drop components.

Key term

Program Library: A collection of pre-compiled and tested code routines that a program can use to perform common tasks.

Examiner insight

Examiners expect you to clearly differentiate between using a library (reusing existing code modules) and using a generator (creating new source code automatically).

Fun fact

The Python Standard Library contains over 200 modules for tasks ranging from mathematics to handling internet protocols, saving developers countless hours of work.

Worked example 14 marks

A developer is creating a new graphics editing application. Explain two benefits of using a program library for handling file formats like JPEG and PNG.

  1. 1

    Benefit 1: Reduced Development Time. The developer does not need to write the highly complex code required to parse, compress, and render JPEG/PNG files from scratch. They can simply call functions from a pre-existing graphics library, which significantly speeds up the project timeline.

  2. 2

    Benefit 2: Increased Reliability. Established graphics libraries have been used and tested by thousands of developers and users. This means they are likely to be more robust and have fewer bugs than brand new code written by a single developer, preventing issues like file corruption or incorrect image rendering.

Recap

  • Program libraries are collections of pre-written, tested code for common tasks.
  • Using libraries saves development time, reduces costs, and increases program reliability.
  • Program generators are tools that automatically create source code from a high-level specification.
  • Generators are useful for creating repetitive code structures or graphical user interfaces (GUIs).
  • Both libraries and generators leverage existing work to make development more efficient.

Quick check

  1. State one reason why using a library function for a complex mathematical calculation is better than writing your own.1 mark

2. The Nature of Errors and Testing

Software errors, often called 'bugs' or 'faults', are an unavoidable part of creating complex software. They can be introduced at any stage: a misunderstanding of the client's needs (requirements analysis), a flaw in the overall structure (design), or a simple typo in the code (coding). The purpose of testing is not to prove that a program is 100% correct, which is practically impossible for complex systems. Instead, testing is a planned process of executing a program with the specific intention of finding errors. To be effective, testing must occur throughout the entire software development lifecycle. Finding and fixing a bug during the early design stage is significantly cheaper and easier than finding it in a finished product that has already been delivered to users.

Key term

Software Bug: An error, flaw or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

Examiner insight

Marks are awarded for explaining *why* testing throughout the lifecycle is important, particularly by referencing the exponential increase in the cost of fixing errors found in later stages.

Fun fact

The first recorded computer 'bug' was a real moth found in 1947, trapped in a relay of the Harvard Mark II computer, causing it to malfunction. The term has been used for errors ever since.

Worked example 13 marks

Explain why it is a mistake to leave all testing until the coding phase is complete.

  1. 1

    Increased Cost: An error found late in the development cycle is significantly more expensive to fix. For example, a design flaw found after coding may require re-designing and re-coding large parts of the system, wasting time and money.

  2. 2

    Cascading Errors: An early error in the requirements or design can lead to multiple related errors in the code that builds upon it. Finding the single root cause late in the process is difficult, complex, and time-consuming.

  3. 3

    Project Delays: Discovering a large number of fundamental errors at the end of the project can cause major, unforeseen delays to the schedule as developers scramble to fix them, impacting the release date and potentially breaching contracts.

Recap

  • Errors can be introduced at any stage of development, including requirements, design, and coding.
  • The purpose of testing is to find errors, not to prove a program is error-free.
  • Testing should be a continuous activity throughout the entire software development process.
  • The earlier an error is found, the cheaper and easier it is to fix.
  • A program's reliability is increased by a thorough and well-planned testing strategy.

Quick check

  1. Name two stages of the software development lifecycle where errors can be introduced.2 marks

3. Testing Methodologies

Testers use several methodologies to find faults. A Dry Run is a mental or on-paper trace of an algorithm's logic, performed by the programmer to spot flaws before coding. A Walkthrough is a more formal peer-review process where a developer presents their code or design to colleagues, who ask questions and suggest improvements. White-box testing requires knowledge of the program's internal code and structure. Test cases are designed to exercise specific paths, loops, and conditions within the code. Black-box testing is the opposite; the tester has no knowledge of the internal workings and tests the software based purely on its requirements specification, checking if the correct outputs are produced for given inputs. Integration testing focuses on verifying that different modules or components of the software work together correctly when they are combined.

Key term

Black-box Testing: A testing method where the functionality of an application is tested without knowledge of its internal code structure, implementation details, or internal paths.

Common pitfall

Confusing white-box and black-box testing. Remember: white-box sees inside the 'box' (the code), while black-box only sees the outside (the user interface or inputs/outputs).

Worked example 12 marks

A team is developing an e-commerce website with a shopping cart module and a separate payment processing module.(a) What type of testing focuses on just the inputs and outputs of the shopping cart (e.g., adding an item, checking the total) without looking at the code?(b) What type of testing would be used to ensure the shopping cart correctly passes the final total to the payment module?

  1. 1

    (a) Black-box testing. This method involves testing the functionality by providing inputs (e.g., clicking 'Add to Cart') and checking the outputs (e.g., the cart total updates) against the requirements, without needing to see the underlying code.

  2. 2

    (b) Integration testing. This method is used to test the interface and data transfer between the shopping cart module and the payment processing module to ensure they function correctly as a combined unit.

Recap

  • A dry run is a manual check of an algorithm's logic, often using a trace table.
  • A walkthrough is a formal peer-review of code or design documents to find errors.
  • White-box testing examines the internal code structure and logic paths.
  • Black-box testing focuses only on inputs and expected outputs based on the software's specification.
  • Integration testing checks that different software modules work together correctly after being combined.

Quick check

  1. Which testing method, white-box or black-box, would be used to ensure every line of code in a specific function has been executed at least once?1 mark

4. Levels of Testing: Alpha, Beta, Acceptance

As software nears completion, it goes through distinct levels of testing. Alpha testing is the first full-scale test of the near-complete software. It is performed in-house by the organisation's own employees, usually the Quality Assurance (QA) team, in a controlled lab environment. The goal is to find as many bugs as possible before any external users see the product. After successful Alpha testing, the software moves to Beta testing. Here, a pre-release version is distributed to a limited number of external users—real people who are not employees—to use in their own real-world environments. This is invaluable for finding bugs related to different hardware configurations, network speeds, and unexpected user behaviours. Finally, Acceptance testing is performed by the client or end-user. Its purpose is to verify that the software meets all the business requirements agreed upon in the contract, before the client 'accepts' the final product and makes the final payment.

Key term

Beta Testing: A level of testing where a pre-release version of software is given to a limited number of external end-users to test in a real-world environment.

Examiner insight

Students score well when they can clearly distinguish the 'who' and 'where' for each testing level: Alpha is internal staff in a lab; Beta is external users in the real world; Acceptance is the client verifying requirements.

Worked example 13 marks

A software company has just finished internal testing for its new video game. Before the official launch, they want to get feedback from actual gamers.(a) What is the name of this next testing phase?(b) State two reasons why this phase is important.

  1. 1

    (a) The next phase is Beta testing.

  2. 2

    (b) Reason 1: It allows testing on a wide variety of real-world hardware configurations (different GPUs, CPUs, operating systems) that the company cannot possibly replicate in its internal labs. This helps find critical compatibility bugs.

  3. 3

    (b) Reason 2: It provides feedback on usability, performance, and enjoyment from the actual target audience. Real users may use the software in unexpected ways, revealing bugs or design flaws that trained internal testers might miss.

Recap

  • Alpha testing is performed by internal staff in a controlled, lab-like environment.
  • Beta testing involves releasing the software to a limited group of external, real-world users.
  • Beta testing is crucial for finding bugs related to diverse hardware and real user behaviour.
  • Acceptance testing is the final verification by the client that the software meets all agreed-upon requirements.
  • These testing levels proceed sequentially: Alpha -> Beta -> Acceptance.

Quick check

  1. Who typically performs acceptance testing?1 mark

5. Test Planning and Data Selection

Effective testing is not random; it is a carefully planned activity. A Test Plan is a formal document that outlines the entire testing strategy, including the scope (what will be tested), schedule, resources, and success criteria. A critical part of any test plan is the selection of test data. For a given input, we can select three types of data: Normal data is sensible, valid data that the program is expected to accept and process correctly. Abnormal data (or invalid data) is data that the program should not accept, such as the wrong data type (e.g., text where a number is expected) or a value outside the allowed range. The program should handle this gracefully with an error message, not crash. Extreme/Boundary data is data at the very limits of the valid range. For example, if a valid range is 1-100, the boundary data would be 1 and 100. It is also vital to test the values just outside the boundary (e.g., 0 and 101), as this is where 'off-by-one' logic errors frequently occur.

Key term

Test Plan: A document detailing the objectives, scope, approach, and focus of a software testing effort.

Common pitfall

Forgetting to test both boundaries. If a range is 1 to 8, students often test 8 but forget to test 1. It is also a common mistake to forget testing the invalid data just outside the boundaries (e.g., 0 and 9).

Worked example 13 marks

A program asks a user to enter a ticket quantity. The allowed quantity is an integer between 1 and 8, inclusive. Provide one example for each of the following types of test data: normal, abnormal, and boundary.

  1. 1

    Normal data: 5. This is a valid integer that lies comfortably within the accepted range of 1 to 8.

  2. 2

    Abnormal data: 'cat' (or 9, or 0, or -2). This is data of the wrong type or outside the valid range that the program should reject.

  3. 3

    Boundary data: 1 (or 8). This is a valid value at the very edge of the accepted range. Testing these edge cases is crucial.

Recap

  • A test plan is a formal document that guides the entire testing process.
  • Normal test data is valid data that falls within the expected range.
  • Abnormal test data is invalid and should be gracefully rejected by the program.
  • Boundary test data is data at the very limits of the valid ranges (e.g., min and max values).
  • Testing boundary values and the values just outside them is critical for finding common logic errors.

Quick check

  1. For a program accepting ages from 18 to 65 inclusive, list two boundary values that should be tested.2 marks

6. Project Planning with Gantt Charts

A Gantt chart is a visual project management tool used to illustrate a project schedule over time. It is a type of bar chart where each bar represents a task. The position and length of the bar indicate the start date, end date, and duration of the task. Key features include: a list of tasks on the vertical axis, a time scale on the horizontal axis, and task bars that show timings. Gantt charts are excellent for showing the overall timeline of a project at a glance. They can also display task dependencies, often shown with arrows connecting the bars, which indicate that one task must be completed before another can begin. Milestones, which are significant deadlines or events, are typically marked with a diamond symbol. The chart can also be updated to show progress, for instance by shading the part of a task bar that has been completed.

Key term

Gantt Chart: A visual project management tool that uses horizontal bars to illustrate a project's schedule, showing the start and finish dates of individual tasks.

Common pitfall

Misinterpreting dependencies. When two parallel tasks must be completed before a third can start, the third task can only begin after the *longer* of the two parallel tasks is finished.

Worked example 13 marks

A project has the following tasks and dependencies: Task A (Design UI, 5 days), Task B (Develop Database, 7 days, can start after Task A), Task C (Code UI, 4 days, can start after Task A), Task D (Integrate & Test, 3 days, can start after B and C are complete). What is the minimum number of days to complete the project?

  1. 1

    Task A takes 5 days.

  2. 2

    After Task A is done, Tasks B and C can start in parallel.

  3. 3

    Path 1: Task A -> Task B. This takes 5 + 7 = 12 days.

  4. 4

    Path 2: Task A -> Task C. This takes 5 + 4 = 9 days.

  5. 5

    Task D cannot start until both B and C are complete. The longest path determines the start time for D, which is after 12 days (when B finishes).

  6. 6

    The total project duration is the time to complete A, B, and then D.

  7. 7

    Total time = Duration(A) + Duration(B) + Duration(D) = 5 + 7 + 3 = 15 days. The project will take a minimum of 15 days.

Recap

  • Gantt charts are bar charts used for project scheduling and tracking.
  • They visually represent tasks, their durations, and their place in the project timeline.
  • Dependencies between tasks can be shown, indicating the required sequence of work.
  • Gantt charts provide a clear, high-level overview of project progress against the schedule.
  • Milestones are used to mark important dates or deliverables.

Quick check

  1. On a Gantt chart, what does the length of a horizontal bar represent?1 mark

7. Project Planning with PERT Charts

A PERT (Program Evaluation and Review Technique) chart, also called a network diagram, is another project planning tool that focuses on tasks and their dependencies. Unlike a Gantt chart, it does not have a time scale. Instead, it uses a graph to represent the project's workflow. Nodes (circles) represent events or milestones (the start or finish of a task), and are numbered for reference. Arcs (arrows) represent the actual tasks, with the task name and its duration written on the arrow. The key strength of a PERT chart is its ability to identify the Critical Path. This is the sequence of tasks that has the longest total duration from the start of the project to the end. The length of the critical path determines the shortest possible time in which the entire project can be completed. Any delay to a task on the critical path will directly delay the project's completion date.

Critical Path = The sequence of tasks that determines the minimum time for project completion.

Key term

Critical Path: The sequence of stages in a project which has the longest total duration, thereby determining the shortest possible time for project completion.

Examiner insight

Marks are often awarded for correctly identifying all possible paths through a PERT chart, calculating their durations, and then clearly stating which one is the critical path and why.

Worked example 14 marks

A project is represented by a PERT chart. Path 1 (A->B->E) takes 15 days. Path 2 (A->C->E) takes 12 days. Path 3 (A->D->F) takes 14 days.(a) Identify the critical path.(b) What is the minimum project completion time?(c) What is the effect of a 2-day delay on task C?

  1. 1

    (a) The critical path is the longest path through the network. Comparing the durations (15, 12, 14 days), the longest is 15 days. Therefore, the critical path is A->B->E.

  2. 2

    (b) The minimum project completion time is equal to the duration of the critical path, which is 15 days.

  3. 3

    (c) Task C is on Path 2, which takes 12 days. The project's completion time is 15 days. Path 2 has a 'float' or 'slack' of 15 - 12 = 3 days. A 2-day delay on task C will increase Path 2's duration to 14 days, which is still less than the critical path's 15 days. Therefore, there is no effect on the overall project completion time.

Recap

  • PERT charts are network diagrams that show task dependencies.
  • Nodes represent events/milestones, and arcs represent tasks and their durations.
  • The critical path is the longest path of tasks through the chart.
  • The duration of the critical path is the minimum time required to complete the project.
  • Tasks not on the critical path have 'float' or 'slack', meaning they can be delayed slightly without affecting the project deadline.

Quick check

  1. What happens to the overall project completion time if a task on the critical path is delayed by one day?1 mark

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. Define black-box testing and state one advantage of this method.2 marks
  2. State two distinct pieces of information that are shown on a Gantt chart.2 marks
  3. Explain the difference between alpha testing and beta testing. Your answer must state who performs each type of testing and where it is performed.4 marks
  4. A program requires a user to input an age, which must be an integer from 18 to 65, inclusive. Create a test plan by providing one normal, one abnormal, and two boundary test data values. Justify each choice.4 marks
  5. Describe the role of a program library in software development and give one clear advantage of using one.3 marks
  6. A project manager is deciding between using a Gantt chart or a PERT chart for a complex project with many inter-dependent tasks. Explain one key advantage of using a PERT chart in this scenario.3 marks
  7. Explain why testing should be conducted throughout the entire software development lifecycle, rather than being left as a single phase at the end. Refer to the cost and complexity of fixing errors in your answer.4 marks
  8. Differentiate between a code walkthrough and a dry run, identifying the key purpose of each.4 marks
  9. A project has the following tasks with durations and dependencies: Task A(5), Task B(4), Task C(6, after A), Task D(8, after B), Task E(3, after C and D). Construct a PERT chart (a network diagram), identify the critical path, and state the minimum project completion time.6 marks
  10. Explain what a program generator is and provide a specific example of how it might be used in the development of a desktop application.3 marks

Go deeper

Practise and revise with member-only material for this chapter.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters