CAIE Computer Science IGCSE Topic 7 Algorithm Design and Problem-Solving Study Guide

The Program Development Life Cycle

The Program Development Life Cycle, or PDLC, encompasses the core stages necessary for the creation of a computer program. This structured approach consists of four main stages: analysis, design, coding, and testing. Each stage serves a specific purpose in moving from an initial problem to a verified software solution.

Problem Analysis and Technical Decomposition

Analysis is the foundational stage where the problem is thoroughly understood and requirements are identified. During this phase, computer scientists employ abstraction, which is the process of removing unnecessary details to focus only on what is important for the specific task at hand. Another critical technique is decomposition, which involves breaking a complex problem down into smaller, more manageable sub-problems. Systematic identification of inputs, processes, and outputs is conducted here to ensure the logic of the system is sound. System decomposition specifically refers to breaking a large system into smaller sub-systems to make it easier to design, understand, and test.

Data Flow and System Components

In the context of algorithm design, four key components define how information moves through a system. Inputs refer to the raw data that goes into a system. Processes constitute the specific actions or calculations performed on that data to transform it. Outputs are the resulting information produced by the system for the user or another system to utilize. Storage is defined as the data saved for later use, ensuring that information persists beyond the immediate execution of a process.

Tools for Designing and Describing Solutions

Design is the stage of planning a solution before any program code is written. This phase utilizes specific tools to visualize logic. A structure diagram is a specialized diagram used to represent decomposition by showing tasks broken down into smaller sub-tasks. Pseudocode is a text-based, language-independent method of describing a solution in structured steps using consistent keywords. A flowchart is a diagrammatic representation that shows the step-by-step flow of a process using standard geometric symbols to indicate different types of actions or decisions.

Implementation and Algorithm Fundamentals

An algorithm is defined as a set of instructions that can be followed to perform a specific task. Logic translated from the design phase becomes program code, which is the actual code written in a specific programming language. The coding stage involves translating the design into a working program and performing iterative testing to catch errors as they arise.

Searching and Sorting Methodologies

A linear search is a searching algorithm that identifies a target item by checking every item in a list one by one until the desired item is found or the end of the list is reached. Bubble sort is a common sorting algorithm that repeatedly compares and swaps adjacent elements in a series of passes. This process causes the largest elements to gradually "bubble" to the end of the series with each successive pass until the entire list is ordered.

Standard Algorithmic Operations

Algorithms frequently perform standardized mathematical operations. Totalling involves adding up a running total of various values using a loop structure. Counting is the process of determining how many times a specific condition is met by increasing a counter variable each time the condition evaluates to true. Finding the minimum or maximum is the process of identifying the smallest or largest value in a set by comparing each new value to the current minimum or maximum stored. Finding an average involves calculating the mean of a set by totalling all values and then dividing that total by the count of the values.

Data Validation and Verification Techniques

Validation is the process of checking that input data is reasonable and sensible before it is accepted by the system. There are several specific validation checks: a range check ensures data falls within a specified numerical or alphabetical range; a length check ensures the data contains the correct number of characters; a type check ensures the data is of the correct data type (such as integer or string); a presence check ensures a field is not left blank; and a format check ensures data follows a specific, predefined pattern. Additionally, a check digit is an extra digit calculated from other digits in a sequence used to detect errors. Verification is the process of checking that data matches the original source to prevent entry errors. This is achieved via a visual check, where a user compares entered data with the original by eye, or a double entry check, where data is entered twice and then compared for discrepancies.

Testing Procedures and Data Categories

Testing involves checking that a program functions correctly and meets all identified requirements. This is performed using test data, which comes in four categories. Normal data consists of typical, valid data within the expected range. Abnormal data refers to invalid data that the system should reject. Extreme data represents the absolute largest and smallest acceptable values. Boundary data includes values at the extreme limits as well as values just outside those limits. To manually test an algorithm, a developer may perform a dry-run, which is the process of going through an algorithm step by step without a computer. This is usually documented in a trace table, which records variable values, outputs, and prompts at each step to help a user understand or test the flow of the program.

Error Classification in Software Development

Errors in programming are classified into three main types. A syntax error occurs when the rules of the programming language are broken, such as misspelling commands or missing mandatory keywords. A logic error happens when the code's logic is incorrect—such as using the wrong mathematical operator—causing the program to produce an incorrect result even though it continues to run. A runtime error is an error that occurs while the program is actively running, such as an attempt to perform an illegal operation like dividing by 00 or attempting to access an invalid index.