SENG 365 — Software Engineering
2026-10-21
By the end of this module, you should be able to:
Before class: Read Chapter 7, Sections 7.1–7.6.
The subclass reuses code. Is every ArrayList operation meaningful for a Stack?
A client receiving List<E> may reasonably call:
If a Stack restricts or changes those operations, can it safely stand in for the base type?
For the proposed Stack extends ArrayList relation:
Does inheritance help reuse?
Substitutability
final when extension is not part of the design.The relation is syntactically valid but conceptually false because __________.
Before class: Read Chapter 7, Sections 7.7–7.10.
A report pipeline always loads data, validates it, formats it, and publishes it. Design pressure: Validation and formatting vary.
Which steps belong to the stable algorithm? Which variations might need to change at run time?
The base class owns the algorithm. Subclasses fill selected steps.
The job delegates variation to injected collaborators.
Produce a class diagram for each design and defend one under these changes:
Template Method can make a stable sequence explicit and prevent reordering. It also couples variants to a base class.
Composition makes variation independently replaceable and testable. It introduces more objects and must preserve orchestration invariants another way.
The clean variation point is __________ because __________ is expected to change.
Before class: Read Section 7.11 and review Chapter 5.
Code smells and named refactorings are supplementary material used to practice the chapter’s design advice.
Which smell matters because of the next change, not merely because the method is long?
Before changing the code, capture what it currently does:
A characterization test records current observable behavior, including behavior that may not yet be well explained.
The next release adds alumni pricing and a second tax jurisdiction.
Produce:
Consider Rename, Extract Method, Introduce Parameter Object, or replacing a conditional with polymorphism, but only where justified.
The review comment should name evidence and consequence, not personal preference.
The refactoring __________ should wait until a test captures __________.

Course home · Neil Ernst ©️