AHA Development: A Structured Approach of AI Pair Programming

Over the past year, Cursor has completely replaced my use of VS Code. I’ve also explored AI tools like Windsurf and Autopilot. While optimizing legacy systems and accelerating product iterations, I was inspired by my former colleague Woody Zuill’s Approval Testing method. Drawing from that and my own experiences, I’ve developed a practical process called AHA. By combining AI’s analytical and design capabilities with log-driven development and incremental validation, AHA offers a structured and controllable approach to AI-assisted coding.


AHA’s Core Steps

AHA consists of three key stages: Assess, Highlight, Approve. Here’s the breakdown:

🧪 1. Assess: Evaluate the Code’s Current State

The goal is to establish a baseline for behavior, avoiding blind changes.

  • Use AI tools (e.g., Cursor) and their intelligent analysis to add detailed trace logs
  • Run the system, capture logs, and record the current behavior as a baseline

This step harnesses AI’s analysis power to boost code observability and precisely capture runtime logic.

🔦 2. Highlight: Analyze Change Needs

Using the baseline logs, define business goals or optimization needs, and rely on AI’s intelligent design capabilities for code change suggestions.

  • Review code differences (diff) to assess the impact of changes
  • Compare logs to verify if behavior aligns with expectations

Here, AI acts as a pair programming partner, combining analysis and design skills to offer precise suggestions, with developers handling review and refinement.

✅ 3. Approve: Validate and Confirm

Confirm the effect of changes via log comparison:

  • ✅ If behavior meets goals: approve the change and commit it as the new baseline
  • ❌ If there’s a deviation: feed logs back to AI, iterate, and return to the Highlight step

Once validated, leverage AI’s intelligent generation to produce unit tests or documentation, enhancing code maintainability.


🛠 AHA Workflow in Detail

  1. Prompt AI (e.g., Cursor) to add detailed trace logs to the target function
  2. Run the system, generate baseline logs, and record initial behavior
  3. Describe optimization goals to AI, tapping its intelligent design for code change suggestions
  4. Review the code diff and refine any issues
  5. Rerun the system and generate new logs
  6. Compare baseline and new logs:
    • ❌ Inconsistent? Feed logs to AI for analysis, iterate, and optimize
    • ✅ Consistent? Confirm changes, request AI-generated tests or docs
  7. Commit changes to Git as the new baseline, then tackle the next function

✨ Where AHA Shines

AHA excels in these scenarios:

  • Legacy system refactoring: When documentation or tests are missing, careful behavior verification is essential.
  • Rapid product iteration: Ensures that code changes align with business requirements.
  • Performance optimization: Time-based logs help quickly identify performance bottlenecks.
  • Implementation of complex features: Enables gradual evolution through iterative steps, well-suited for agile teams that prefer small, incremental commits.

✅ Summary

AHA (Assess, Highlight, Approve) is a structured development method, blending log-driven observability, AI’s intelligent analysis and design capabilities, and Approval Testing’s validation logic. With tools like Cursor, AI becomes a powerful pair programming partner, helping developers optimize complex systems in controlled, incremental steps.

Share

0 comments

请输入正确的验证码