Lesson Overview
Build a small artefact connected to a later computing specialism such as HCI, security, games, data or software engineering.
Portfolio focus: Select one specialism route.
Starter: think before typing
Before running this applied programming example, find the line where the main idea becomes active. Write a prediction: what must already be true for that line to work, and what should be different after it runs? The checked run ends with `Password strength score: 2`; predict how the focus line helps produce that evidence.
Learning Objectives
- Choose a specialism and define a realistic small scope.
- Connect code decisions to the specialism.
- Produce a working Java artefact.
- Reflect on what further study would require.
Learning Outcomes
- By the end of the lesson, you can choose a specialism and define a realistic small scope.
- By the end of the lesson, you can connect code decisions to the specialism.
- By the end of the lesson, you can produce a working Java artefact.
- By the end of the lesson, you can reflect on what further study would require.
Why this idea exists
Computer science specialisms show how the same programming foundations are used in different problem spaces: HCI focuses on users, security on risk, games on interaction, data on evidence and software engineering on maintainability.
A mini-project gives a first taste of that breadth without pretending to cover the whole field. The goal is to connect code decisions to the values and constraints of a specialism.
At degree level, specialism work should make its assumptions visible. A security tool should discuss misuse, a data tool should discuss data quality, and an HCI artefact should discuss users and accessibility.
Deep dive
Mechanism in this example
The important mechanism is visible around `String password = "correct horse battery staple";`. Read it as a concrete move in the program, not as decorative syntax: identify what value, object, branch, call or boundary is being created at that point.
Design pressure
At degree level, specialism work should make its assumptions visible. A security tool should discuss misuse, a data tool should discuss data quality, and an HCI artefact should discuss users and accessibility.
Failure mode to watch
For Specialism Mini-Project, deliberately disturb the assumption behind `String password = "correct horse battery staple";`: use an awkward value, missing input, wrong order of calls or boundary case. The useful question is how that disturbance exposes a weakness in the applied programming design.
Extension step
Extend the example by doing this: Write a short project brief. The point is to make one small change that forces you to revisit the concept, rather than adding unrelated features.
Portfolio standard
The portfolio note should not repeat the lesson wording. It should show the edited code, the run result, and your own explanation of this evidence: build a minimum working version with tests or review evidence.
Lesson visual

Type this and run it
Create SpecialismMiniProjectDemo.java, type the program, and run it before changing anything. This section is about reproducing the checked baseline.
public class SpecialismMiniProjectDemo {
public static void main(String[] args) {
String password = "correct horse battery staple";
int score = password.length() >= 16 ? 2 : 1;
System.out.println("Password strength score: " + score);
}
}Build and run it with:
javac SpecialismMiniProjectDemo.java && java SpecialismMiniProjectDemoExpected baseline: Password strength score: 2
Run the code in your browser
Use the editor as an experiment surface. First run the checked version, then make one small change to the part of the program that demonstrates applied programming and compare the new behaviour with the reference output.
Password strength score: 2Line-by-line explanation
Read the code as a sequence of responsibilities. The focus line for this lesson is String password = "correct horse battery staple";; the surrounding lines prepare it, use its result or make the behaviour observable.
public class SpecialismMiniProjectDemo {This names the runnable class for the Specialism Mini-Project example, giving the compiler and JVM one clear unit to build.
public static void main(String[] args) {This is the program entry point. In Specialism Mini-Project, it keeps the demonstration of applied programming in one traceable starting script.
String password = "correct horse battery staple";This introduces password as named state for Specialism Mini-Project. Later lines can read, update, pass or print that specific value as evidence.
int score = password.length() >= 16 ? 2 : 1;This introduces score as named state for Specialism Mini-Project. Later lines can read, update, pass or print that specific value as evidence.
System.out.println("Password strength score: " + score);This prints "Password strength score: " + score as the observable evidence for Specialism Mini-Project. The output lets the learner check whether the applied programming idea behaved as predicted.
}This closes the innermost Specialism Mini-Project block, so the immediately preceding method, branch or loop has finished.
}This closes the outer Specialism Mini-Project structure, returning the reader to the surrounding class or file.
Worked example
From code to explanation
Problem: Use Specialism Mini-Project to complete a small portfolio-quality step: Select one specialism route.
Method: Locate the line `String password = "correct horse battery staple";`, explain the exact role it plays, then decide what you would change to extend the example without changing the whole program.
Reveal worked answer
The checked run should produce `Password strength score: 2`. A strong answer links the result back to applied programming: what was created, selected, stored, called or protected, and why that matters for the portfolio task.
Trace the program
Before: Before the key operation, identify the relevant value, object, branch or resource that the applied programming concept depends on.
During: Trace `String password = "correct horse battery staple";` as the Specialism Mini-Project example executes. Say whether that operation creates data, checks a condition, calls behaviour, stores information or crosses a boundary.
After: Compare the run with the expected evidence: `Password strength score: 2`.
Change: Now write a short project brief, run again, and explain the smallest reason the behaviour changed.
Common misconception
A common mistake in specialism mini-project is treating the example as a finished answer. For applied programming, the important question is narrower: which operation carries the idea, what does it make possible, and what would break if you changed it carelessly?
Quick checks
1. In this Specialism Mini-Project example, what is the best reason to focus on `String password = "correct horse battery staple";`?
2. Which evidence is strongest after you edit and rerun this example?
How to study this lesson
For Specialism Mini-Project, predict how applied programming changes the run before you press Run.
Use the first portfolio task as your main edit: Select one specialism route.
Use the second task as your variation: Write a short project brief.
Finish with evidence, not a diary entry: Build a minimum working version with tests or review evidence.
Portfolio Practice
- Select one specialism route.
- Write a short project brief.
- Build a minimum working version with tests or review evidence.
Final self-check
Can you explain the key operation?
Explain the line identified in the quick check in one or two sentences. Your answer should say what it does before the output Password strength score: 2 appears.
Can you justify the portfolio evidence?
Your evidence should include the original run, one edited run, and a short note explaining how the edit affected applied programming.
Study route
Practise applied programming by predicting the Java example, typing it, running it in the browser, tracing the result and saving portfolio evidence.
Next, move into Final Portfolio and Reflection and carry forward one improvement from this lesson into the next program.
