Single lesson · Written for OCR J277

Defensive design: anticipating misuse and authentication – OCR GCSE Computer Science lesson (J277)

Pupils learn to explain defensive design, anticipate misuse of a program, and write a simple authentication routine that limits failed attempts.

Also in a bundle Cyber Security and Robust Programs – OCR GCSE Computer Science lessons (J277) 14 lessons for £39 · save 30% on buying separately

Lesson 7 of 14 in unit 11.1 Cyber Security and Robust Programs, taught in Year 11, Autumn 1. It answers one big question: How do programmers plan for users who make mistakes or misuse programs?

By the end, pupils can explain defensive design, anticipate misuse of a program, and write a simple authentication routine that limits failed attempts.

The Build (the main task)
Write an algorithm for Kickstand's staff login that asks for a username and password, allows three attempts, and locks the account after the third failure.
Support version
Part-filled algorithm: the loop and the input lines are given; pupils complete the condition, the success message and the lock-out.
Challenge
Describe two more ways a user could misuse the login, and how the program could anticipate each.
Real-world link
Kickstand's staff log in to the order system, and the founders worry about anyone guessing their way in.
Key words
Defensive design, Authentication and Anticipate, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“Defensive design is the same as network security”; “Authentication decides what a user is allowed to do”.
OCR J277 specification
2.3.1 (defensive design: anticipating misuse, authentication, input validation, and maintainability (subprograms, naming conventions, indentation and comments)).

Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.

Pupils can do it all on paper.

Also sold in the Cyber Security and Robust Programs unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.

What's included

  • Slide deck (PowerPoint)
  • Lesson plan (Word)
  • Worksheet (Word)
  • Support worksheet with scaffolds (Word)
  • Single-teacher licence: use and adapt it with your own classes

More for GCSE Computer Science (OCR)

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.