Software Construction I · Fall 2026

CPEN 221

How do we build software that is correct, that we can reason about, and is designed to evolve over time?

Software construction begins after the syntax starts making sense. These chapters connect Java programs to the contracts, representations, tests, and design arguments that make software dependable.

Core readings

  1. 1
    Engineering Reliable Software

    Build a short Java feedback loop around an observed transit-system failure.

  2. 2
    Types and Specifications

    Use domain types and behavioural contracts to state what transit software means.

  3. 3
    Exceptions, Testing, and Evidence

    Design failure paths and derive useful tests from a transit-feed contract.

  4. 4
    Mutability, Aliasing, and Debugging

    Follow references, close representation leaks, and debug mutable state with evidence.

  5. 5
    ADTs and Representation Independence

    Design an immutable transit-network ADT whose clients do not depend on its data structures.

  6. 6
    Representation Invariants and Abstraction Functions

    Connect concrete transit-network fields to valid abstract graph values.

  7. 7
    Equality, Hashing, and Behavioural Subtyping

    Define value equality, use hash-based collections correctly, and preserve supertype contracts.

  8. 8
    Composition, Delegation, and API Design

    Assemble routing behaviour behind focused interfaces and explicit component boundaries.

  9. 9
    Recursion and Recursive Datatypes

    Represent recursive journeys and justify recursive traversal, termination, and correctness.

  10. 10
    Functions, Streams, and Data Transformations

    Build ordered, non-interfering transformations over transit observations.

  11. 11
    Systems Model and Network Protocols

    Specify and implement a prediction exchange across a process boundary.

  12. 12
    Parallelism, Concurrency, and Virtual Threads

    Coordinate blocking tasks with virtual threads, explicit lifetimes, and resource limits.

  13. 13
    Thread Safety, Integration, and Reliability

    Publish coherent snapshots and connect local contracts to system reliability.

Supplemental readings

  1. +
    Supplemental reading How a Java Program Runs

    Trace Java calls, frames, recursion, exceptions, and shared reachable objects.

  2. +
    Supplemental reading Beyond the Java Call Stack

    Investigate bytecode, optimised execution, thread dumps, and native stack safety.