Plan project and set up Phase 1 skeleton
CI / test (push) Successful in 54s

Add the framework submodule and the accepted planning documents:
Business Case, Stakeholder Analysis, Project Plan, three milestones,
review records RC-001 to RC-006 and the traceability matrix.

Set up the project skeleton for MIL-001: pyproject.toml (Python
>=3.13, no runtime dependencies, pytest/ruff/mypy as dev extra),
 src/coffee_machine/constants.py, a constants consistency test,
 Doxyfile and a CI workflow that runs ruff, mypy and pytest.

Task: MIL-001#1
Task: MIL-001#2
Task: MIL-001#3
Task: MIL-001#4
Task: MIL-001#5
Closes #1
Closes #2
Closes #3
Closes #4
Closes #5
This commit is contained in:
2026-10-07 10:43:22 +08:00
parent 7c7c15ddf9
commit c24f41207f
22 changed files with 1362 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
# Phase 1: Project Setup
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-001 |
| CrossReference | [BC-001], [SA-001], [PP-001] |
| Language | en |
| Domain | it |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-07 | Deprecated | Jens Tirsvad Nielsen | S01 | Initial version | pending |
| 2026-10-07 | Accepted | Jens Tirsvad Nielsen | S01 | Accepted after RC-003 (Go) | pending |
---
## Purpose
Decide whether the project skeleton, tooling and configuration are ready so that application code can be written on top of them.
## Deliverable
Repository skeleton with `pyproject.toml`, Python `.gitignore`, `src/`, `tests/`, `constants.py`, `Doxyfile` and a CI workflow that runs pytest.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | `pip install -e .[dev]` succeeds in a fresh `.venv` on Python 3.13+ | Met | Not met |
| 2 | `pytest` runs (collects zero or more tests) without configuration errors | Met | Not met |
| 3 | `[project] dependencies` in `pyproject.toml` is empty | Met | Not met |
| 4 | `.env` and `.venv` are ignored by `.gitignore` | Met | Not met |
| 5 | `doxygen Doxyfile` runs without errors | Met | Not met |
## Dependencies
| Depends on | Reason |
| --- | --- |
| None | First phase |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 2 and 3; success criteria 1 and 2 | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-09 — start of the course project, no external deadline.
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Add pyproject.toml | Configure the project with `requires-python >= 3.13`, a `src/` layout, no runtime dependencies and pytest as an optional `dev` dependency, so that setup is reproducible for S02. | No | |
| 2 | Review Python .gitignore | Confirm the Python `.gitignore` ignores `.venv/`, `.env`, caches and generated Doxygen output so tokens and build artefacts never reach the repository (risk in BC-001). | No | |
| 3 | Create src and tests skeleton with constants.py | Create `src/coffee_machine/` with `__init__.py` and `constants.py` (menu data, resources, coin values, command words) and an empty `tests/` package, following the coding conventions. | No | |
| 4 | Add Doxyfile | Add a Doxyfile configured for Python (`OPTIMIZE_OUTPUT_JAVA`, input `src/`, output `docs/api/`) so Doxygen comments in the source can be built into documentation. | No | |
| 5 | Configure CI workflow | Add a CI workflow for the git host that creates a venv, installs the project with the `dev` extra and runs pytest on Python 3.13, to be described in the README. | No | |
---
[BC-001]: ../business-case.md
[SA-001]: ../stakeholder-analysis.md
[PP-001]: ../project-plan.md
+76
View File
@@ -0,0 +1,76 @@
# Phase 2: Coffee Machine Program
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-002 |
| CrossReference | [BC-001], [SA-001], [PP-001] |
| Language | en |
| Domain | it |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-07 | Deprecated | Jens Tirsvad Nielsen | S01 | Initial version | pending |
| 2026-10-07 | Accepted | Jens Tirsvad Nielsen | S01 | Accepted after RC-004 (Go) | pending |
---
## Purpose
Decide whether the coffee machine program works as the assignment describes and is covered by tests.
## Deliverable
Python modules `menu`, `coffee_maker`, `money_machine` and `main` under `src/coffee_machine/`, with Doxygen comments, plus pytest tests under `tests/`.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | `Menu.get_items` and `Menu.find_drink` exist and return the menu text and the matching drink or nothing | Met | Not met |
| 2 | `CoffeeMaker.report`, `is_resource_sufficient` and `make_coffee` exist and behave as in the assignment | Met | Not met |
| 3 | `MoneyMachine.report` and `make_payment` exist and behave as in the assignment | Met | Not met |
| 4 | The main loop supports drink choice, `report` and `off` and checks resources before payment | Met | Not met |
| 5 | `pytest` passes and constants come from `constants.py` only | Met | Not met |
| 6 | Code review against `qc-programming-python` has a Go review record | Met | Not met |
## Dependencies
| Depends on | Reason |
| --- | --- |
| MIL-001 | Needs the skeleton, configuration and CI |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 1 and 2; success criteria 1 and 4 | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-14 — after Phase 1.
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Implement Menu and MenuItem | Create `MenuItem` (name, cost, ingredients) and `Menu` with `get_items` (drink names for the prompt) and `find_drink` (returns the item or None for an unknown name), reading data from `constants.py`. | No | |
| 2 | Implement CoffeeMaker | Create `CoffeeMaker` holding the resources, with `report`, `is_resource_sufficient` (prints which ingredient is short) and `make_coffee` (deducts ingredients). | No | |
| 3 | Implement MoneyMachine | Create `MoneyMachine` with `report` (profit), and `make_payment` that processes coins, gives change, adds profit and refunds when money is insufficient. | No | |
| 4 | Implement main loop | Create the entry point that keeps the machine running, accepts a drink name, `report` and `off`, and checks resources before taking payment before making coffee. The course supplies the design, so no separate use case is modelled (see PP-001 Open Issues). | No | |
| 5 | Write pytest tests | Test each class and the main loop (with patched `input`) for sufficient and insufficient resources, exact, excess and short payment, unknown drink, report and off. | No | |
| 6 | Review code against qc-programming-python | Review `src/` and `tests/` against the Python checklist and record the result as an RC before the pull request. | No | |
---
[BC-001]: ../business-case.md
[SA-001]: ../stakeholder-analysis.md
[PP-001]: ../project-plan.md
+73
View File
@@ -0,0 +1,73 @@
# Phase 3: Documentation and Publication
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-003 |
| CrossReference | [BC-001], [SA-001], [PP-001] |
| Language | en |
| Domain | it |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-07 | Deprecated | Jens Tirsvad Nielsen | S01 | Initial version | pending |
| 2026-10-07 | Accepted | Jens Tirsvad Nielsen | S01 | Accepted after RC-005 (Go) | pending |
---
## Purpose
Decide whether the repository is documented and presentable for S02 and S03.
## Deliverable
README following the course template, generated Doxygen documentation steps, and a repository description and topics on the git host.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | README has all template sections and the Windows, Debian and macOS venv steps including `python -m pip install --upgrade pip` | Met | Not met |
| 2 | Following the README on a clean clone runs the program and the tests | Met | Not met |
| 3 | `doxygen Doxyfile` produces documentation from the source comments | Met | Not met |
| 4 | Repository description and at least 3 topics are set on the git host | Met | Not met |
| 5 | README and LICENSE agree on the licence | Met | Not met |
## Dependencies
| Depends on | Reason |
| --- | --- |
| MIL-002 | Documents the finished program |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 3 and 4; success criteria 3 and 5 | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-16 — after Phase 2.
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Write README | Write `README.md` from the course template: requirements, set-up for Windows PowerShell, Debian and macOS using a local `.venv` and `python -m pip install --upgrade pip`, run, test, CI, Doxygen build, project layout and licence. | No | |
| 2 | Verify Doxygen build | Run Doxygen on a clean clone and check that classes and methods from the Doxygen comments appear in the output. | No | |
| 3 | Set repository description and topics | Set a short description and topics on the git host repository (`Tirsvad-Udemy-100_days_of_code`) through its API using the token from `.env`, which stays personal and is never read by the project code. Needs the Product Owner's go-ahead because it changes the remote. | No | |
| 4 | Verify setup from a clean clone | Follow the README from a fresh clone on the Product Owner's machine and fix any step that does not work. | No | |
---
[BC-001]: ../business-case.md
[SA-001]: ../stakeholder-analysis.md
[PP-001]: ../project-plan.md