Answer: Measured legacy Python code complexity, refactored the pricing logic into a strategy-based design, and validated the change with metrics, benchmarks, and correctness tests.
Answer: The main stack for this lab included Python 3.12, Radon, Pylint, Pytest, along with supporting Linux command-line validation and file-based project structure management.
Answer: refactored_calculator.py was one of the key implementation files used to deliver the main workflow for the lab and to keep the logic separated from helper commands and documentation.
Answer: Radon metrics, benchmark comparison, and six correctness test cases.
Answer: Average cyclomatic complexity reduced from 9.50 to 2.17.
Answer: Metrics-backed refactoring is useful when reducing technical debt without breaking production logic.
Answer: It maps closely to real operational workflows where automation, validation, and controlled execution are required before changes or outputs can be trusted.
Answer: Keeping commands.sh and output.txt separate makes the lab easier to review, reproduce, troubleshoot, and present in a portfolio-friendly format.
Answer: A practical next step would be to add stronger monitoring, structured logging, automated tests, and integration with surrounding services such as CI/CD systems, webhooks, or dashboards.
Answer: How to baseline code quality before changing legacy logic.