M10 — Synthesis and Design Judgment

SENG 365 — Software Engineering

Neil Ernst

University of Victoria

2026-12-01

Module Goals

Design Judgment

By the end of this module, you should be able to:

  • connect design choices to requirements, tests, deployment, and expected change;
  • describe where an agent fits in the design lifecycle and what stays with you; and
  • evaluate AI-assisted work without surrendering accountability.

This module is course synthesis rather than a summary of a textbook chapter.

Agents in the Design Lifecycle

What Changes When an Agent Implements?

An agent can draft requirements, designs, code, tests, and a pipeline.

What is left for you to do?

Pause the video and write down your answer.

What Agents Take On

  • Drafts of code, tests, and configuration.
  • Boilerplate and routine refactoring.
  • Critique of a specification or a design.
  • Pipeline and deployment files.

What Stays With You

  • The specification: who the system is for and what they need.
  • The design force, and the tradeoff you accept.
  • The evaluation: tests, evidence, and a close look at the output.
  • The responsibility for the result.

You Cannot Supervise What You Cannot Evaluate

For generated work, ask:

  • Can the team explain the abstraction boundaries?
  • Which requirement or quality attribute drove the structure?
  • What change will be expensive?
  • Which test challenges the riskiest claim?
  • Can failures be diagnosed in production?
  • What was accepted, rejected, or revised, and why?

Cognitive Debt

When an agent writes code you never reason through, the system runs but your understanding of it does not keep pace.

The debt comes due when something breaks, a requirement changes, or you must defend a decision.

Keep your own mental model of the system.

Related: skill loss, in Terence Tao’s talk from the AI lecture.

Three Kinds of Concept

The course sorted its concepts by how you must use them.

  • Know deeply: you can produce it and judge it.
  • Weigh as a tradeoff: you can say what it buys and what it costs.
  • Recognize: you know the name and the situation.

Judge Output By These: Know Deeply

Concept Module Look for in generated code
Abstraction and encapsulation M2 internals exposed through getters or public fields
Interfaces and polymorphism M3 clients that depend on concrete classes
Dependency injection M3 collaborators built inside the class
State modelling M4 states hidden in flags and conditionals
Testability M5 time, randomness, or I/O with no seam
Composition M6 inheritance used only to reuse code

Judge Output By These: Weigh the Tradeoff

Pattern Module Ask before accepting
Strategy M3, M9 is it a class where a function value would do?
Singleton M4 does global access hide a dependency?
Decorator M6 is it still clear what the client is holding?
Composite M6 does the client still ask leaf or group?
Command M6 does the named command earn its cost over a lambda?
Observer M8 push or pull, and who may change the model?

Judge Output By These: Recognize

  • Know the name and the situation it solves.
  • Prototype (M6): copy an object when its concrete type is unknown.
  • Flyweight (M4): share immutable instances when identity carries no meaning.
  • Others: Memento, Bridge, etc. not covered in the course.

The Project Path

Artifact AI level
A1 Requirements specification A
A2 System design A
A3 Tested prototype slice D
A4 Requirements revision C
A5 Design revision D
A6 Tested and deployed prototype E

A1 and A2: Specify and Design

Textbook Agent You decide
A1 requirements slides none (Level A) boundary, stakeholders, stories, quality attributes
A2 M2 to M8 none (Level A) structure, behavior, rejected alternatives, decisions

These two artifacts become the context an agent works from.

A3, A4 and A5: Build and Revise

Textbook Agent You decide
A3 M3 interfaces, M5 testability debug, explain, suggest (D) which tests; one repair
A4 requirements slides critiques your A1 (C) accept, reject or revise each point
A5 the A2 modules proposes two alternatives (D) the choice; one claim verified

A6: Deploy

Textbook Agent You decide
A6 deployment notes, M5 most latitude (E) smoke test, operational note, one repair

An agent can write the pipeline but you decide what counts as evidence.

Recall: Requirements Are the Spec an Agent Reads

  • Stories with acceptance criteria.
  • Quality attributes with fit criteria.
  • A glossary or entity model.

A1 is graded on one test: could another team design from it without talking to you?

Recall: Deployment Is Part of the Design

  • Build, release, run: from a clean checkout.
  • A passing pipeline is evidence, not proof.
  • A smoke test runs against the deployed URL.
  • You can roll back.

Homework: Spot the Force

An agent generated this class. It works.

final class GameModel {
    private static final GameModel INSTANCE = new GameModel();
    static GameModel instance() { return INSTANCE; }

    private int score;
    void addPoints(int points) { score += points; }
    int score() { return score; }
}

Homework: Spot the Force (continued)

class ScoreTest {
    @Test void startsAtZero() {
        assertEquals(0, GameModel.instance().score());
    }
}
  1. Why might this test pass alone and fail after another test?
  2. Name the design force.
  3. Which kind of concept is it: know deeply, weigh, or recognize?

Homework: Which Row Is Weakest?

Pick the row of the map where you are least sure you could judge an agent’s output.

  • What would you check first?
  • Which textbook module tells you what to look for?

Review and Wrap-Up

Preparation

Before class: Review your project reflections and the Insights sections from Chapters 1–9.

Bring one artifact created manually and one created with AI assistance. Mark one place where the AI chose the structure, library, or pattern.

Entry Decision

Name one place an AI tool chose how to build something in your project.

Was that the right choice for your situation?

What evidence supports your answer?

Same Force, Different Mechanism

Every language answers the same design questions:

  • Where is the contract written down?
  • Who checks that it is kept: the compiler, the runtime, a convention, or you?
  • How do I wrap or reuse behavior?

The Agent Picks the Idiom

Same behavior, three contracts:

  • Java: an interface, checked by the compiler.
  • Python: a Protocol, checked only if you run a type checker.
  • JavaScript: a convention, checked by nobody.

An agent writes in the idiom of the language you give it.

You judge whether the contract is kept.

Idioms and Patterns

Slides in class: cross-language comparison.

  • Language philosophy: who should prevent bugs?
  • Shuffler: one injected behavior, in three languages.
  • Decorator: wrap any shuffler.
  • Prototypes: what JavaScript’s class really is.
  • Judge the idiom: a Stack that all three languages accept.

Judge the Idiom

An agent generated a Stack by extending the language’s list type, in Java, Python, and JavaScript.

Look at the three versions on screen.

  1. Would the compiler or the runtime reject a client that inserts at the front of the stack, in any of the three?
  2. Which design force does the class break?
  3. What would you ask the agent to change?

The Language Does Not Judge for You

  • A compiler checks the mechanism. It does not check the force.
  • All three languages accepted the broken Stack.
  • With or without an agent, the judgment is yours.

What Persists

  • Design is accountable choice under constraints.
  • Source code is a design artifact, not merely implementation.
  • Tests consume and reveal the quality of interfaces.
  • Diagrams expose selected relationships, not the whole truth.
  • Patterns communicate recurring forces and tradeoffs.
  • Deployment and observability constrain structure.
  • AI changes who produces an artifact, not who is responsible for it.

Exit Note

One design skill I can now use with or without AI is __________.