# Skill: generate-testplan Structured test plan from implementation plan / assessment. ## Invoked by 📋 Planner mode ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `TICKET_KEY` | Jira issue key | `ESIDEPAISY-12081` | | `MODULE` | PAISY module name | `eau`, `eubp`, `svmeldungen` | | `PLAN_PATH` | Path to plan.md | `docs/EAU/ESIDEPAISY-12081/ESIDEPAISY-12081-plan.md` | ## Output Markdown file: `docs///-testplan.md` ## Steps ### 1. Read the implementation plan Read `PLAN_PATH` to understand: - Which classes/methods are being added or modified - Which data flows are affected - Which database changes are involved (Flyway migrations, new tables/columns) - Which integration points exist (ServiceCenter, NATS, external APIs) ### 2. Read the assessment (if exists) Check for `docs///-assessment.md` — extract risk areas that need extra test coverage. ### 3. Identify testable units For each component in the plan: | Category | What to test | Test type | |----------|-------------|-----------| | New methods | Input/output, edge cases, null handling | Unit | | Modified methods | Regression + new behavior | Unit | | Database changes | Migration up/down, data integrity | Integration | | Data flows | End-to-end processing | Integration | | PAISY interaction | ServiceCenter calls, pgm responses | SSH (manual) | | Error paths | Invalid input, missing data, PAISY "F;" responses | Unit | ### 4. Generate test plan document Write `docs///-testplan.md` with this structure: ```markdown # Testplan: — **Datum:** **Modul:** **Autor:** Patrick Plate / Roo (Planner) **Status:** Entwurf v1 **Basis:** -plan.md --- ## Testübersicht | ID | Beschreibung | Typ | Klasse | Status | |----|-------------|-----|--------|--------| | T-01 | | Unit | | ⬜ | | T-02 | | Unit | | ⬜ | | T-03 | | Integration | | ⬜ | | T-nn | | SSH | manuell | ⬜ | Status: ⬜ Offen | ✅ Bestanden | ❌ Fehlgeschlagen | ⏭️ Übersprungen --- ## Testfälle ### T-01: **Typ:** Unit **Klasse:** `.` **Methode:** `test()` **Vorbedingungen:** - **Szenarien:** | # | Eingabe | Erwartetes Ergebnis | |---|---------|-------------------| | a | | | | b | | | | c | | | **Nachbedingungen:** - --- ### T-02: ... --- ## Testdaten ## Manuelle Tests (SSH) | ID | Instanz | Programm | Eingabe | Erwartetes Ergebnis | |----|---------|----------|---------|-------------------| | T-nn | | | | | ## Testabdeckung | Komponente | Unit | Integration | SSH | Gesamt | |-----------|------|-------------|-----|--------| | | 3 | 1 | 0 | 4 | | | 2 | 0 | 1 | 3 | | **Summe** | **5** | **1** | **1** | **7** | ``` ### 5. Cross-reference with plan Verify every implementation step in the plan has at least one test case: - New method → unit test - Modified method → regression test - Database migration → migration test - Integration point → integration test or SSH test Flag any gaps as warnings in the testplan. ### 6. Present to user - Show the test overview table - Explicitly ask: **"Testplan v1 erstellt mit Testfällen. GO / Feedback?"** - On feedback: revise and increment version ### 7. Store in BigMind ```python memory_store_fact( category="codebase", fact=f"{TICKET_KEY}: Testplan with {N} test cases (Unit: {u}, Integration: {i}, SSH: {s})" ) ``` ## Test Naming Conventions - Test class: `Test.java` or `Test.java` - Test method: `test__()` or `test()` for simple cases - Location: mirror source structure under `src/test/java/` - Base classes: extend existing test bases where available (e.g., `EAUFlywayMigrationTestBase`) ## Test ID Format - Sequential: T-01, T-02, ..., T-nn - Prefix by type if needed: UT-01 (unit), IT-01 (integration), MT-01 (manual/SSH) - IDs are stable — don't renumber on revision, append new tests at the end ## Language - Document content: **German** - Test method names and code: **English** (Java convention) - Scenario descriptions in the table: German