The School Design Group Tools for people who build schoolsand the teachers who bring them to life

← All toolkits

Part of Computer Programming I

Unit 10: Programs That Do Not Crash

Computer Programming II Java, unit 10 of 12

Since Unit 3 every unit has ended with a program that one wrong keystroke can stop dead, and each of those units wrote the limitation down instead of fixing it. This unit pays that debt. Lesson 1 starts from the try and catch students already met in Python and says plainly that the syntax is a translation. The new work starts at Lesson 2: Java sorts exceptions into checked and unchecked and the compiler refuses to build a program that ignores a checked one. The unit then covers the exception family tree, catch order and why a parent above a child is unreachable code, finally, validation that stops the exception from happening, designing an exception that says something useful, and throwing it on purpose.

The performance task is The Program That Survives a Hostile User. The student hardens a working program from an earlier unit so that no input a person can type ends it with a stack trace, using at least one validation routine, at least three try and catch blocks that each name the exception they catch, and one custom exception class thrown on purpose and caught somewhere useful. Evidence is a break log of at least twelve attacks the author ran and at least five run by a partner trying to break it, each row giving the input, what happened before hardening and what happens now.

The heaviest criterion is the break log including the partner rows, on the stated grounds that a student who found nothing did not try and an author testing only their own program is testing gently. The second heaviest is the custom exception message, scored against a message quality checklist rather than against length. A teacher gets a plan and a substitute plan for each of the twelve lessons, answer keys, and tiered handouts.

The unit runs 12 instructional days.

What's inside

  • A teach plan for each of the 12 lessons, plus a one page substitute plan per lesson
  • A checked against unchecked lesson built on what the compiler will and will not allow
  • The exception family tree, from Throwable down to the handful of exceptions this course actually uses
  • Catch order labs, including the unreachable catch the compiler rejects and the message it gives
  • A finally lesson, and a validation lesson that prevents the exception rather than catching it
  • Custom exception design, including a message quality checklist for what the reader should be told to do instead
  • Mid-unit checkpoint with answer key, and answer keys for the graded handouts
  • The Program That Survives a Hostile User task with the break log, the partner attack rows and the rubric

Who it's for

  • Teachers whose students write programs that work until somebody else touches them
  • Programs preparing students for the Certiport exception handling objective
  • Classes that want adversarial testing built into the grade, not suggested

License, plainly

Adapt it, rename it, put it on your letterhead, use it as your own. The single license covers one classroom or one organization; the school license covers everyone in the building or department. Do not resell it or publish it as a template product. Full terms.

Also useful

Course

Computer Programming II: Java

Twelve units, 180 days, twelve performance tasks, a lesson plan and a substitute plan for every lesson, aimed at Certiport IT Specialist Java.

Course

Computer Programming I

Twelve units, 180 days, 665 documents. Binary to capstone, with a portfolio and interview practice at the end.