Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.63 KB

File metadata and controls

31 lines (21 loc) · 1.63 KB

🎤 Interview Q&A - Test Strategy Upgrade

1. Why separate unit tests from integration tests?

Unit tests validate small components in isolation, while integration tests validate how those components work together in realistic workflows.

2. Why was Decimal used for prices and totals?

Decimal preserves predictable precision for monetary calculations and avoids floating-point rounding problems.

3. What benefit comes from descriptive assertion messages?

They make failures easier to diagnose because the reason for the expected behavior is written directly in the test.

4. What did pytest markers contribute?

Markers made it easy to run only unit tests or only integration tests depending on the feedback needed.

5. Why were fixtures used in the test suite?

Fixtures reduced duplication and provided consistent setup data for multiple tests.

6. What was the purpose of the integration order tests?

They confirmed that validation, stock reduction, order recording, and totals worked together as a complete workflow.

7. Why is coverage useful even when tests pass?

Coverage highlights which parts of the code were not exercised so the team can target remaining gaps.

8. What does a 94% coverage result communicate?

It shows strong overall test reach while still revealing a few lines that deserve additional attention.

9. Why include a wrapper script like run_tests.sh?

It gives operators and teammates one repeatable entry point for running the full test workflow.

10. How does this lab help in real DevOps practice?

It reinforces how confident releases depend on layered testing, not just manual checks or a single test type.