Develop code — Edexcel GCSE Computer Science
Verified courseTeaching note checked against the official specification.
Develop code explained
Develop code covers 6 specification points, including Be able to use decomposition and abstraction… and Be able to read, write, analyse and refine….
Read the full explanation
Open a point below for its explanation and revision guidance.
6.1.1 be able to use decomposition and abstraction to analyse, understand and solve problems
Decomposition means breaking a large problem into smaller sub-problems that are easier to understand, design, code and test. Abstraction means removing unnecessary detail and keeping only the features that matter for solving the problem, such as modelling a shop till with items, prices and totals while ignoring the colour of the till. To analyse a problem, you identify inputs, processes and outputs, list the sub-tasks and decide which details are irrelevant. To solve it, you design and code each sub-problem, often as separate functions or modules, then combine them and test the whole solution. For example, a program to calculate student grades could be decomposed into reading marks, calculating an average, applying grade boundaries and displaying the result, while abstraction removes details such as the font used on screen.
6.1.2 be able to read, write, analyse and refine programs written in a high-level programming language
This criterion requires you to work fluently with complete programs in a high-level language, not just isolated lines. Reading means tracing execution line by line, tracking variable values in a trace table and predicting output. Writing means building a working program from a specification, choosing suitable selection, iteration, subprograms and data structures. Analysing means explaining what a given program does, identifying inputs, processes and outputs, and locating logic errors such as an off-by-one loop bound or a condition that never becomes true. Refining means editing existing code to correct faults, improve readability with meaningful identifiers and comments, and make it more efficient or robust, for example adding validation so a menu rejects an out-of-range choice.
6.1.3 be able to convert algorithms (flowcharts, pseudocode*) into programs
This criterion asks you to translate an algorithm expressed as a flowchart or pseudocode into a working program in a high-level language. The skill is faithful conversion: every symbol or pseudocode line must become equivalent code, with the same sequence, selection and iteration. Read the algorithm first and identify its inputs, its decisions and its loops. A flowchart decision diamond becomes an if statement, and a loop back to an earlier point becomes a while or for loop with the same condition. Pseudocode assignment becomes a variable assignment, and pseudocode input and output become the input and output statements of your language. Watch the details: a condition written as greater than or equal to must stay that way, and counters must be initialised before the loop.
6.1.4 be able to use techniques (layout, indentation, comments, meaningful identifiers, white space) to make programs easier to read, understand and maintain
Readable code lets another programmer follow the logic quickly and change it safely. Layout groups related statements so the sequence of actions is obvious. Indentation shows which statements sit inside a loop, selection or subroutine, so nesting depth is visible at a glance. Comments explain why a block exists or what a non-obvious value means, rather than restating each line. Meaningful identifiers name variables and subroutines after their purpose, so totalScore is clearer than t. White space separates logical blocks and operators, making expressions easier to scan. For example, a function that calculates a pupil's average mark should indent its loop body, use names such as markTotal and markCount, and carry a short comment describing the rounding rule. These techniques do not change what the program does; they change how easily a human reads, understands and later maintains it.
6.1.5 be able to identify, locate and correct program errors (logic, syntax, runtime)
Debugging means finding why a program does not behave as intended, working out where the fault is, and fixing it. Syntax errors break the rules of the language, so the program will not run; an example is a missing closing bracket or a misspelled keyword. Logic errors let the program run but produce wrong results, such as using addition where subtraction is needed or writing a condition that is never true. Runtime errors occur while the program is running, for example dividing by zero or accessing an index outside the bounds of a list. To debug, read the error message, trace the values of variables, add temporary output statements, and test with known inputs. Once the fault is located, correct the code and re-test to confirm the fix and check that nothing else has broken.
6.1.6 be able to use logical reasoning and test data to evaluate a program’s fitness for purpose and efficiency (number of compares, number of passes through a loop, use of memory) *In this specification, the term ‘pseudocode’ is used to denote an informal written description of a program. Pseudocode uses imprecise English language statements and does not require any strict programming syntax.
Evaluation means judging whether a working program actually does the job it was written for, and how economically it does it. Start by restating the purpose in testable terms, then choose test data that exercises normal, boundary and erroneous cases. Run the program and compare each actual output with the expected output; a mismatch shows the program is not fit for purpose. Fitness also covers robustness: does it reject invalid input, handle an empty list or a zero divisor? Efficiency is judged separately from correctness. Count how many comparisons a search or sort makes, count how many times a loop body executes, and estimate memory by tracking how many variables, list elements or records are stored at once. For example, a linear search over 1000 items may need 1000 comparisons, while a binary search needs far fewer, so the same correct result can be reached more efficiently.
Your focus
- Apply decomposition to break a given problem into smaller sub-problems.
- Apply abstraction to identify and remove unnecessary detail from a problem.
- Use decomposition and abstraction together to analyse, understand and solve a problem.
Show all 18 objectives
- Trace a supplied high-level program accurately and state its output.
- Write a complete program that meets a given specification.
- Analyse and refine existing code by locating faults and making justified improvements.
- Interpret a flowchart or pseudocode algorithm and identify its components.
- Convert the algorithm into a working high-level program that preserves its logic.
- Test the converted program and correct any differences from the original algorithm.
- Identify layout, indentation, comments, meaningful identifiers and white space in a given program.
- Explain how each technique makes a program easier to read, understand or maintain.
- Select the most appropriate readability improvement for a described piece of code.
- Classify a described program fault as a syntax, logic or runtime error.
- Locate the faulty statement using error messages, tracing or test data.
- Correct the error and re-test the program to confirm the fix.
- Use logical reasoning and test data to judge whether a program meets its stated purpose.
- Measure and compare efficiency using number of compares, number of passes through a loop and use of memory.
- Write informal pseudocode descriptions without strict programming syntax when planning or explaining a program.
Develop code exam tips
Marking Points
- Decomposition is explained as breaking a problem into smaller sub-problems that can be tackled separately.
- Abstraction is explained as removing unnecessary detail and keeping only the information needed to solve the problem.
- A worked example shows a problem split into identifiable sub-tasks, such as input, calculation, decision and output stages.
- The response explains how abstraction simplifies the model of the problem, for example by ignoring irrelevant real-world detail.
- The response links decomposition and abstraction to analysing, understanding and solving the problem, not just defining the terms.
- Sub-problems are described in a way that supports coding, such as separate functions or modules that can be tested individually.
- Traces a supplied program accurately, recording how variable values change on each pass through a loop and stating the final output.
- Writes a complete program from a given specification, using appropriate input, processing and output with correct syntax in the chosen high-level language.
- Analyses code by identifying its purpose, its inputs and outputs, and the effect of each selection and iteration structure.
- Identifies logic errors such as incorrect loop bounds, misplaced assignment or conditions that can never be satisfied, and explains why each is wrong.
- Refines working code by correcting faults, improving identifier names and comments, and removing unnecessary repetition without breaking behaviour.
- Tests a refined program with normal, boundary and erroneous data, and explains how the results show the code now meets the specification.
- Identifies the inputs, processes, decisions and outputs represented in the supplied flowchart or pseudocode.
- Converts each flowchart symbol or pseudocode statement into equivalent high-level code, preserving sequence, selection and iteration.
- Translates conditions and loop controls exactly, keeping comparison operators and counter initialisation consistent with the algorithm.
- Produces a program that runs and gives the same results as the original algorithm for the same input data.
- Tests the converted program with sample data and corrects any mismatch between its behaviour and the algorithm.
- Explains how a specific flowchart or pseudocode construct maps onto the corresponding code structure.
- Layout: related statements are grouped and ordered so the flow of the program is easy to follow.
- Indentation: statements inside loops, selections and subroutines are indented to reveal nesting and control flow.
- Comments: brief comments explain purpose, assumptions or non-obvious decisions rather than repeating the code.
- Meaningful identifiers: variable, constant and subroutine names describe their role, such as markTotal instead of t.
- White space: blank lines and spacing around operators separate logical sections and improve scanning.
- Purpose: all five techniques together make a program easier to read, understand and maintain without altering its behaviour.
- Syntax errors: the code breaks language rules, so it fails to run; examples include missing brackets or misspelled keywords.
- Logic errors: the program runs but gives incorrect output, such as a wrong operator or a faulty condition.
- Runtime errors: the fault appears while running, such as division by zero or an out-of-range list index.
- Locating errors: use error messages, trace tables, temporary output and test data to find the faulty line.
- Correcting errors: change the code so it follows the rules, produces the intended result, or handles the failing case.
- Verification: re-run the program with normal, boundary and erroneous test data to confirm the correction.
- States the program's intended purpose in testable terms before judging it.
- Selects and justifies test data covering typical, boundary and invalid cases.
- Compares actual output with expected output and identifies pass or fail.
- Explains how the number of comparisons made by an algorithm is counted or estimated.
- Explains how the number of passes through a loop is counted or estimated.
- Explains how memory use is judged from stored variables, list elements or records.
- Distinguishes correctness (fitness for purpose) from efficiency.
- Reaches a supported overall judgement with evidence from the test run.
Examiner Tips
- 💡Apply both techniques to the specific problem in the question rather than writing general definitions only.
- 💡Show the sub-tasks in a logical order and state what each one does.
- 💡State explicitly which details you are ignoring and why they are not needed for the solution.
- 💡Use a short worked example, such as a grade calculator, to make your reasoning concrete.
- 💡Trace short programs by hand on paper before writing any answer, so your stated output is based on evidence rather than guesswork.
- 💡When asked to find errors, quote the faulty line, state what it does now and give the corrected version with a brief reason.
- 💡For refinement questions, keep the original structure where it works and change only what the specification requires, then check boundary cases.
- 💡Annotate the algorithm first, labelling each input, decision and loop, then write code that mirrors those labels.
- 💡After converting, trace both the algorithm and your program with the same test data and compare the outputs.
- 💡Check every condition and counter against the source algorithm before finishing, as these are the most common sources of mismatch.
- 💡When a question shows two versions of code, compare them against all five techniques and state which version is easier to maintain and why.
- 💡Link each technique to a benefit: layout and white space aid scanning, indentation reveals structure, comments record intent, identifiers convey meaning.
- 💡If asked to improve a snippet, apply the named techniques rather than rewriting the algorithm, and keep the program's behaviour unchanged.
- 💡Classify the error first: does the program fail to run, run with wrong output, or crash while running? The category guides the fix.
- 💡Use a trace table or add temporary output to follow variable values and pinpoint the line where behaviour diverges from expectation.
- 💡After correcting, re-test with the original failing input plus a normal case to show the fix works and has not introduced a new fault.
- 💡Structure the answer as purpose, test data, observed results, efficiency measures, then a justified verdict.
- 💡Quote concrete counts, such as the number of comparisons or loop passes, rather than saying 'it is fast'.
- 💡When a test fails, state what the output was, what was expected and what that shows about fitness for purpose.
Common Mistakes
- Treating decomposition and abstraction as the same thing: decomposition splits a problem into parts, while abstraction removes detail from the problem.
- Removing essential detail in the name of abstraction, which makes the solution incorrect rather than simpler.
- Listing sub-tasks that overlap or leave gaps, so the combined solution does not cover the whole problem.
- Describing only definitions without applying them to the given problem, which does not demonstrate the skill.
- Reading code by skimming rather than tracing it: the correction is to maintain a trace table showing each variable after every iteration.
- Assuming a loop runs a fixed number of times without checking the condition: the correction is to evaluate the condition at the start and end of each pass.
- Treating analysis as a description of syntax rather than behaviour: the correction is to state what the program achieves and how data flows through it.
- Refining by rewriting everything from scratch: the correction is to make the smallest change that fixes the fault and preserves tested behaviour.
- Changing a condition during conversion, for example turning a greater-than-or-equal comparison into a strict greater-than: the correction is to copy the operator exactly.
- Forgetting to initialise a counter or accumulator before the loop: the correction is to place the initialisation before the loop as the algorithm shows.
- Converting a loop that tests its condition before the body into one that always runs the body at least once: the correction is to match the test position shown in the algorithm.
- Ignoring the order of statements: the correction is to follow the algorithm's sequence, since reordering can change the result.
- Believing indentation changes what the program does. Correction: indentation is for human readers; it does not alter execution, though poor indentation hides logic errors.
- Writing comments that simply restate each line, such as a comment saying increment i above i = i + 1. Correction: comments should explain why, or clarify anything not obvious from the code.
- Using single-letter or vague identifiers throughout. Correction: choose names that describe the data or action, such as pupilName or calculateAverage.
- Treating every error as a syntax error. Correction: check whether the program runs at all; if it runs but gives wrong output, suspect a logic error, and if it crashes mid-run, suspect a runtime error.
- Assuming a runtime error is always on the line shown in the message. Correction: the reported line may be where the fault surfaces, so trace back to the value or index that caused it.
- Fixing a symptom rather than the cause, such as changing an output value instead of the calculation. Correction: locate the faulty statement and correct the underlying logic, then re-test.
- Confusing efficiency with correctness: a program can produce the right answer yet still be inefficient, so count comparisons, loop passes and memory separately from output checks.
- Using only one test case: a single successful run does not show fitness for purpose, so include normal, boundary and erroneous data.
- Assuming fewer lines of code always means less memory: memory depends on stored data such as variables and list elements, not on source length.
- Treating pseudocode as strict code: pseudocode is an informal written description using imprecise English statements and needs no strict programming syntax.