05 — Rodzaje Testów: Jednostkowe, Integracyjne i Mutacyjne
Teoria: notes/04-testing-pyramid-and-types.md
Zadania (testing_types.go + testing_types_test.go)
- Unit (granice zabijające mutanty): zaimplementuj
IsWithinRateLimit(current, limit int) (bool, error)— dlacurrent < 0zwróćErrNegativeCount, dlalimit <= 0zwróćfalse, nil, inaczejcurrent <= limit, nil. - Integration (prawdziwy system plików): zaimplementuj
SaveAndLoadConfig(path string, data map[string]string) (map[string]string, error)— zapis JSON na dysk (os.WriteFile) i odczyt z powrotem (os.ReadFile+json.Unmarshal). - Mutation Testing (eksperyment ręczny): po przejściu testów zmień
<=na<wIsWithinRateLimit(mutant!), uruchommake test PKG=./exercises/02-engineering-2026/05-testing-types-and-mutationi sprawdź, czy test granicznycurrent == limitzabił mutanta.
Uruchomienie testów
make test PKG=./exercises/02-engineering-2026/05-testing-types-and-mutation