v4.1.0 — Test Coverage 80% (P4-1 Complete)
v4.1.0 — Test Coverage 80% (P4-1 Complete)
🎯 Major Milestone
Test coverage increased from 35% → 80.51% (CI gate at 80% enforced). Test count grew from 153 to 559 passing tests.
📊 Coverage Breakdown
Newly tested modules (90-100% coverage)
utils/database.py: 70% → 100%utils/serialization.py: 90% → 100%utils/db_loader.py: 67% → 98%analysis/trend.py: 15% → 93%parsers/cnki.py: 19% → 93%parsers/pubmed.py: 14% → 93%parsers/wos.py: 40% → 92%viz/charts.py: 0% → 89%cli/help.py: 0% → 100%cli/main.py: 0% → 92%
Test additions
- 5 new test files for low-coverage CLI modules
- 17 new test files total (excluding conftest)
- Comprehensive
conftest.pywith shared fixtures - End-to-end CLI testing via Typer
CliRunner
🐛 Defects Discovered (not fixed in this release)
Documented via GitHub issues, scheduled for v4.1.1 or v4.2.0:
| # | Severity | Description |
|---|---|---|
| #15 | 🔴 Critical | empty-string int fields crash db_loader |
| #16 | 🟠 Major | Institution.name_en not serialized |
| #17 | 🟡 Minor | en/zh keywords not split back on load |
| #19 | 🟠 Major | trend baseline median polluted by burst |
| #20 | 🟢 Suggestion | trend strategy recomputes in second pass |
🔧 CI Improvements
- Coverage gate:
--cov-fail-under=80 - All ruff checks pass (lint clean)
- All 559 tests pass on Python 3.11/3.12
📦 Installation
pipx install citationer
# or
pip install citationer🛠 Development
git clone https://github.com/jbiter/citationer.git
cd citationer
pip install -e ".[all,dev]"
pytest tests/ --cov=src/citationer