Koncepce testování CEPS HUB
Verze: 1.0 (návrh) · Stav: ke schválení Quality boardem Vlastník: QA Lead · Schvalovatelé: Head of Quality, CIO Vztah k dalším dokumentům:
- Test Policy definuje PROČ testujeme
- Master testovací strategie v2.2 definuje JAK testujeme (procesně)
- QA přístup (00-master) definuje quality gates napříč SDLC
- Tento dokument definuje JAK konkrétně testujeme — taxonomie testů, design, automation, perf/security/a11y/crypto, defekty, reporting, templates, CEPS-specifické scénáře
- Test Plan (per release) říká CO se v releasu testuje
0. TL;DR — co tento dokument přidává
Master strategie v2.2 a QA přístup definují procesní rámec. Tato koncepce vyplňuje metodologický obsah:
| Oblast | Co dokument přidává |
|---|---|
| Taxonomie testů | 22 typů testů s definicí, kdy/kde/kým/čím |
| Test design techniques | 12 formalních technik + exploratory + risk-based |
| Environments deep dive | Konfigurace DEV/TEST/PREPROD, refresh, data lifecycle |
| Test data | Synthetic generation, anonymization, fixtures, lifecycle |
| Automation framework | Page Object, BDD/TDD, patterns, flaky management |
| Performance methodology | Profily, baselines, capacity, ramp-up patterns |
| Security methodology | SAST/SCA/DAST/IAST/RASP, threat model, pentest scope |
| Accessibility | WCAG 2.1 AA workflow + axe-core + manual checks |
| Crypto/PKI | TLS, cert lifecycle, mTLS, HSM rotation drills |
| Contract/Integration | Pact patterns, WireMock, Testcontainers |
| E2E & Exploratory | Critical journeys, session-based charters |
| DR/Chaos | RTO/RPO measurement, controlled experiments |
| Defect lifecycle | Severity/priority, RCA workflow, retest |
| Reporting | Allure, ReportPortal, Grafana dashboards |
| Test maintenance | Flaky, deprecation, refresh policy |
| CEPS-specifika | OASYS, ENTSO-E TP, BPM Camunda, ECP/EDX |
| Templates | Test Plan, Test Case, Test Report, Risk, Charter |
1. Taxonomie testů — 22 typů
1.1 Kompletní mapa typů
| # | Typ | Účel | Prostředí | Forma | Vlastník | Frekvence |
|---|---|---|---|---|---|---|
| 1 | Unit | Izolovaná business logika | Build | Automatizované | DEV | Per commit |
| 2 | Component | Izolovaná komponenta s mocky | Build/CI | Automatizované | DEV + QA | Per commit |
| 3 | Integration | Spolupráce 2 komponent | CI/TEST | Automatizované | DEV + QA | Per merge |
| 4 | Contract (Provider) | API kontrakt strany producenta | CI | Pact verify | DEV + QA | Per commit |
| 5 | Contract (Consumer) | API kontrakt strany konzumenta | CI | Pact publish | DEV + QA | Per commit |
| 6 | API | REST/gRPC/GraphQL funkčnost | TEST | Newman/pytest | QA | Per release |
| 7 | Schema | OpenAPI/JSON Schema validation | CI/TEST | Schemathesis | QA | Per release |
| 8 | E2E (System) | Kompletní business flow | TEST/PREPROD | Playwright | QA | Per release |
| 9 | UI Smoke | Základní dostupnost UI | DEV/TEST/PROD | Playwright | QA | Per deploy |
| 10 | Visual Regression | Screenshot drift | TEST | Playwright + pixelmatch | QA | Per release |
| 11 | Accessibility | WCAG 2.1 AA compliance | TEST/PREPROD | axe-core + Lighthouse + manual | QA + UX | Per release UI |
| 12 | Functional / UAT | Business akceptace | PREPROD | Manuální | PO + business | Per release |
| 13 | Exploratory | Risk-based deep dive | TEST/PREPROD | Charter-based session | QA | Per release |
| 14 | Negative | Reakce na chybné vstupy | TEST | Auto + manuální | QA | Per release |
| 15 | Regression | Že se nic nerozbilo | TEST/PREPROD | Automatizované | QA | Před release |
| 16 | Smoke (post-deploy) | Stabilita po nasazení | DEV/TEST/PREPROD/PROD | Automatizované | QA + OPS | Per deploy |
| 17 | Performance — Load | Cílová zátěž | PREPROD | k6/JMeter | QA + SRE | Per release A |
| 18 | Performance — Stress | Bod zlomu | PREPROD | k6/JMeter | QA + SRE | Quarterly |
| 19 | Performance — Soak | Dlouhodobá stabilita | PREPROD | k6 | QA + SRE | Per release A |
| 20 | Performance — Spike | Rychlý nárůst | PREPROD | k6 | QA + SRE | Per release A |
| 21 | Performance — Capacity | Sizing limits | PREPROD | k6/JMeter | QA + SRE | Quarterly |
| 22 | Security — SAST | Statická analýza kódu | Build/CI | SonarQube/Semgrep | SecOps | Per commit |
| 23 | Security — SCA | Závislosti, CVE | Build/CI | Snyk/Trivy | SecOps | Per build |
| 24 | Security — Secrets | Plaintext secrets | Build/CI | gitleaks | SecOps | Per commit |
| 25 | Security — DAST | Runtime zranitelnosti | PREPROD | OWASP ZAP | SecOps | Per release |
| 26 | Security — IAST | Instrumentace v runtime | PREPROD | Contrast/Snyk Code (volitelně) | SecOps | Per release A |
| 27 | Security — Pentest | Manuální penetrační | PREPROD | Externí audit | SecOps | Ročně + při změně |
| 28 | Security — Container | Image scanning | Build | Trivy/Grype | DevOps + SecOps | Per build |
| 29 | Security — SBOM | Supply chain | Build | Trivy/Syft | DevOps | Per build |
| 30 | Crypto/TLS | TLS verze, ciphers | TEST/PREPROD/PROD | testssl.sh | DevSecOps | Per release + monthly |
| 31 | Crypto/Cert | Certifikáty, OCSP/CRL | TEST/PREPROD/PROD | Custom scripts | DevSecOps | Monthly |
| 32 | Crypto/HSM | Key rotation drill | TEST/PREPROD | Manual + automation | DevSecOps | Yearly |
| 33 | Crypto/Encryption | At-rest, in-transit | TEST/PREPROD | Custom + manual | DevSecOps | Monthly |
| 34 | mTLS | Klientské certifikáty | TEST/PREPROD | Automated | DevSecOps | Per release |
| 35 | DR — Backup restore | Obnovitelnost dat | PREPROD | Runbook | OPS + DevOps | Monthly |
| 36 | DR — Failover | HA komponentový | PREPROD | Runbook + auto | OPS + QA | Quarterly |
| 37 | DR — Full drill | End-to-end DR scénář | PREPROD | Manual + auto | OPS + QA + SRE | Pololetně |
| 38 | Resilience / Chaos | Fault injection | TEST/PREPROD (izolovaně) | Litmus/Chaos Mesh | DEV + OPS + QA + SEC | Yearly + při změně HA |
| 39 | Synthetic monitoring | Kontinuální PROD check | PROD | Grafana Synthetic | OPS | Continuous |
| 40 | Compliance | NIS2/ZKB/GDPR/ENTSO-E | Per regulace | Auto + manuální | SEC + DPO + QA | Per release + ročně |
Poznámka k číslování: 40 položek, protože některé "typy" v tabulce 4.2 Master strategie jsou agregované rodiny (např. "Security" = SAST + SCA + DAST + Container + SBOM = 5 typů). Tato koncepce je rozbalí na konkrétní řemeslné jednotky.
1.2 Pyramida & vážení testů (cílový poměr)
╱──────╲ Exploratory + UAT (5-8 %)
╱ Manual ╲ business akceptace, charter sessions
╱───────────╲
╱ E2E auto ╲ E2E (8-12 %)
╱ (Playwright) ╲ kritické business flows
╱─────────────────╲
╱ Integration + API ╲ Integration + Contract (20-25 %)
╱ (Pact, Schemathesis)╲ service-to-service, API contracts
╱───────────────────────╲
╱ Component + WireMock ╲ Component (15-20 %)
╱ (in-process, with mocks)╲
╱─────────────────────────────╲
╱ Unit tests ╲ Unit (40-55 %)
╱ (fast, isolated, JUnit) ╲ business logic, validators
╱───────────────────────────────────╲
Plus transverzální vrstvy mimo pyramidu (běží paralelně):
- Performance (PREPROD, periodicky)
- Security (CI + PREPROD + ročně pentest)
- Accessibility (per UI release)
- Crypto/PKI (per release A + měsíčně)
- DR / Resilience (kvartálně + pololetně)
- Synthetic monitoring (PROD continuous)
1.3 Test rodiny vs. typy
| Rodina | Typy v rodině | Kdy plánovat |
|---|---|---|
| Functional | Unit, Component, Integration, API, E2E, UAT, Negative, Exploratory | Per story / per epic |
| Non-functional / NFR | Performance (load/stress/soak/spike/capacity), Security (SAST/SCA/DAST/IAST/pentest), Accessibility, Crypto/PKI | Per release, NFR budget per epic |
| Compatibility / Cross-platform | Cross-browser, cross-OS, cross-device, cross-version | Per release UI |
| Reliability / Operational | DR, Failover, Backup restore, Chaos, Synthetic | Periodicky + per release A |
| Compliance / Regulatory | Audit log, NIS2 reporting drill, GDPR DSAR, ENTSO-E TP, ZKB SoD | Per release + ročně |
2. Test design techniques
2.1 Black-box techniky (formal)
| Technika | Kdy použít | Příklad CEPS |
|---|---|---|
| Equivalence Partitioning (EP) | Vstupní pole s rozsahy hodnot | Žádost o odstávku: doba trvání (min/max), typ prvku |
| Boundary Value Analysis (BVA) | Hranice rozsahů, off-by-one | Datum začátku/konce odstávky, časové okno schvalování |
| Decision Tables | Komplexní business rules | Schvalování odstávky podle (typ, distributor, doba, kolize) |
| State Transition | Stavové automaty | BPM workflow stavy žádosti (Draft → Submitted → Approved → Cancelled) |
| Use Case Testing | End-to-end scénáře | Plánovaná odstávka od podání po zveřejnění v ENTSO-E TP |
| Pairwise / Orthogonal | Hodně parametrů, málo času | Browser × OS × jazyk × role × scénář |
| Classification Tree | Strukturovaný výběr kombinací | Konfigurace integrace (protokol × auth × payload × retry) |
| Error Guessing | Zkušenost testera | NÚKIB portál: timeout, expired session, missing fields |
2.2 White-box techniky
| Technika | Kdy | Měření |
|---|---|---|
| Statement coverage | Unit testy | SonarQube min. dle kategorie (A: 80%) |
| Branch coverage | Unit testy s rozhodováním | Pro kategorii A doplňková metrika |
| MC/DC | Bezpečnostně-kritický kód (HSM, mTLS) | Pouze pro kategorii A vybrané moduly |
| Mutation testing | Validace kvality testů (ne kódu) | PIT Mutation pro vybrané moduly, čtvrtletně |
2.3 Experience-based techniky
| Technika | Kdy | Output |
|---|---|---|
| Exploratory Testing | Risk-based deep dive | Session charter + bug findings + heuristic notes |
| Checklist-based | Stabilní regrese, accessibility | WCAG checklist, smoke checklist |
| Error Guessing | Test stress hraničních stavů | Bug findings |
| Risk-based testing | Alokace úsilí dle rizika | Risk-weighted coverage |
2.4 Risk-based prioritization
Risk Score = Impact × Probability (z Master §2.2)
Pro každý epic / change vzniká:
1. Risk register (Jira issue type Risk)
2. Risk-weighted coverage matrix:
- Risk 1-4 → smoke + spot check
- Risk 5-9 → funkční + negativní
- Risk 10-15 → + integration + perf baseline
- Risk 16-25 → + DAST + pentest scope + DR drill consideration
2.5 Coverage typy a cíle
| Coverage typ | Měření | Cíl A | Cíl B | Cíl C |
|---|---|---|---|---|
| Requirements coverage | Xray traceability (UC → Test) | 100 % kritických UC | 90 % | 80 % |
| Code coverage (statement) | SonarQube | ≥ 80 % | ≥ 70 % | ≥ 60 % |
| Branch coverage | SonarQube | ≥ 70 % (A only) | – | – |
| Risk-weighted coverage | Risk × Test mapping | > 90 % Risk 10+ | > 80 % Risk 10+ | – |
| Integration coverage | Pact verify per integrace | 100 % | 100 % | per case |
| NFR coverage | NFR budget per epic | 100 % | 80 % | per case |
| Regression coverage | Auto regression / všechny regr. testy | ≥ 70 % | ≥ 50 % | ≥ 30 % |
| Accessibility coverage | WCAG 2.1 AA per UI page | 100 % public/employee | 100 % public | per case |
3. Test environments — kompletní specifikace
3.1 Environment matrix
| Prostředí | Účel | Data | Stabilita SLA | HW baseline | Owner | Refresh |
|---|---|---|---|---|---|---|
| DEV | Vývoj, lokální smoke | Synthetic | Best-effort | Container compose | DEV | Per deploy |
| TEST | Systematické QA, integrace | Anonymizovaná + synthetic | 5×16 (06:00-22:00 PD) | 60 % PROD | QA + DevOps | Měsíčně + na vyžádání |
| TEST-INT (volitelně) | Dedikované pro integraci s external (ENTSO-E sandbox) | Anonymizovaná + synthetic | 5×16 | 40 % PROD | QA + DevOps | Per release |
| PREPROD | UAT, perf, sec, finální | Anonymizovaná kopie PROD | 5×16 | 100 % PROD | QA Lead + OPS | Kvartálně + před UAT |
| PERF (volitelně dedikované) | Load/stress/soak | Synthetic + anonymized large set | 5×16 | 100 % PROD | SRE + QA | Před perf cyklem |
| DR | DR drill cílové | Replika z PROD | Aktivní HA | 100 % PROD | OPS | Per drill |
| PROD | Provoz | Reálná | 24×7 | Plný sizing | OPS | Pouze release proces |
3.2 Environment configuration baselines
Pro každé prostředí v Confluence "Environment Spec" (Master §5.4) doplnit:
SW komponenty (verzování):
- CEPS HUB version (Git tag)
- Camunda 8.5.x + ServiceTasks workers
- PostgreSQL 16.x + extensions (pgcrypto, pg_stat_statements)
- Kafka 3.6.x + Schema Registry + Connect
- Keycloak 24.x (OIDC, SAML)
- NGINX/Envoy reverse proxy
- Vault / KMS pro secrets
- Observability stack (Prometheus, Loki, OTel collector)
Network:
- Network topology diagram per env (AZ rozložení, redundance)
- Network policies (allowed inbound/outbound, NetworkPolicy YAML v Git)
- DNS, certifikáty (Let's Encrypt staging vs. produkční CA)
- Egress allowlist (ENTSO-E TP, NÚKIB portál — jen z PREPROD/PROD)
Test účty matrix:
- Per role (Žadatel, Schvalovatel, Dispečer, Admin, Auditor)
- IAM linkováno na Keycloak realm per env
- SoD (Segregation of Duties) test účty per kategorii rizika
- Service accounts pro mTLS integrace (rotace každých 90 dní)
Configuration drift detection:
- DEVOPS kontroluje týdně diff config vs. IaC Git repo
- Drift > 0 → ticket + investigation
3.3 Refresh policy + dependencies
| Co | Frekvence | Kdo | Závislosti |
|---|---|---|---|
| TEST data refresh | Měsíčně (1. úterý) + na vyžádání | DPO + DevOps | DPO sign-off, freeze deploy 4h |
| TEST config refresh | Per deploy | DevOps | Po smoke |
| PREPROD data refresh | Kvartálně + před UAT (T-3 dny) | QA Lead + DPO | DPO sign-off, freeze deploy 8h |
| PREPROD config refresh | Před RC | DevOps | RC tag k dispozici |
| PROD data | – | – | Nikdy mimo release |
| Performance baseline refresh | Per release A (PREPROD měření) | QA + SRE | Master §16.4 |
| Cert rotation | Per cert TTL | DevSecOps | Test plán per rotace |
3.4 Stop the environment — pravidla
QA může environmen "zastavit pro testování":
| Důvod | Postup | Eskalace |
|---|---|---|
| Configuration drift | Ticket DEVOPS, fix v config repo, redeploy | Při > 24h: QA Lead → DevOps Lead |
| Data corruption | Refresh request, pozastavit běžící testy | DPO + QA Lead |
| Unstable dependencies (external) | Notify v #ceps-qa, mock locally | Při > 4h: QA Lead → ARCH |
| Performance degradation | SRE diagnostika, perf baseline review | SRE → QA Lead |
4. Test data management
4.1 Data taxonomie
| Typ | Účel | Zdroj | Storage | Retence |
|---|---|---|---|---|
| Synthetic — seed | Deterministická reprodukce | Faker + seed | Git repo (yaml/json) | Vázáno na test case |
| Synthetic — generated | Velké datasety | k6 generator, Python factory_boy | Object store | 90 dní |
| Anonymized — full | Realistické testování | Tonic export from PROD | Encrypted object store | 90 dní + DPO sign-off |
| Anonymized — masked | UI demo, screenshots | Tonic mask | Encrypted | 30 dní |
| Reference data | Číselníky (země, prvky soustavy, distributoři) | Master + ENTSO-E CIM | Git repo | Trvale (versioned) |
| Boundary cases | Min/max, hraniční hodnoty | Manuálně udržováno | Git repo | Trvale |
| Negative cases | Nevalidní vstupy | Manuálně udržováno | Git repo | Trvale |
| Historical | Zpětné opravy zpráv | Anonymized PROD selektivně | Encrypted | Per scénář |
4.2 Anonymizace pipeline (rozšíření Master §7.2)
PROD ─► snapshot (read-only) ─► anonymization env (izolované) ─►
Tonic + custom rules ─► QA reviewer + DPO sign-off ─►
anonymized dataset ─► encrypted at-rest ─► TEST/PREPROD
Anonymization rules per data type:
| Pole | Strategie | Zachovává |
|---|---|---|
| Jméno, příjmení | Pseudonymizace (deterministic mapping) | Referenční integritu |
| Hash + @ceps-test.invalid | Doménu pro routing testů | |
| Telefon | Random valid format | Country code |
| IČO / DIČ | Faker + valid checksum | Length & format |
| Adresa | Tabulkový lookup (random + valid) | PSČ region |
| GPS | Jitter ±5 km | Region |
| Smluvní podmínky | Maskování (XXX-XXX) | Délku |
| ID zprávy (ENTSO-E) | Deterministic hash | Format mRID |
| Timestamps | Shift -7 dní (consistent) | Sequence |
| Tarify, ceny | Random in ±20 % | Pořadí magnitude |
| PII v logu | Drop / replace | Strukturu logu |
Audit:
- Anonymization script versioned v Git, code-reviewed
- DPO sign-off per export
- Audit log přístupů k anonymized data — 24 měsíců
4.3 Synthetic data factory pattern
Pro každou entitu (žádost, schválení, zpráva ENTSO-E) existuje
factory v qa/data-factories repo:
# příklad pattern (pseudokód)
class VypadekFactory:
def valid_default(self) -> Vypadek: ...
def valid_with_kolize(self) -> Vypadek: ...
def invalid_short_window(self) -> Vypadek: ...
def boundary_max_duration(self) -> Vypadek: ...
def boundary_min_duration(self) -> Vypadek: ...
def historical_correction_30d(self) -> Vypadek: ...
def out_of_order_timestamp(self) -> Vypadek: ...
Pravidla:
- Default = happy path
- Vždy mít metodu per boundary case
- Vždy mít metodu per negative case
- Seedable (deterministic reproducibility)
- Reference integrity zachována mezi faktory
4.4 Test data lifecycle
| Fáze | Akce | Owner |
|---|---|---|
| Plan | Test plan definuje data potřeby | QA Lead |
| Prepare | Factory + anonymization + import | QA + DevOps |
| Use | Test execution | QA |
| Validate | Data integrita po testu (referenční) | QA |
| Cleanup | Smazat ephemerní, archivovat persistent | QA + DevOps |
| Retire | Po expirace retence | DPO |
5. Test automation — framework a patterns
5.1 Automation strategy
Pro CEPS HUB platí 4 vrstvy automatizace:
| Vrstva | Co automatizujeme | Co NE |
|---|---|---|
| Unit + Component | 100 % business logic, validators, mappers | Trivial getters/setters |
| API + Contract | 100 % public API endpoints, všechny contracts | Internal-only endpoints (volitelně) |
| E2E | Top 20 critical journeys per modul | Edge cases s vysokou údržbou (→ exploratory) |
| NFR (perf/sec/a11y) | Per release povinné suites | Ad-hoc one-off (→ manual) |
Pravidlo: Pokud test má hodnotu jen v jednom releasu → manuální. Pokud má hodnotu opakovaně → automatizovat.
5.2 Framework choice
| Vrstva | Tool | Důvod | Alternativa zvažovaná |
|---|---|---|---|
| Unit (Java) | JUnit 5 + AssertJ + Mockito | Standard, integrace s Maven/Gradle | TestNG (zamítnuto pro inkonzistenci v týmu) |
| Unit (Python) | pytest + hypothesis | Property-based + readable | unittest (méně expresivní) |
| Component | JUnit + Testcontainers + WireMock | Realistic DB/messaging bez full deploy | Pure mocks (zamítnuto pro brittleness) |
| API | Postman + Newman (CI) + pytest pro complex flows | Tým zná Postman; pytest pro data-driven | REST Assured (méně Pythonic) |
| Contract | Pact (broker self-hosted) | De-facto standard, multi-language | Spring Cloud Contract (Java-only) |
| Schema | Schemathesis | OpenAPI-driven property testing | Manuální per endpoint (nepoužitelné) |
| E2E (web) | Playwright + TypeScript | Modern, robust, multi-browser | Cypress (1 origin limit), Selenium (legacy) |
| Visual | Playwright screenshots + pixelmatch | Lightweight, in-repo | Applitools (vendor lock) |
| Accessibility | axe-core (CI) + Lighthouse CI + manual checklist | Industry standard | – |
| Performance | k6 + scenario JS | Code-first, scriptable, OSS | JMeter (UI-heavy), Locust (Python-only) |
| SAST | Semgrep + SonarQube | Semgrep pro custom rules, SQ pro coverage + quality gate | – |
| SCA | Trivy + Snyk | Trivy OSS pro container, Snyk pro licence | OWASP DC (méně udržováno) |
| DAST | OWASP ZAP | OSS, automatable | Burp Suite (manual focus) |
| Container | Trivy + Cosign (signing) | Modern supply chain | Clair (legacy) |
| Chaos | Litmus + Chaos Mesh | Kubernetes-native | Gremlin (vendor) |
5.3 Patterns
Page Object Model (E2E):
// Příklad struktura
qa/e2e/
├── pages/
│ ├── ZadostOdstavkyPage.ts
│ ├── SchvalovatelDashboardPage.ts
│ └── ...
├── components/ // shared UI components
├── flows/ // business flows (compose pages)
│ ├── PodatZadostFlow.ts
│ └── SchvalitZadostFlow.ts
├── tests/
│ └── critical-journeys/
└── fixtures/ // test data
API testing pattern (pytest):
# Příklad struktura
qa/api/
├── conftest.py # session-scoped: client, auth, teardown
├── fixtures/
│ └── factories.py # data factories
├── tests/
│ ├── zadosti/
│ │ ├── test_post_zadost.py
│ │ ├── test_get_zadost.py
│ │ └── test_negative.py
│ └── ...
├── contracts/ # Pact consumer tests
└── utils/
Contract testing flow (Pact):
Consumer test ─► generates pact JSON ─► publish to Pact Broker ─►
Provider verify (in CI) ─► broker stores verification result ─►
can-i-deploy check before promote
Decision: WireMock vs Testcontainers
- WireMock — keď testujeme náš kód a externí service je stabilní (mock externí)
- Testcontainers — keď testujeme integraci s realnou závislostí (Postgres, Kafka)
5.4 Flaky test management
Definice flaky: Test, který v posledních 30 dnech selhal i prošel bez změny kódu nebo dat.
Workflow:
Flaky detected (ReportPortal trend) ─►
Auto-tag "flaky" ─►
Quarantine (vyřazen z PR gate, stále běží jako reportable) ─►
Owner má 5 prac. dní na fix nebo deprecation ─►
Po 5 dnech eskalace na QA Lead ─►
Po 10 dnech delete + ticket "test gap"
Pravidla:
- Flaky rate > 2 % → block release (G6 gate)
- Žádný retry > 2× v CI
- Žádný "sleep" v testech — use
waitFor/poll s timeout - Test izolace: každý test má svoje data (factory + cleanup)
- Test idempotence: opakované spuštění dá stejný výsledek
5.5 Test code review
Test PR má stejně přísný review jako produkční kód:
6. Performance testing methodology
6.1 Profily zátěže
| Profil | Cíl | Délka | Pattern | Kdy |
|---|---|---|---|---|
| Smoke load | Verify perf env funguje | 5-10 min | Constant 5-10 % cílu | Per perf cyklus start |
| Baseline | Reference měření aktuální verze | 30-60 min | Ramp-up to cíl + steady | Per release A |
| Load | Splnění SLA při cílové zátěži | 60 min | Steady at cíl | Per release A |
| Stress | Bod zlomu, degradace gracefully | 60-120 min | Ramp-up nad cíl do failure | Kvartálně |
| Soak | Memory leaks, resource degradation | 8-24h | Steady at 70-80 % cíl | Per release A |
| Spike | Chování při náhlém nárůstu | 30 min | Step 10% → 200% → 10% | Per release A |
| Capacity | Sizing pro plánování | 4-8h | Step ramp-up | Kvartálně |
6.2 NFR budget per endpoint
Pro každý kritický endpoint dokumentovaný v Performance Baseline (Master §16.4):
| Metrika | Definice | Cíl per kategorie |
|---|---|---|
| Latency p50 | Medián | A: ≤ 100 ms |
| Latency p95 | 95. percentil | A: ≤ 200 ms |
| Latency p99 | 99. percentil | A: ≤ 500 ms |
| Latency p99.9 | tail | A: ≤ 1000 ms (jen vybrané) |
| Throughput | RPS sustained | dle endpointu |
| Error rate | % HTTP 5xx + 4xx (mimo expected) | A: < 0.1 % |
| Saturation | CPU/RAM/IO při cíli | < 70 % |
| Connection pool | DB/HTTP exhaustion | žádná |
Regression pravidlo (Master §16.4 explicit): překročení baseline o > 10 % → formální Performance Regression Acceptance (varianta Risk Acceptance).
6.3 Performance test scenario template (k6)
Každý perf test má:
- Hypothesis — co testujeme (např. "Endpoint POST /zadost zvládne 100 RPS s p95 ≤ 200 ms")
- Setup — fixtures, auth tokens, warm-up
- Stages — ramp-up, steady, ramp-down (definovaná zátěž)
- Checks — per-request assertions
- Thresholds — SLA limity (test fail při překročení)
- Teardown — cleanup data
- Reporting — HTML + JSON output to k6 cloud / Grafana
6.4 Performance gate
| Gate | Kritérium | Action |
|---|---|---|
| G8 PREPROD | Baseline + Load + Soak PASS | block release při fail |
| Performance Regression | < 10 % vs baseline | block při >10 %, formal acceptance |
| Capacity headroom | ≥ 50 % CPU/RAM rezerva při cíli | warning při < 30 % |
6.5 Capacity planning
Kvartálně (vlastník: SRE):
- Load test s ramp-up nad cílovou zátěž
- Měření capacity per komponenta
- Update sizing model
- Recommendation pro infra (scale-up nebo scale-out)
7. Security testing methodology
7.1 Defense-in-depth coverage
┌──────────────────────────┐
│ External pentest │ Ročně + při změně (A)
│ (manual, expert) │
└──────────────────────────┘
│
┌──────────────────────────┐
│ DAST (ZAP) │ Per release (auto)
│ Runtime, black-box │
└──────────────────────────┘
│
┌──────────────────────────┐
│ IAST (volitelně) │ Per release A (auto)
│ Instrumented runtime │
└──────────────────────────┘
│
┌──────────────────────────┐
│ SCA (Trivy, Snyk) │ Per build (auto)
│ Dependencies, CVE │
└──────────────────────────┘
│
┌──────────────────────────┐
│ SAST (Semgrep, Sonar) │ Per commit (auto)
│ Static code analysis │
└──────────────────────────┘
│
┌──────────────────────────┐
│ Secrets (gitleaks) │ Per commit (auto)
│ No plaintext │
└──────────────────────────┘
│
┌──────────────────────────┐
│ Container scan (Trivy) │ Per build (auto)
│ Image, OS packages │
└──────────────────────────┘
│
┌──────────────────────────┐
│ SBOM (Trivy/Syft) │ Per build (auto)
│ Supply chain transparency│
└──────────────────────────┘
7.2 Threat modeling (per epic, kategorie A)
STRIDE kategorie pro každý nový komponent:
| Threat | Otázka | Mitigace check |
|---|---|---|
| Spoofing | Kdo se vydává za koho? | Auth (Keycloak), mTLS pro integrace |
| Tampering | Lze měnit data v tranzitu / at-rest? | TLS, signing, encryption at-rest |
| Repudiation | Lze popřít akci? | Audit log immutable |
| Information disclosure | Co může uniknout? | Encryption, RBAC, data classification |
| Denial of service | Lze zahltit? | Rate limiting, circuit breakers, autoscaling |
| Elevation of privilege | Lze obejít autorizaci? | SoD, RBAC test, principle of least privilege |
Output threat modelu:
- Threat list per komponent
- Mitigace per threat
- Test cases per mitigace (např. "Test 1.1: ne-auth user nemůže POST /zadost")
7.3 SAST configuration
Semgrep rulesets:
- OWASP Top 10 (default)
- CWE Top 25
- Custom ČEPS rules (např. "no plaintext key in code", "no SQL string concatenation")
SonarQube quality gate:
- 0 Critical, 0 High
- Code Smell density < 5 % (varování)
- Coverage gate (per kategorie)
- Duplicated code < 3 %
Per commit:
- Semgrep diff scan (jen change set)
- Gitleaks
- SonarQube full scan (mergeable size)
7.4 SCA + container scan
Trivy:
- Image scan při buildu (OS + packages + IaC + secrets)
- Severity threshold: 0 Critical, 0 High
- Mute povolen jen s expirací + důvodem v Trivy ignorefile (v Git)
Snyk:
- Application dependencies (Maven, npm, pip)
- License compliance (žádné GPL ve closed-source kódu)
- Auto-PR pro security updates
SBOM:
- CycloneDX format
- Uložen v artifact registry per build
- Diff scan vs. předchozí build (přidané závislosti = review)
7.5 DAST methodology (ZAP)
Per release v PREPROD:
1. Spin up auth context (test user per role)
2. ZAP baseline scan (passive) ─► all known endpoints
3. ZAP active scan (controlled) ─► known endpoints
- SQL injection, XSS, CSRF, IDOR, SSRF, XXE
4. Validate findings (false positive mute s odůvodněním)
5. Generate report
Pravidla:
- 0 High/Critical findings blokuje release
- Medium findings — risk acceptance s expirací
- DAST scope zaregistrován v Confluence per modul
7.6 Pentest scope (ročně + při změně, kategorie A)
RoE (Rules of Engagement):
- Scope: kategorie A komponenty (např. dispečerské, ENTSO-E integrace, BPM)
- Out of scope: PROD bez explicitního souhlasu (ČEPS-internal pentester pouze)
- Time-boxing
- Pre-coordination s OPS (žádný DoS)
- Report retention: 5 let, klasifikace "Critical" v DMS
Output:
- Findings prioritized (Critical/High/Medium/Low)
- Remediation tracker (Jira issue type "Security Finding")
- Re-test po fix
- Lessons learned do test gap backlogu
8. Accessibility testing methodology (WCAG 2.1 AA)
8.1 Coverage matrix
| Page type | Auto check (axe-core, Lighthouse) | Manual check |
|---|---|---|
| Login | ✓ | Keyboard nav, screen reader 1 path |
| Dashboard | ✓ | Keyboard nav, color contrast spot |
| Form-heavy (žádost) | ✓ | Keyboard nav full, screen reader full, error focus |
| Table-heavy (kalendář) | ✓ | Headers, captions, sort accessibility |
| Modal / dialog | ✓ | Focus trap, ESC close, ARIA live |
| Upload / download | ✓ | Keyboard nav, status announcement |
8.2 axe-core integration (CI)
Per UI test run:
Playwright + @axe-core/playwright ─►
inject axe ─► run rules ─► assert no violations[Critical+Serious]
Rule config:
- Default WCAG 2.1 AA ruleset
- Custom rules: ČEPS branding (focus indicator viditelnost, contrast min)
- Mute povolen jen s odůvodněním v repo
8.3 Lighthouse CI per page (release A)
- Performance ≥ 90
- Accessibility ≥ 95
- Best Practices ≥ 90
- SEO neměřeno (interní app)
8.4 Manual checklist (per release, public UI)
9. Crypto / PKI testing methodology
9.1 TLS testing (testssl.sh)
Per release + měsíčně:
# Příklad scope
testssl.sh --severity HIGH --jsonfile-pretty out.json https://api.ceps-hub.cz
Assertions:
- TLS 1.0, 1.1 — zakázáno
- TLS 1.2 — povoleno jen s strong ciphers
- TLS 1.3 — preferováno
- Heartbleed, POODLE, BEAST, CRIME — N/A
- HSTS — enabled, max-age ≥ 1 year
- Cert chain valid
- SSL Labs grade ≥ A (target A+)
9.2 Certificate lifecycle
| Aktivita | Frekvence | Owner | Alert |
|---|---|---|---|
| Cert inventory scan | Týdně | DevSecOps | New cert detected |
| Expiration check | Daily | DevSecOps | 60, 30, 14 days |
| OCSP/CRL fetch test | Per release | DevSecOps | Stuck OCSP |
| Cert renewal automation (ACME) | Per cert | DevOps | Renewal failure |
| Root CA / intermediate trust | Quarterly | SecOps | New CA distrust |
9.3 mTLS testing (ENTSO-E ECP/EDX, Kafka)
Per release:
9.4 HSM key rotation drill (ročně)
Scope:
- Keys: signing key (ENTSO-E messages), encryption key (at-rest)
- HSM: provider per ČEPS standard
Postup:
- Pre-flight: backup existing key (export wrapped), document current key reference
- Generate new key in HSM
- Re-encrypt sample data with new key
- Validate decrypt with new key
- Update application config to use new key
- Validate end-to-end (sample transaction)
- Decommission old key (per regulation retention)
9.5 Encryption at-rest validation
Měsíčně:
- DB volume encryption status (
pg_settings, cloud KMS check) - Backup encryption (per cloud provider attestation)
- Restore test: backup → restore → validate data accessible after decryption
10. Integration & contract testing
10.1 Contract testing (Pact) — workflow
Consumer-driven contracts:
1. Consumer team píše test svého očekávání API
pact.given('zadost-12345 exists').uponReceiving('GET /zadost/12345')
.willRespondWith({status: 200, body: {...}})
2. Test vygeneruje pact.json
3. Publish to Pact Broker (per branch / per consumer version)
4. Provider team v CI verifikuje:
pact-verifier --provider-base-url https://api... --pact-broker ...
5. Broker zaznamenává verification matrix:
Consumer v1.2 × Provider v2.1 = PASS
Consumer v1.2 × Provider v2.2 = FAIL
6. can-i-deploy check před deploy:
pact-broker can-i-deploy --pacticipant Provider --version v2.2 --to-environment production
Pravidla:
- Žádný breaking change v API bez consumer notify (Pact verification fails)
- Provider versioning semver
- Consumer pact tests v CI per commit
- Provider verification per merge
10.2 Schema testing (Schemathesis)
Pro každý OpenAPI-described endpoint:
schemathesis run --checks all --hypothesis-database :memory: \
https://api.../openapi.json
Generuje:
- Boundary value tests
- Schema validation
- Status code consistency
- Header validation
- Idempotence checks
10.3 Integration test patterns (Testcontainers)
@Testcontainers
class ZadostIntegrationTest {
@Container static PostgreSQLContainer db = ...
@Container static KafkaContainer kafka = ...
@Container static GenericContainer keycloak = ...
// Realistic deps, no global state, fast cleanup
}
Pravidla:
- Container start < 30s (pomocí small images, lazy init)
- Žádný shared state mezi testy
- Cleanup per @AfterEach
- Per-test isolation (random ports, fresh DB schema)
10.4 Service virtualization (WireMock)
Kdy WireMock místo Testcontainers:
- External service mimo náš tým (NÚKIB portal, banka API)
- External rate-limited service (ENTSO-E TP)
- Negative scenarios (5xx, timeout, malformed response)
Anti-patterns:
- WireMock pro vlastní službu (bez důvodu) — preferuj Testcontainers
- WireMock bez verifikace requestů (jen happy path)
- WireMock bez resetu mezi testy
11. E2E testing — critical journeys
11.1 Definice "Critical Journey"
Journey = business flow přes všechny systémy pro jednu user persona dosahující 1 business cíle.
CEPS HUB critical journeys (příklad):
| Persona | Journey | Touchpoints | Priorita |
|---|---|---|---|
| Žadatel | Podat plánovanou odstávku | UI → BPM → DB → notification | P0 |
| Žadatel | Korekce zpětně 30 dní | UI → BPM → DB → ENTSO-E TP | P1 |
| Schvalovatel | Schválit s podmínkou | UI → BPM → DB → notification | P0 |
| Dispečer | Detekce kolize 2 odstávek | UI → BPM → kolizní engine → notify Žadatel | P0 |
| Dispečer | Publikovat odstávku do ENTSO-E TP | BPM → ENTSO-E ECP → TP | P0 |
| Admin | Audit log export pro NIS2 | UI → DB query → export | P1 |
| Auditor | DSAR — výpis osobních údajů | UI → DB query → export | P1 |
| Operator | Failover dispečerského systému | OPS console → failover → resync | P0 |
11.2 E2E test scope rules
- 1 critical journey = 1 E2E test
- Test musí být deterministický (fixtures, no time-based race)
- Test musí být idempotentní (cleanup před + po)
- Test musí mít single responsibility (1 journey, ne 5)
- Test musí mít traceability (linknut na UC v Xray)
- Test časový limit: ≤ 5 min per test
11.3 E2E vs. lower-level test rozhodování
| Otázka | Pokud ANO → preferuj |
|---|---|
| Testuju logiku jednoho modulu? | Unit / Component |
| Testuju kontrakt mezi 2 službami? | Contract / Integration |
| Testuju end-to-end business flow přes UI? | E2E |
| Test je flaky a slow? | Posunout dolů (decompose) |
| Test je rychlý a stabilní? | Ponechat na E2E |
11.4 E2E infrastructure
- Playwright with parallel execution (4-8 workers)
- Browser pool: Chromium + Firefox + WebKit
- Trace + video + screenshot on failure
- Network HAR capture for debug
- Reporter: Allure (artefakty) + ReportPortal (trendy)
12. Exploratory testing — session-based
12.1 Charter pattern
Každá ET session má charter (5-W):
Charter ID: ET-{release}-{n}
What: Plánovaná odstávka — workflow schvalování
When: T-2 dny před release
Where: PREPROD env
Who: 1 QA, 2h session
Why: Risk-based (kategorie A, recent changes in BPM)
Heuristics to apply:
- SFDIPOT (Structure, Function, Data, Interface, Platform, Operations, Time)
- Boundary values around schvalovací časové okno
- Error guessing: timeout, expired session
Out of scope:
- Performance (covered by load test)
- Cross-browser (covered by E2E)
Test ideas (a priori):
- Kolize 2 schvalovatelů
- Storno schválené žádosti
- Schválení po expiraci
Notes (during session):
- [bug found] kolize → nedeterministic order
- [question] co když schvalovatel revokovaný uprostřed?
- [risk] nejasná error message při expiraci
Bugs filed: BUG-1234, BUG-1235
Time spent: 1h 45m
Coverage notes: 6 / 8 plánovaných oblastí
12.2 ET v cyklu releasu
| Fáze | ET aktivita |
|---|---|
| Refinement | ET na mockupech — feedback do AC |
| TEST early | ET na features po unit/integration pass |
| PREPROD | ET na complete release candidate, risk-driven |
| Post-release (T+3 dny) | ET pre-mortem — co bychom testovali jinak |
12.3 Cíl ET sessions
- 10-20 % testovacího času pro kategorii A
- 5-10 % pro B
- Ad-hoc pro C
13. Smoke / Regression / UAT — standardy
13.1 Smoke test standard
| Smoke level | Doba | Počet TC | Pokrytí |
|---|---|---|---|
| DEV post-deploy | < 3 min | 5-10 | Aplikace startuje, login, health |
| TEST post-deploy | < 10 min | 15-20 | Critical journeys (happy path) |
| PREPROD post-deploy | < 15 min | 20-30 | Critical journeys + integrace check |
| PROD post-deploy | < 10 min | 10-15 | Smoke read-only + synthetic warm-up |
Pravidla:
- Smoke je 100 % automatizovaný
- Smoke je 100 % deterministický (failed smoke = real problem)
- Smoke fail → auto-rollback (Master §15.3)
13.2 Regression suite standard
Regression suite = sada testů spuštěných před každým release do PREPROD.
Pravidla pro inclusion:
- Critical journey covered
- Stability ≥ 95 % (flaky rate < 5 %)
- Maintenance cost rozumný (automation effort < manual exec × 5)
- Pokrývá P0 nebo P1 issues z minulosti
Pravidla pro exclusion (move to archive nebo delete):
- Test neselhal 12+ měsíců a žádný change v dotčené oblasti → archive
- Test je flaky a fix > 1h effort → delete + replace
- Test pokrývá deprecated funkčnost → delete
Triáž v Test Closure (Master §11.4):
- Z TEST cyklu nové testy → review pro regression
- Stávající regression → review per release
13.3 UAT standard
UAT (User Acceptance Testing) workflow:
T-7 dní: PO + QA sestaví UAT scope (business scenarios)
T-5 dní: PREPROD env stabilizován, data refresh complete
T-3 dní: UAT kickoff meeting (business + PO + QA observer)
T-1 dní: UAT execution day(s)
T: Go/No-Go meeting s UAT report
UAT pravidla:
- UAT scenarios = business acceptance criteria, ne technical tests
- UAT executor = real business user (ne QA)
- QA role = observer, support, evidence collection
- 100 % critical scenarios PASS pro Go
- Each finding → categorize (bug / feature gap / UX improvement)
13.4 UAT vs. funkční testy
| Otázka | Funkční (QA) | UAT (business) |
|---|---|---|
| Cílem je verifikovat | technical correctness | business value |
| Executor | QA | Real user |
| Prostředí | TEST | PREPROD |
| Doba | per sprint | před release |
| Sign-off | QA Lead | PO + business stakeholder |
14. DR / Failover / Chaos testing
14.1 DR drill cadence (Master §17.2)
| Aktivita | Frekvence | Vlastník | Scope |
|---|---|---|---|
| Backup restore (online/hot) | Měsíčně | DEVOPS | Single DB |
| Backup restore (offline/WORM) | Pololetně | OPS | All critical DBs |
| Data integrity check | Měsíčně | DEVOPS | Checksum, decrypt |
| Component failover | Kvartálně | OPS | Per komponenta (DB, Kafka, app) |
| Full DR drill | Pololetně | OPS + QA + SRE | End-to-end DR scenario |
| Resilience / chaos | Ročně + při změně HA | DEV + OPS + QA + SEC | Schválený scénář |
| NÚKIB incident drill | Ročně | SEC + DPO | Reporting pipeline |
| HSM key rotation | Ročně | DevSecOps | Per HSM |
14.2 Full DR drill scope (pololetně)
1. Trigger: scheduled, kategorie A scope
2. Notify: stakeholders (T-7 days)
3. Snapshot PROD baseline (RTO/RPO measurement reference)
4. Simulate disaster (controlled, izolovaný cluster):
- Region/AZ outage
- DB primary unavailable
- Network partition
5. Execute DR runbook
6. Measure:
- Actual RTO vs target (A: 1h, B: 4h, C: 24h)
- Actual RPO vs target (A: 15 min, B: 1h, C: 24h)
- Kafka/messaging resync lag
- Transaction consistency
7. Post-drill:
- Report (Master §17.3)
- Action plan per finding
- Updated runbook
14.3 Chaos / fault injection (ročně, kategorie A)
Hypothesis-driven experiments:
Hypothesis: System maintains < 1 % error rate when DB primary fails over
Steady state: Error rate < 0.1 %, p95 < 200 ms
Method: Kill DB primary container (controlled)
Blast radius: PREPROD only, isolated cluster
Stop conditions: Error rate > 5 %, p95 > 1 s
Observation: 10 min
Rollback: Restart primary or restore from snapshot
Závazná pravidla (Master §4.2):
- Pouze v izolovaném TEST/PREPROD
- Schválený scénář (Security + ARCH + OPS sign-off)
- Pre-flight: snapshot + rollback plan
- Run-time monitoring (live)
- Stop conditions definované
- Post-mortem povinný
14.4 Synthetic monitoring (PROD continuous)
| Check | Frekvence | Alert |
|---|---|---|
| Main business flow (login → dashboard) | 5 min | 2× po sobě fail |
| Critical integration (ENTSO-E TP heartbeat) | 15 min | 2× po sobě fail |
| Critical API endpoints | 5 min | 2× po sobě fail |
| Cert expirace | Daily | 60, 30, 14 days |
| TLS config | Weekly | Grade pokles |
15. Defect management — kompletní lifecycle
15.1 Defect lifecycle (rozšíření Master §10)
┌──────────────────────────────────────────────┐
│ │
▼ │
┌─────────┐ ┌──────────┐ ┌──────────────┐ ┌─────────┐ ┌────────┐
│ OPEN │───►│IN PROGRESS│───►│FOR APPROVAL/ │───►│RESOLVED │───►│ CLOSED │
│ │ │ │ │READY FOR RETEST│ │ │ │ │
└─────────┘ └──────────┘ └──────────────┘ └─────────┘ └────────┘
▲ ▲ │ ▲
│ │ (retest fail) │ │
│ └──────────────────┘ │
│ │
└──────────── (regress after close) ───────────────┘
Doplněné stavy / přechody (oproti Master §10.1):
- DEFERRED — defekt akceptovaný do dalšího releasu (waiver), z OPEN přes RACE
- DUPLICATE — z OPEN, link na master defekt
- CANNOT REPRODUCE — z IN PROGRESS po failed RCA, vrací do OPEN po nové evidence
15.2 Defect template (povinná pole)
ID: BUG-{release}-{n}
Title: [Module] — concise description
Severity: S1 / S2 / S3 / S4 (technical impact)
Priority: P1 / P2 / P3 / P4 (urgency)
Environment: DEV / TEST / PREPROD / PROD
Found in: Build / Release
Found by: Tester / Automation / Production / Customer
Found via: Manual / Automation / Synthetic / Incident
Steps to reproduce:
1. ...
2. ...
3. ...
Expected result:
...
Actual result:
...
Evidence:
- Screenshot: [link]
- Video: [link]
- HAR: [link]
- Logs (excerpt):[link]
- Trace: [link]
Affected components:
- ...
Affected user roles:
- ...
Workaround:
- [None / Description]
Linked artifacts:
- Test Execution: [Xray TE]
- Test Case: [Xray TC]
- Story / Epic: [Jira]
- Risk: [Jira RISK-X]
- Fix version: [Release]
Root cause (filled after fix):
- Category: [Code / Config / Data / Design / 3rd-party]
- Detail: ...
- Prevention: [Test gap / Code review / Design review / Monitoring]
15.3 Root Cause Analysis (RCA)
Povinné pro:
- P1 defekty v PROD (vždy)
- P1/P2 defekty escaped to PROD (post-release)
- Critical incidents
RCA workflow:
- Immediate — stabilize (hotfix, rollback, mitigation)
- Investigation — 5 Whys, timeline, evidence collection
- Root cause — single sentence
- Contributing factors — list
- Corrective actions — short-term + long-term
- Preventive actions — system changes, process changes, test gap
- Lessons learned — into retro + knowledge base
Output: Post-Mortem document (do 5 prac. dní po incident).
15.4 Retest a regression check
Per fix:
| Krok | Owner | Evidence |
|---|---|---|
| Fix implementuje + unit test pro fix | DEV | Code review + unit test in PR |
| Defect → FOR APPROVAL/READY FOR RETEST | DEV | Jira state |
| Retest QA | QA | Test execution v Xray, screenshot |
| Pokud PASS → RESOLVED | QA | Comment + evidence link |
| Pokud FAIL → IN PROGRESS | QA | Failure detail comment |
| Regression check (impact area) | QA | Regression suite execution |
| CLOSED po release verification | QA Lead | Release report |
15.5 Severity x Priority decision matrix (rozšíření §10.2)
| P1 (now) | P2 (release) | P3 (next sprint) | P4 (backlog) | |
|---|---|---|---|---|
| S1 Critical | Default | Vzácně (low usage area) | – | – |
| S2 High | Možné (regulační okno: blízko ENTSO-E deadline) | Default | – | – |
| S3 Medium | – | Možné (před release blocker) | Default | – |
| S4 Low | – | – | Možné (kosmetika v veřejné stránce) | Default |
15.6 Escalation triggers (rozšíření §10.4)
| Stav | Action |
|---|---|
| P1 PROD > 60 min unresolved | CIO + COO + Quality Board notify |
| P1 PROD během kritického okna (ENTSO-E deadline, regulatorní reporting) | CIO + COO + relevant business |
| P2 PREPROD > 4h before scheduled release | PM + QA Lead + escalation block release |
| Repeated S1 in same area > 3× / quarter | ARCH review + technical debt initiative |
16. Test estimation a planning
16.1 Bottom-up estimation (per UC) — rozšíření Master §20
| Položka | Default (man-days) | Adjustments |
|---|---|---|
| Test design (per UC) | 0.5 | +50 % pokud regulatorní; -25 % pokud podobné existuje |
| Test data preparation | 0.25 | +100 % pokud anonymized PROD potřeba |
| Manual execution (per UC) | 0.5 | +50 % pokud multi-role nebo multi-env |
| Automation (per UC) | 1-2 | UI: 2, API: 1, Unit: 0.2 |
| Defect investigation (per defect) | 0.25 | + RCA effort |
| Retest (per defect) | 0.1 | – |
| Documentation | 0.5 per epic | + per audit cycle |
Formula:
Total effort =
(Design + Data + Execute + Automate)
× Integration_Factor (1.0-1.8)
× Risk_Factor (1.0-1.5 dle kategorie)
+ Defect_Investigation (estimated 5-15 % effort)
+ Buffer (1.2-1.4 podle uncertainty)
16.2 Top-down estimation — T-shirt sizing (rozšíření §20.2)
| Velikost | Sprint points | Doba | QA team | Typical scope |
|---|---|---|---|---|
| XS | < 50 | < 1 sprint | 0.5 QA | hotfix, malá feature |
| S | 50-200 | 1 sprint | 1 QA | new endpoint, small UI |
| M | 200-500 | 2 sprinty | 2 QA | new module |
| L | 500-1000 | 3 sprinty | 3 QA | new integration |
| XL | 1000-2000 | 4-6 sprintů | dedicated QA tým | new product area |
| XXL | > 2000 | 6+ sprintů | matrix QA tým | platform-level change |
16.3 Plán per release (rozšíření Master §1.2)
Test Plan obsahuje:
- Scope (what's IN, what's OUT)
- Test types per scope (function / NFR / compliance)
- Risk register (per release)
- Test environments + data plan
- Schedule (per phase: design, prep, exec, regress)
- Resource allocation (QA, automation, SRE)
- Dependencies (external systems, data refresh)
- Entry / Exit kritéria (per phase)
- Acceptance criteria summary
- Effort estimation + buffer
- Risk assessment + mitigation
- Reporting cadence
- Go/No-Go criteria
16.4 Estimation evidence
Per release v Test Closure (Master §11.4):
- Estimated effort vs actual (variance)
- Defect rate estimated vs actual
- Lessons learned → tunning estimation model
17. Reporting & dashboards
17.1 Real-time dashboards (Grafana + ReportPortal)
Quality dashboard (Grafana, role-aware):
| Panel | Data | Audience |
|---|---|---|
| Quality Gate pass rate (overall) | Quality Studio | HoQ |
| Quality Gate pass rate per release | Quality Studio | PM, PO |
| Defect trend (open/closed by severity) | Jira | QA Lead |
| Escaped defects | Jira + monitoring | HoQ, QA Lead |
| Flaky rate trend | ReportPortal | QA Automation |
| Coverage per kategorie | SonarQube | Dev Lead |
| Performance baseline trend | k6 + Grafana | SRE, QA |
| Security findings trend | SAST/SCA/DAST | SecOps |
| SLO compliance per service | Prometheus | SRE |
| Test execution velocity | Xray | QA Lead |
| Automation coverage trend | Xray + Quality Studio | QA Automation |
17.2 Test execution reports (ReportPortal + Allure)
Per test run:
- Pass/Fail per test
- Duration trend
- Flake history per test
- Failure category (network, data, code, infra)
- Linked artefakty (screenshots, video, trace, HAR, logs)
Per release:
- Cumulative pass rate
- Defect leakage (% found in TEST / PREPROD / PROD)
- Mean Time to Detect (MTTD) per defect
- Mean Time to Resolve (MTTR) per defect
17.3 Weekly QA report (rozšíření Master §13)
Povinné sekce:
- Executive summary (3-5 vět) — kde stojí kvalita
- Phase status — current phase + milestones
- Coverage — UC, code, automation per modul
- Defect trend — open/closed týden vs minulý, top 5 critical
- Risk register changes — nová rizika, changes
- Integration status — externí systémy (ENTSO-E TP, NÚKIB)
- Environment health — stability, downtime, drift
- Gate status — current phase entry/exit
- Performance trend — perf baseline status
- Security findings — new findings, remediation status
- Go/No-Go recommendation — pre-release
- Blockers + help needed
17.4 Release report (per release)
Obsah Release Evidence Pack (z QA přístupu, Příloha B) +:
- Comparison vs predcházející release (defect rate, coverage, perf)
- Lessons learned summary (z retro)
- Test gap backlog status
17.5 Audit reporty (per regulace)
NIS2 audit pack:
- Audit log test evidence
- DR drill reports (s RTO/RPO measurement)
- Incident reporting drill protocol
- SBOM per release
ZKB audit pack:
- Pentest reports (5 let)
- ISMS audit
- SoD test evidence
- Backup integrity log
- Crypto/TLS scan history
GDPR audit pack:
- Anonymization sign-offs (DPO)
- DSAR test execution
- Access audit log
ENTSO-E audit pack:
- TP sandbox test reports
- CIM compliance evidence
18. Test maintenance
18.1 Test refresh policy
| Trigger | Action | Owner |
|---|---|---|
| AC change in story | Update Test Case in same sprint | QA |
| API contract change | Update Pact + Test (DEV + QA pair) | DEV + QA |
| UI selektor changes (Test Builder Agent detekuje) | Auto-PR for selector update | QA Automation |
| Performance baseline drift > 10 % | Investigation + baseline refresh | SRE + QA |
| Flaky rate > 2 % per test | Quarantine + 5-day fix | QA Automation |
| Test age > 30 days no update against code change | Mark stale (Test Builder Agent) | QA Automation |
| Test deprecation (feature removed) | Delete test + Xray archive | QA |
18.2 Test debt management
Quarterly review (vlastník: QA Lead):
- Tests by age (oldest 10 %)
- Tests by flake rate (top 5 %)
- Tests by execution time (top 10 %)
- Tests by maintenance cost (per failure investigation hours)
- Decision: refactor / archive / delete
18.3 Test refactoring patterns
| Anti-pattern | Refactor to |
|---|---|
| Test depends on test order | Each test independent + fresh data |
| Test sleeps fixed time | Wait-for-condition with timeout |
| Test has hardcoded URLs/secrets | Config + secret injection |
| Test has > 50 lines | Decompose: setup / action / assert helpers |
| Test name unclear | Rename: should_X_when_Y_given_Z |
| Test pokrývá > 1 scenario | Split into focused tests |
| Test asserts > 5 things | Split or use single composite assertion |
19. CI/CD integration
19.1 Pipeline stages (GitLab CI)
stages:
- validate # lint, format, dependency check
- build # compile, package
- unit # unit + component tests
- sast-sca # Semgrep + Trivy + Sonar + gitleaks
- container # image build + Trivy scan + Cosign sign + SBOM
- integration # Testcontainers, Pact verify
- deploy-dev # auto
- smoke-dev # post-deploy smoke
- api-test # Postman/pytest API suite
- e2e-test # Playwright critical journeys
- deploy-test # manual / scheduled
- regression # full regression suite
- perf-baseline # k6 baseline (PREPROD)
- dast # ZAP scan (PREPROD)
- deploy-preprod # manual approval
- uat-window # manual (UAT execution)
- deploy-prod # manual approval (CIO/CAB)
- smoke-prod # post-deploy smoke
- learning # async: telemetry analysis, escaped defect detection
19.2 Parallel execution + sharding
- Unit tests: parallel by module
- API tests: parallel by suite
- E2E tests: sharded across 4-8 workers
- Performance: sequential (avoid noisy neighbor)
19.3 Test result aggregation
Per pipeline run:
JUnit XML ─►
ReportPortal (trend) +
Xray (test execution) +
Quality Studio (gate decision) +
Allure (artefakty)
19.4 Selective test execution
Per MR:
- Affected modules detection (changed files → mapped to test suites)
- Run: unit + component for affected modules + smoke
Per main merge:
- Full unit + integration + smoke + contract
Per release branch:
- Full regression + perf baseline + security
20. CEPS-specific testing patterns
20.1 OASYS integration testing
Scope: Dispečerský systém ABB, OASYS export/import.
Test patterns:
- Datový formát kompatibility (OASYS spec)
- Synchronizace stavů (CEPS HUB ↔︎ OASYS)
- Reconciliation per den (diff detection)
- Failover during data sync
Test data:
- Anonymizovaný OASYS dataset (DPO sign-off)
- Synthetic boundary cases (max prvků, max odstávek)
20.2 ENTSO-E TP testing
Scope: Transparency Platform reporting (Commission Regulation EU 543/2013).
Test patterns:
- CIM data model compliance (XML schema validation)
- mRID uniqueness
- Time-series consistency (UTC, DST handling)
- Sandbox publication (ENTSO-E TP sandbox)
- Re-submission (correction within retention window)
Test data:
- Reference CIM datasets (versioned in Git)
- Sandbox account per env
20.3 BPM (Camunda 8.5) testing
Scope: Workflow engine pro schvalování.
Test patterns:
- Process instance creation
- Task assignment per role (RBAC)
- Decision tables (DMN) validation
- Boundary timers (escalation)
- Error events + compensation
- Migration of running instances on version change
Test framework: Camunda Test SDK + pytest
20.4 ECP/EDX testing
Scope: Energy Communication Platform + Data Exchange (mTLS).
Test patterns:
- mTLS handshake (client cert, server cert chain)
- Message signing + verification (ENTSO-E key)
- Retry / dead-letter handling
- Idempotence (duplicate message ID)
- Time-window validation
20.5 Kafka integration testing
Scope: Event streaming.
Test patterns:
- Producer-consumer contract
- Schema evolution (Schema Registry, backward compatibility)
- Partition assignment / rebalance
- Exactly-once semantics (idempotent producer, transactional consumer)
- Resync after failure
- Max lag thresholds
Tools: Testcontainers KafkaContainer + Schema Registry mock
20.6 PostgreSQL testing
Scope: Main DB.
Test patterns:
- Migration safety (Flyway/Liquibase forward + rollback)
- Index utilization (EXPLAIN ANALYZE in CI for new queries)
- Connection pool exhaustion
- Long-running query detection
- Backup integrity (pg_dump + restore + checksum)
- Point-in-time recovery (PITR) drill
20.7 Audit log testing (NIS2 vyžaduje)
Per release povinné:
21. TMMi L3 mapping
Cíl 2026 = TMMi Level 3 (Defined). Mapování process areas na tuto koncepci:
| TMMi PA | Pokrytí v této koncepci |
|---|---|
| PA 3.1 Test Organization | §6 RACI (v QA přístupu), §22 Training (Master §22) |
| PA 3.2 Test Training Program | Master §22 (zachováno) |
| PA 3.3 Test Lifecycle and Integration | §1 Taxonomy + §4 (process layer v QA přístupu) |
| PA 3.4 Non-Functional Testing | §6 Performance, §7 Security, §8 Accessibility, §9 Crypto |
| PA 3.5 Peer Reviews | Master §11.3 (zachováno) + test PR review §5.5 |
Cíl 2027 = TMMi Level 4 (Measured) v oblastech kategorie A:
| TMMi PA | Pokrytí |
|---|---|
| PA 4.1 Test Measurement | §17 Reporting + Quality Studio metrics |
| PA 4.2 Product Quality Evaluation | §15 Defect mgmt + escaped defect analysis |
| PA 4.3 Advanced Reviews | Multi-disciplinary review (QA + ARCH + SecOps) |
| PA 4.4 Defect Prevention | RCA → corrective + preventive actions → test gap loop |
22. Templates
22.1 Test Plan template
# Test Plan — {Release ID / Project}
## 1. Identifikace
- Release: ...
- Kategorie: A / B / C
- Vlastník Test Planu: QA Lead {jméno}
- Schvalovatel: PM + QA Lead
## 2. Scope
### V scope
- ...
### Out of scope
- ...
## 3. Testovací typy a rozsah
| Typ | Scope | Owner |
|---|---|---|
| Unit | ... | DEV |
| Integration | ... | DEV+QA |
| API | ... | QA |
| E2E | ... critical journeys | QA |
| Performance | ... (load + baseline) | SRE+QA |
| Security | SAST + SCA + DAST | SecOps |
| Accessibility | ... | QA+UX |
| ... | ... | ... |
## 4. Test Environments
- DEV: ...
- TEST: ...
- PREPROD: ... (UAT window: ...)
## 5. Test Data
- Synthetic: ...
- Anonymized: ... (DPO sign-off date)
## 6. Schedule
| Phase | Start | End | Milestone |
|---|---|---|---|
| Test Design | ... | ... | Design Gate |
| Test Prep | ... | ... | ... |
| Execution TEST | ... | ... | TEST Exit Gate |
| UAT | ... | ... | PREPROD Gate |
| Regression | ... | ... | ... |
## 7. Resource Plan
- QA: ... FTE × ... sprintů
- Automation: ...
- Externí: ...
## 8. Risk Register (top)
| Risk ID | Description | Score | Mitigation |
|---|---|---|---|
| ... | ... | ... | ... |
## 9. Entry / Exit Criteria
- Master §9.2 referenced + specifické:
- ...
## 10. Acceptance Criteria
- ...
## 11. Reporting cadence
- Daily standup, Weekly QA Report, Go/No-Go meeting
## 12. Approval
- PO: ___
- PM: ___
- QA Lead: ___
- HoQ (kategorie A): ___
22.2 Test Case template (Xray-aligned)
# Test Case TC-{module}-{n}
## Identifikace
- ID: TC-{module}-{n}
- Title: ...
- Type: Functional / Negative / Boundary / Integration / E2E / etc.
- Priority: P0 / P1 / P2 / P3
- Risk weight: 1-25
- Automation status: Manual / Automated / Planned
## Linkování
- User Story: {Jira}
- AC: {AC #}
- Risk: {RISK-X}
- Requirement: {UC ID}
## Preconditions
- ...
## Test Data
- {dataset reference}
## Steps
| # | Action | Expected Result |
|---|---|---|
| 1 | ... | ... |
| 2 | ... | ... |
## Post-conditions
- ...
## Test Evidence (po execution)
- Test Execution ID: {Xray TE}
- Result: PASS / FAIL / BLOCKED / SKIPPED
- Defect: {BUG-X} (if FAIL)
22.3 Risk Register entry template
(Z Master §8.2 zachováno + doplněno o trigger.)
- ID: RISK-{release}-{n}
- Description: ...
- Impact (1-5): ...
- Probability (1-5): ...
- Risk Score: ...
- Owner: ...
- Mitigation plan: ...
- Residual Risk: ...
- Status: Open / Mitigated / Accepted / Closed
- Trigger for re-evaluation: ...
- Test coverage: {TC-X, TC-Y}
22.4 Exploratory Test Charter template
(Viz §12.1 výše.)
22.5 Test Report template (per release)
# Test Report — Release {ID}
## 1. Summary
- Test scope: ... (referenced Test Plan)
- Execution period: ... to ...
- Overall recommendation: GO / NO-GO / CONDITIONAL GO
## 2. Test Execution Summary
| Typ | Plánováno | Spuštěno | Pass | Fail | Blocked | Pass rate |
|---|---|---|---|---|---|---|
| Unit | ... | ... | ... | ... | ... | % |
| Integration | ... | ... | ... | ... | ... | % |
| API | ... | ... | ... | ... | ... | % |
| E2E | ... | ... | ... | ... | ... | % |
| Performance | ... | ... | ... | ... | ... | % |
| Security | ... | ... | ... | ... | ... | % |
| Accessibility | ... | ... | ... | ... | ... | % |
| UAT | ... | ... | ... | ... | ... | % |
## 3. Defect Summary
- Total found: ...
- By severity: S1=..., S2=..., S3=..., S4=...
- Open at release: P1=0, P2=0, P3=..., P4=...
- Escaped from previous: ...
## 4. NFR Results
- Performance: baseline +X %, all thresholds PASS / FAIL
- Security: 0 Critical, 0 High; medium N findings (acceptance attached)
- Accessibility: WCAG 2.1 AA PASS / FAIL per page
- Crypto/PKI (A): PASS / FAIL
## 5. Risk Status
- Top 5 active risks, residual scores
- Risk acceptance count
## 6. Coverage
- UC coverage: %
- Code coverage: %
- Risk-weighted coverage: %
- Automation coverage: %
## 7. Compliance
- NIS2: audit log test PASS, DR drill {date}
- ZKB: SoD test PASS, pentest report (link)
- GDPR: DSAR test PASS, anonymization sign-off (link)
- ENTSO-E: TP sandbox PASS
## 8. Issues / Blockers
- ...
## 9. Lessons Learned (preliminary)
- ...
## 10. Approval
- QA Lead: ___
- PM: ___
- HoQ (kategorie A): ___
23. Implementace této koncepce
23.1 Co je hotové (existující)
- Master strategie v2.2 (process + organization)
- Schválený toolchain (Master §6.1)
- Xray test management
- Kategorizace A/B/C
- DoR + DoD (Master §11)
- Gate workflow CI/CD (Master §9)
- Risk management (Master §8)
- Compliance mapping (Master §14)
23.2 Co tento dokument přidává
- Plná taxonomie 40 typů testů
- Test design techniques katalog
- Environment + data deep dive
- Performance / Security / Accessibility / Crypto metodologie
- Contract & Integration patterns
- E2E + Exploratory koncepce
- Defect lifecycle + RCA
- Templates per artefakt
- CEPS-specifické testing patterns
- TMMi L3 → L4 mapping
23.3 Co je třeba doimplementovat
| Položka | Owner | Timeline |
|---|---|---|
| Schválení této koncepce Quality boardem | HoQ | Q3 2026 |
| Test data factories repo | QA Automation | F1 (Q4 2026) |
| Anonymization pipeline upgrade (Tonic) | DPO + DevOps | F1 |
| Pact Broker self-hosted | DevOps + QA | F2 |
| Schemathesis CI integration | QA Automation | F2 |
| Chaos toolkit (Litmus) v izolovaném clusteru | DevOps + SecOps | F4 |
| ReportPortal self-hosted | DevOps + QA | F2 |
| Quality dashboard (Grafana) | SRE + QA | F2 |
| Test Plan template adoption | QA Lead | F1 |
| TMMi L3 audit (external) | HoQ | Q4 2027 |
Konec dokumentu.