Labs
Hands-On Design Labs
These labs are not filler. Each one asks students to diagnose, design, refactor, diagram, test, or review software.
Lab Submission Standard
Every lab submission should include the artifact, a short explanation of design choices, and one paragraph describing what the student would improve with more time.
Bad Code Diagnosis
Connected lesson: Week 1 — What Software Design Really Means
Scenario: You receive a small program that works but mixes input, calculation, storage, and output in one function.
Steps
- Run or read the program and describe what it does.
- Highlight every place where two responsibilities are mixed together.
- Name at least three changes that would be risky in the current design.
- Rewrite the design as a simple module list. Do not refactor yet; just diagnose.
Deliverables
- One-page design critique
- List of responsibilities
- List of likely future changes
- Proposed module breakdown
Requirement Recovery
Connected lesson: Week 2 — Requirements, Constraints, and Acceptance Criteria
Scenario: A client says: “I need an app for managing campus events.”
Steps
- List stakeholders: students, organizers, admins, visitors.
- Write at least 12 functional requirements.
- Write at least 6 non-functional requirements.
- Write 5 user stories with acceptance criteria.
- Identify 5 assumptions and 5 constraints.
Deliverables
- Requirements document
- Acceptance criteria table
- Assumptions and constraints section
Modular Refactor Plan
Connected lesson: Week 3 — Decomposition, Modularity, Cohesion, and Coupling
Scenario: You are given a single-file gradebook app. It reads scores, calculates grades, saves results, and prints reports.
Steps
- Identify every responsibility in the file.
- Group related responsibilities into modules.
- Draw arrows showing dependencies between modules.
- Find at least two dependencies that should be inverted or removed.
- Write a refactor order that avoids breaking behavior.
Deliverables
- Responsibility list
- Module map
- Dependency sketch
- Refactor plan
Domain Modeling with Objects
Connected lesson: Week 4 — Object-Oriented Design That Does Not Fight You
Scenario: Design an inventory system for a small campus bookstore.
Steps
- Identify core objects: Product, InventoryItem, Supplier, PurchaseOrder.
- Write the rules each object must protect.
- Create a class diagram.
- Implement at least three classes with validation.
- Write a short note on where composition is better than inheritance.
Deliverables
- Class diagram
- Starter code
- Rule list
- Composition explanation
SOLID Refactor: Reports
Connected lesson: Week 5 — SOLID Part 1: SRP, OCP, and LSP
Scenario: A ReportManager class loads data, calculates totals, formats HTML, saves files, and emails the report.
Steps
- List each reason ReportManager might change.
- Split the class into focused responsibilities.
- Identify one behavior that should be open for extension.
- Write or sketch the new interfaces/classes.
- Explain how the design improves testing.
Deliverables
- Refactored design
- Class list
- Short SOLID explanation
- Testability note
Notification System Design
Connected lesson: Week 6 — SOLID Part 2: Interfaces, Dependency Inversion, and Testability
Scenario: A campus app must send announcements by email today, SMS next semester, and push notifications later.
Steps
- Define a focused NotificationSender interface.
- Create at least two implementations.
- Create a service that depends on the interface, not implementations.
- Write a fake implementation for tests.
- Explain how ISP and DIP appear in your design.
Deliverables
- Interface design
- Implementation code or pseudocode
- Test fake
- Explanation
Clarity Refactor
Connected lesson: Week 7 — DRY, KISS, YAGNI, and Naming
Scenario: You receive code with vague names, duplicated conditions, and several unnecessary abstractions.
Steps
- Rename variables and methods to reveal intent.
- Identify duplicated knowledge vs harmless similar code.
- Remove one abstraction that does not serve a requirement.
- Write a short explanation of how the code became easier to read.
Deliverables
- Before/after code
- Naming improvements list
- Removed overengineering note
Diagram a Workflow
Connected lesson: Week 8 — UML and Practical Design Diagrams
Scenario: Model the checkout workflow for a food ordering app.
Steps
- Write the workflow in plain English.
- Create a sequence diagram for the workflow.
- Create a class or component diagram for the same system.
- Mark one dependency that could become a problem.
- Explain the design improvement you would make.
Deliverables
- Sequence diagram
- Class/component diagram
- Design note
Pattern Choice Lab
Connected lesson: Week 9 — Design Patterns Part 1: Strategy, Factory, Observer, Singleton
Scenario: A mini game needs enemies with different movement and attack styles.
Steps
- Identify which behavior varies.
- Choose Strategy or Factory where appropriate.
- Implement two movement behaviors.
- Create a factory that builds enemies from configuration.
- Explain one pattern you chose not to use.
Deliverables
- Pattern implementation
- Short pattern justification
- One warning about overuse
Repository and UI Separation
Connected lesson: Week 10 — Design Patterns Part 2: Adapter, Decorator, Command, Repository, MVC/MVVM
Scenario: A task tracker stores data directly inside button click handlers.
Steps
- Move validation into a service.
- Create a repository interface.
- Create one in-memory repository for tests.
- Keep UI handlers focused on user interaction.
- Explain how this resembles MVC or MVVM separation.
Deliverables
- Refactored code
- Repository interface
- Short architecture note
Make It Testable
Connected lesson: Week 11 — Testing and Testable Design
Scenario: A service has hard-coded file access and sends real emails during tests.
Steps
- Identify all external side effects.
- Introduce interfaces for external services.
- Inject dependencies through constructors.
- Create fakes for tests.
- Write tests for at least three important rules.
Deliverables
- Refactored service
- Test doubles
- Test cases
- Design reflection
Architecture Sketch
Connected lesson: Week 12 — Software Architecture Basics
Scenario: Design a course registration system for a college.
Steps
- Identify users and core use cases.
- Draw a layered architecture.
- Define the main API or service operations.
- Identify external systems such as identity, payment, or email.
- Write three architectural tradeoffs.
Deliverables
- Architecture diagram
- API/service list
- Tradeoff explanation
Refactor Safely
Connected lesson: Week 13 — Refactoring, Code Smells, and Technical Debt
Scenario: You receive a working but messy invoice system.
Steps
- Write or identify expected behavior.
- Find at least five code smells.
- Choose one smell to refactor first.
- Make small changes and verify behavior after each step.
- Write a technical debt note.
Deliverables
- Code smell list
- Refactored code
- Test/check evidence
- Technical debt note
Final Design Review
Connected lesson: Week 14 — Final Design Review and Professional Presentation
Scenario: Students review each other’s capstone projects before final submission.
Steps
- Present the system in five minutes.
- Show one diagram and one code example.
- Explain one principle and one pattern used.
- Receive peer feedback on clarity and design risk.
- Revise final submission based on feedback.
Deliverables
- Presentation draft
- Peer feedback form
- Final revision note