Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 906 Bytes

File metadata and controls

37 lines (26 loc) · 906 Bytes

🛠️ Troubleshooting - Lab 31: AI-Driven Refactor with Metrics

This guide captures the common issues and recovery steps documented for the lab.

Issue: Aider not working

# Use manual refactoring if AI tool unavailable
# Follow the template structure in refactored_calculator.py

Issue: Metrics show no improvement

# Verify you've actually reduced nesting
# Check that functions are smaller
# Ensure strategy pattern is implemented correctly

Issue: Tests failing after refactoring

# Review discount calculation logic carefully
# Use print statements to debug differences
# Compare outputs step-by-step with legacy version

Issue: Performance degraded

# Profile the code to find bottlenecks
(venv) toor@ip-172-31-10-244:~/ai-refactor-lab$ python3 -m cProfile -s cumtime refactored_calculator.py

# Consider caching strategy objects