Docs: Testzahlen aktualisiert (80 -> 96)
Nach Welle C/D: 54 Unit + 31 Integration + 11 Route = 96 Tests. README, PROJECT_STRUCTURE und tests/README entsprechend angepasst; Route-Test-Ausführung dokumentiert. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8eb7984468
commit
c722b89ae3
3 changed files with 31 additions and 17 deletions
|
|
@ -97,7 +97,7 @@ typewriter/
|
|||
- `setup_database.py` - Datenbank-Setup
|
||||
|
||||
### 🔴 Tests (versioniert)
|
||||
- `tests/` - Service-Layer Unit- & Integration-Tests (80 Tests)
|
||||
- `tests/` - Unit-, Integration- & Route-Tests (96 Tests)
|
||||
|
||||
### ⚫ Temporär/Generiert (NICHT versioniert)
|
||||
- `venv/` - Virtual Environment
|
||||
|
|
|
|||
32
README.md
32
README.md
|
|
@ -204,21 +204,21 @@ Die Statistik-Seite (`/statistics`) bietet:
|
|||
|
||||
## 🧪 Tests
|
||||
|
||||
Das Projekt enthält eine umfassende Test-Suite mit **80 Tests** (100% Erfolgsrate) und lokaler Validierung per Pre-commit-Hook.
|
||||
Das Projekt enthält eine umfassende Test-Suite mit **96 Tests** (100% Erfolgsrate) und lokaler Validierung per Pre-commit-Hook (ruff + Tests).
|
||||
|
||||
### Test-Übersicht
|
||||
|
||||
| Kategorie | Anzahl | Ausführungszeit | Status |
|
||||
|-----------|--------|-----------------|--------|
|
||||
| **Gesamt** | 80 Tests | ~2.9s | ✅ 100% |
|
||||
| **Unit Tests** | 54 Tests | 0.002s ⚡ | ✅ Bestanden |
|
||||
| **Integration Tests** | 26 Tests | 2.856s | ✅ Bestanden |
|
||||
| Kategorie | Anzahl | Status |
|
||||
|-----------|--------|--------|
|
||||
| **Gesamt** | 96 Tests | ✅ 100% |
|
||||
| **Unit Tests** | 54 Tests | ✅ Bestanden |
|
||||
| **Integration Tests** | 31 Tests | ✅ Bestanden |
|
||||
| **Route Tests** | 11 Tests | ✅ Bestanden |
|
||||
|
||||
### Test-Ausführung
|
||||
|
||||
**Service Layer Tests (80 Tests):**
|
||||
```bash
|
||||
# Alle Tests (Unit + Integration)
|
||||
# Alle Tests
|
||||
python -m unittest discover -s tests -p "test_*.py" -v
|
||||
|
||||
# Nur Unit Tests (schnell, ohne DB)
|
||||
|
|
@ -227,17 +227,23 @@ python -m unittest tests.test_lesson_service tests.test_statistics_service tests
|
|||
# Nur Integration Tests (mit DB)
|
||||
python -m unittest tests.test_integration_progress tests.test_integration_statistics -v
|
||||
|
||||
# Nur Route-Tests (Flask-Testclient)
|
||||
python -m unittest tests.test_routes -v
|
||||
|
||||
# Coverage Report generieren
|
||||
./run_coverage.sh
|
||||
```
|
||||
|
||||
### Was wird getestet?
|
||||
|
||||
**Service Layer Tests (`tests/`):**
|
||||
- ✅ **LessonService** (17): Navigation, Validierung, Edge Cases
|
||||
- ✅ **StatisticsService** (29): Berechnungen (ZPM/WPM), DB-Operationen, 30-Tage-Daten
|
||||
- ✅ **SettingsService** (22): Validierungen, Boundary Values
|
||||
- ✅ **ProgressService** (12): CRUD, State Management, Multi-Lesson Independence
|
||||
**Service Layer (Unit + Integration):**
|
||||
- ✅ **LessonService**: Navigation, Validierung, Edge Cases
|
||||
- ✅ **StatisticsService**: Berechnungen (ZPM/WPM), DB-Operationen, 30-Tage-Daten
|
||||
- ✅ **SettingsService**: Validierungen, Boundary Values
|
||||
- ✅ **ProgressService**: CRUD, State Management, Multi-Lesson Independence, Lektions-Auflösung
|
||||
|
||||
**Routes (`test_routes.py`):**
|
||||
- ✅ Seiten (`/`, `/train`, `/statistics`, `/settings`) und zentrale API-Endpoints inkl. CSV-Export
|
||||
|
||||
### Lokale Validierung
|
||||
|
||||
|
|
|
|||
|
|
@ -18,14 +18,22 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
|
||||
| Service | Test-Datei | Anzahl Tests | Status |
|
||||
|---------|-----------|--------------|--------|
|
||||
| **ProgressService** | `test_integration_progress.py` | 12 | ✅ Alle bestanden |
|
||||
| **ProgressService** | `test_integration_progress.py` | 17 | ✅ Alle bestanden |
|
||||
| **StatisticsService** | `test_integration_statistics.py` | 14 | ✅ Alle bestanden |
|
||||
|
||||
**Gesamt Integration Tests:** 26 Tests, alle bestanden ✅
|
||||
**Gesamt Integration Tests:** 31 Tests, alle bestanden ✅
|
||||
|
||||
### Route Tests (Flask-Testclient)
|
||||
|
||||
| Bereich | Test-Datei | Anzahl Tests | Status |
|
||||
|---------|-----------|--------------|--------|
|
||||
| **Routen & API** | `test_routes.py` | 11 | ✅ Alle bestanden |
|
||||
|
||||
**Gesamt Route Tests:** 11 Tests, alle bestanden ✅
|
||||
|
||||
### Gesamtübersicht
|
||||
|
||||
**Gesamt:** 80 Tests (54 Unit + 26 Integration), **alle bestanden** ✅
|
||||
**Gesamt:** 96 Tests (54 Unit + 31 Integration + 11 Route), **alle bestanden** ✅
|
||||
|
||||
### Hinweise
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue