Software programming
Software programming in NCEA Level 2 Digital Technologies tests whether you can plan, build, test and document a program that solves a stated problem using advanced programming techniques - not simply a sequence of statements that happens to run.
Core rules and concepts
- Advanced techniques include modular code (functions or procedures with parameters and return values), collections (lists, dictionaries), file input/output, using a library or module, classes, and event-driven code.
- Evidence needs a plan (backlog, project plan or algorithmic design), iterative development, and testing with expected, invalid and boundary data.
- Code quality: meaningful identifiers, consistent indentation, comments that explain why, and no dead code. Dated snapshots or version control show the iterative process.
- Every test needs test data, expected result, actual result, and the change you made because of it.
Worked example
Problem: read scores from a text file, one per line, skip non-numeric lines, and print the average to two decimal places.
Reasoning: decompose into read_lines() returning a list of strings, to_scores() converting each line with try/except ValueError while counting skips, and average() returning None for an empty list. The boundary case is an empty or all-invalid file: printing "No valid scores" avoids a divide-by-zero crash. With the file 10, 20, abc, 0 the expected output is an average of 10.00 with one skipped line - 0 is valid, abc is invalid, and a blank file is the boundary. Each becomes a documented test with expected and actual results.
Traps that cost marks
- Crashing on invalid input instead of validating it.
- One long main block, so there is little evidence of advanced techniques.
- Testing only the happy path, with no expected-versus-actual record.
- No plan, or a plan that cannot be linked to the final program.
- Comments that restate the code instead of explaining decisions.