Session 5
AI-Assisted Software Engineering
Today’s Agenda
- The Shift in Mental Model
- Four Core Copilot Workflows
- The Evaluate-Refine Cycle
- What AI Cannot Replace
- Interactive: Copilot Workflows (3 min)
- Interactive: Trust the Copilot? (3–4 min)
- Lab: Starter Kit (Core)
The Shift in Mental Model
Traditional
Write every line from memory or documentation
AI-Assisted
Direct the AI to write → Evaluate → Refine
You are the architect and quality controller. AI handles implementation volume.
Four Core Copilot Workflows
- Explain Code — select code → "Explain step by step"
- Generate from Comments — write what you want → accept suggestion
- Debug with Explanation — paste error + code → "What causes this?"
- Write Tests — select function → "Write three test cases: happy path, edge case, error"
The Evaluate-Refine Cycle
AI code is a first draft. Always ask:
- Does it run? (Syntax)
- Does it do what I asked? (Manual test)
- Does it handle edge cases? (Empty, large, unexpected input)
- Is it readable? (Maintainability)
- Is it secure? (Injection, credentials, trust)
What AI Cannot Replace
- Novel architecture decisions — only you know your team's context
- Business logic validation — only you know the correct calculation
- Security edge cases — AI generates insecure code that looks correct
- Integration debugging — AI frequently hallucinates the cause
Your role: provide the judgment these tasks require.
Lab: Starter Kit (Core) (1/2)
Clone the starter kit from the course GitHub repository.
- 5.1:
npm install → npm run dev → Copilot-explain server.js + TODOs
- 5.2: Implement
GET /health → JSON { ok: true } → break it → debug with Copilot
Lab: Starter Kit (Core) (2/2)
- 5.3: Sketch a small helper for
/query — no API key in the browser
- 5.4: Write test cases or a debug write-up in
03-Project/Copilot-Notes.md
Stretch (after Core): extra route + how your product differs from the generic UI.
Session 5 Summary
- AI shifts you from implementation writer to architect + QC
- Four workflows: explain, generate, debug, test
- Always apply the evaluate-refine cycle
- AI fails at architecture, business logic, security, integration
Next Session: Rapid Application Prototyping