- Use a generative AI model to produce short code snippets for specific parts of your solution
- Write precise prompts that cover the requirements
- Review the generated code and plan refinements
- Work legally and ethically with AI
What the activity is
The specification says that in Task 1 Activity C you use a generative AI model to create short snippets of code for specific areas of functionality: one function or process that you would then fit into your larger solution. You must not ask it to build the whole solution. You need to show the prompts you entered and review how well the output meets the needs of that functionality. Pearson does not set which model to use; a natural language model such as ChatGPT or Google Gemini fits the task.
How it is marked (DSD grid, 12 marks)
| Strand | Marks | What gets credit |
|---|---|---|
| Problem solving | 3 | How well your use of AI covers the task requirements |
| Use of prompts | 3 | Prompts precise enough for a model to produce consistently correct code |
| Output review | 6 | A thorough review of the positives and negatives of the code and the refinements needed |
Task 1 also has a separate quality of communication strand (6 marks) across your work: use suitable techniques, formats and technical language for the audience.
Step 1: pick the right functionality
Choose small, well-defined pieces from your own design, for example:
- validating a booking form's date and time
- calculating a value the brief asks for, such as a quote or a total
- checking whether a time slot is already taken
- hashing a password before it is stored.
Each one should link to a functional requirement from your proposal.
Step 2: write precise prompts
A strong prompt states:
- the language and version, such as Python 3.10 or JavaScript
- the inputs, with data types and example values
- the processing and rules, including limits and boundaries
- the outputs and their format
- error handling and validation expected
- conventions: naming style, comments, no global variables.
| Weak prompt | Strong prompt |
|---|---|
| "Write a booking system" | "Write a Python 3.10 function is_slot_free(bookings, date, time) where bookings is a list of dictionaries with keys date (YYYY-MM-DD string) and time (HH:MM string). Return True if no booking has the same date and time, otherwise False. Use snake_case, add comments, and do not use global variables." |
Record each prompt, the model used, the date, and the output in full. If you refine your prompt, keep every version so the marker can see how it improved.
Step 3: review the output
Test the code before you judge it. For each snippet, cover:
- Does it work? Run it with valid, invalid and extreme data. Note what passes and fails.
- Does it meet the requirement? Compare it with your functional and non-functional requirements.
- Positives: correct logic, readable, efficient, handles errors.
- Negatives: missing validation, insecure methods, unclear names, outdated functions, assumptions that do not match your design, code you cannot explain.
- Refinements: exactly what you would change and why, such as renaming to match your data dictionary or adding a range check.
Legal and ethical use of AI
- Say clearly which code came from AI; never present it as your own.
- Do not put personal or confidential data into prompts.
- Check licences and avoid code you suspect has been copied from a protected source.
- You are responsible for the code: check it for bias, security flaws and errors before using it.