This repository is a practice resource for learning Test Driven Development (TDD) principles using the Yatzy game as the implementation example.
The Yatzy game serves as the practical foundation for understanding and applying TDD concepts. Through implementing the game's scoring and logic, you'll learn how to write tests first and develop features incrementally.
- Python 3.x - The programming language used
- pytest - Testing framework for writing and running tests
This project uses pytest for all testing. The development approach follows TDD principles:
- Write a test first (Red phase)
- Write minimal code to pass the test (Green phase)
- Refactor the code for clarity and maintainability (Refactor phase)
To run all tests:
pytestTo run tests with verbose output:
pytest -vTo run tests with coverage report:
pytest --cov=yatzyyatzy/- Main implementation of the Yatzy gametests/- Test suite validating the Yatzy implementation
- Clone the repository
- Install dependencies:
pip install pytest - Run the tests:
pytest - Explore the code and tests to understand the TDD approach used