AI-101

Lesson 23

Building Software with AI Assistance

AI-generated

Learning Objectives
  • Use AI throughout the development lifecycle
  • Know when AI helps most vs. when it slows you down
  • Balance AI speed with code quality
  • Build good review habits for AI-generated code
  • Maintain your skills while using AI assistance
Developer Track: Full-Cycle AI Development

This lesson is for developers building software with AI assistance. We cover the full development lifecycle: planning, implementation, testing, documentation, and maintenance. Non-developers should skip to Unit 6.

The goal is not to maximize AI usage. It is to maximize your effectiveness. Sometimes that means using AI heavily. Sometimes it means coding yourself.

The AI-Augmented Development Lifecycle

AI can assist at every stage. Knowing where it helps most guides effective use.

Planning Phase

AI assists with:

  • Breaking down requirements into tasks
  • Identifying technical approaches
  • Estimating complexity
  • Surfacing edge cases and considerations

Prompt: "I need to build a feature that lets users export their data as CSV. Ask me clarifying questions, then outline the implementation approach."

Implementation Phase

AI assists with:

  • Writing initial implementations
  • Generating boilerplate
  • Implementing patterns you describe
  • Solving specific technical problems

Prompt: "Write the export service. Handle large datasets with streaming to avoid memory issues. Use our existing file handling patterns."

Testing Phase

AI assists with:

  • Generating test cases
  • Writing test boilerplate
  • Identifying edge cases
  • Creating test data

Prompt: "Write unit tests for the export service. Cover: empty data, large datasets (1M+ rows), special characters in fields, date formatting, and permission checks."

Documentation Phase

AI assists with:

  • Generating API documentation
  • Writing code comments
  • Creating README sections
  • Producing user guides

Prompt: "Generate JSDoc comments for all public methods in this module. Base them on the actual implementation."

Maintenance Phase

AI assists with:

  • Understanding unfamiliar code
  • Debugging issues
  • Refactoring for clarity
  • Updating dependencies

Prompt: "This function is confusing. Explain what it does step by step, then suggest a clearer implementation that preserves behavior."

Where AI Helps Most: High-Leverage Tasks

Not all tasks benefit equally from AI. Focus AI on high-leverage areas.

High AI Leverage

TaskWhy AI Helps
Boilerplate codeRepetitive, low creativity
Test generationCovers many cases quickly
DocumentationMechanical extraction from code
Code explanationReads and summarizes well
Pattern applicationApplies known patterns consistently
RefactoringMechanical transformations
Bug investigationReads error traces, suggests causes

Medium AI Leverage

TaskConsiderations
New featuresGood first draft, needs review
API designSuggest options, human decides
Performance optimizationMay miss context-specific issues
Code reviewCatches common issues, misses nuance

Lower AI Leverage (Do It Yourself)

TaskWhy You Should Do It
Architecture decisionsRequires deep context and judgment
Security-critical codeErrors are costly; needs expert review
Novel algorithmsAI relies on existing patterns
Business logicYou understand requirements better
Integration pointsSystem context matters
Where AI Hurts: Knowing When to Code Yourself

AI assistance has costs. Recognize when it is not worth it.

The Explanation Overhead

If explaining the task to AI takes longer than doing it, skip AI. This often applies to:

  • Small changes (one-line fixes)
  • Highly context-dependent code
  • Quick experiments
  • Things you know by heart

The Review Overhead

AI-generated code needs review. For complex logic, reviewing AI code can take as long as writing it yourself. Consider:

  • Will I trust this without thorough review?
  • Is the review overhead worth the time saved?

The Skill Erosion Risk

Over-relying on AI can erode your skills. Balance:

  • Use AI for productivity on familiar patterns
  • Code yourself when learning new concepts
  • Periodically write code without AI to stay sharp

The Debug Trap

Debugging AI code you do not understand is frustrating. If you cannot explain why the code works, you will struggle when it breaks.

Reviewing AI Code: A Practical Checklist

Every piece of AI-generated code needs review. Here is a practical checklist:

Quick Scan (All AI Code)

  • [ ] Does it do what I asked?
  • [ ] Any obvious errors or typos?
  • [ ] Files changed match expected scope?
  • [ ] No unexpected dependencies added?

Standard Review (Most AI Code)

  • [ ] Logic is correct and complete
  • [ ] Error handling present and appropriate
  • [ ] Edge cases handled
  • [ ] No hardcoded values that should be configurable
  • [ ] Follows project conventions
  • [ ] Tests pass (run them!)

Deep Review (Security/Critical Code)

  • [ ] Input validation present
  • [ ] No SQL injection, XSS, or other vulnerabilities
  • [ ] Authentication/authorization correct
  • [ ] Secrets not exposed
  • [ ] Data validation at boundaries
  • [ ] Consider: Would I sign off on this in production?

The "Explain It" Test

If you cannot explain why a piece of AI code works, do not ship it. Either:

  • Ask AI to explain it until you understand
  • Rewrite it yourself
  • Get a colleague to review
Key Takeaways
  • AI helps throughout the lifecycle: Planning, implementing, testing, documenting, maintaining
  • Focus on high leverage: Boilerplate, tests, docs, explanations
  • Know when to skip AI: Small changes, novel logic, when explanation overhead exceeds benefit
  • Always review: Use the checklist; never blindly trust AI output
  • Maintain your skills: Code without AI periodically; understand what you ship
Try It Yourself

Build something small but complete with AI assistance:

  1. Choose a mini-project:

- A CLI tool that does something useful - A simple API endpoint with validation - A React component with tests

  1. Use AI at each phase:

- Planning: "Help me break this down" - Implementation: "Write the core logic" - Testing: "Generate test cases" - Documentation: "Write the README"

  1. Track your experience:

- How long did each phase take? - Where did AI help most? - What did you still have to do yourself? - What would have taken longest without AI?

This exercise gives you real data on where AI fits in your workflow.

Sources