This guide captures the common issues and recovery steps documented for the lab.
# Use manual refactoring if AI tool unavailable
# Follow the template structure in refactored_calculator.py# Verify you've actually reduced nesting
# Check that functions are smaller
# Ensure strategy pattern is implemented correctly# Review discount calculation logic carefully
# Use print statements to debug differences
# Compare outputs step-by-step with legacy version# 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