Skip to content

Add expensetracker sample project with test coverage analysis - #9

Draft
hatcheric950 wants to merge 2 commits into
mainfrom
claude/test-coverage-analysis-lF3oG
Draft

Add expensetracker sample project with test coverage analysis#9
hatcheric950 wants to merge 2 commits into
mainfrom
claude/test-coverage-analysis-lF3oG

Conversation

@hatcheric950

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • Creates a small Python expense-tracking library (Account, Transaction, Budget, utils) with pytest + pytest-cov configured
  • Adds partial tests that intentionally cover only happy paths, leaving clear gaps for demonstration
  • Adds COVERAGE_ANALYSIS.md with a full breakdown of gaps and concrete proposed test cases

Coverage baseline (branch coverage enabled)

Module Cover Missing lines
account.py 69% 8, 10, 17, 23, 25, 36, 39
budget.py 19% 8–14, 17–21, 24–26, 29–31, 34
transaction.py 73% 18, 20, 22, 35, 43
utils.py 26% 11–13, 18–25, 32–33, 38–39
TOTAL 49%

Proposed improvements (priority order)

  1. budget.py — zero tests; core financial logic (overspend detection, category limits)
  2. account.py error paths — overdraft guard, invalid deposit/withdraw, history tracking
  3. utils.py — shared helpers untested; bugs here surface everywhere
  4. transaction.py validation — input guards and to_dict() serialisation

Full test cases for each area are in COVERAGE_ANALYSIS.md.

Test plan

  • pip install -e ".[dev]" succeeds
  • python -m pytest tests/ --cov=src/expensetracker --cov-report=term-missing -v — all 10 tests pass, coverage numbers match table above
  • Adding the proposed tests from COVERAGE_ANALYSIS.md raises overall coverage above 90%

https://claude.ai/code/session_01HwTh9hP2E3nye7NBvz6p86
EOF
)


Generated by Claude Code

claude added 2 commits June 3, 2026 03:01
Creates a small Python expense-tracking library (Account, Transaction,
Budget, utils) with intentional coverage gaps to demonstrate where tests
should be improved. Existing tests cover only happy paths in account.py
(69%) and transaction.py (73%), leaving budget.py (19%) and utils.py
(26%) nearly untested. COVERAGE_ANALYSIS.md documents the gaps and
provides concrete test cases for each area.

https://claude.ai/code/session_01HwTh9hP2E3nye7NBvz6p86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants