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 github.com/arjankc/ai-product-engineering.
git fetch --tags → git checkout track-NN (your Session 1 number) → npm install → npm run dev
Session 5 Core is already in the starter — explore & verify, don’t wipe working code.
- 5.1: Copilot-explain middleware,
/health, /version, normalizeQuery, later TODOs
- 5.2:
curl verify health/version/query → break it → debug with Copilot
Lab: Starter Kit (Core) (2/2)
- 5.3: Extend or critically improve
lib/utils.js — no API key in the browser
- 5.4: Replace the sample
03-Project/Copilot-Notes.md with your own test cases or debug write-up
Stretch (after Core): a product-specific route/field the generic starter does not have yet.
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