From 085444fc10754718e3676af1f4b97d8728c3d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Perez=20Neto?= Date: Mon, 30 Mar 2026 10:43:02 -0300 Subject: [PATCH 1/5] docs: update documentation --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 634e756..82f9f2b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,24 @@ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-mutation-testing&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=deploy-on-friday-swift-mutation-testing) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-mutation-testing&metric=coverage)](https://sonarcloud.io/summary/new_code?id=deploy-on-friday-swift-mutation-testing) -**Find untested behaviour in Swift codebases.** +**Measure and improve test effectiveness in Swift codebases using mutation testing.** -`swift-mutation-testing` is a CLI for mutation testing of Xcode + XCTest projects. It modifies your source code in small, targeted ways — mutations — and runs your test suite against each one. A mutation that goes undetected means a test is missing or an assertion is too weak. The result is a mutation score that measures how effectively your tests catch real bugs. +`swift-mutation-testing` is a CLI for mutation testing of Xcode + XCTest projects. It modifies your source code in small, targeted ways — mutations — and runs your test suite against each one. A mutation that goes undetected reveals missing tests or weak assertions. The result is a mutation score that reflects how effectively your tests catch real bugs. + +## Why + +Traditional test coverage does not guarantee that tests catch real bugs. + +Mutation testing introduces controlled changes to your code to verify that your tests fail when behavior changes. Surviving mutations indicate gaps in test effectiveness. + +## Features + +- Mutation testing for Xcode + XCTest projects +- Measures test effectiveness through mutation score +- Supports multiple mutation operators +- Provides detailed reports per file and mutation +- Configurable via YAML +- Can be integrated into CI pipelines ## Install From d9f192ec19b6d867771f28978d4cce6b556b2a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Perez=20Neto?= Date: Mon, 30 Mar 2026 10:43:15 -0300 Subject: [PATCH 2/5] chore: update SonarCloud config file --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 583d52e..9aab0ad 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,7 @@ # Project identification sonar.projectKey=deploy-on-friday-swift-mutation-testing sonar.projectName=Swift Mutation Testing -sonar.projectDescription=Find untested behaviour in Swift codebases. +sonar.projectDescription=Measure and improve test effectiveness in Swift codebases using mutation testing. sonar.organization=deploy-on-friday # Source code From dfe22245141b532ae52a68633737ba665a4e848c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Perez=20Neto?= Date: Mon, 30 Mar 2026 11:09:14 -0300 Subject: [PATCH 3/5] chore: increase default timeout to 120 seconds --- Sources/SwiftMutationTesting/CLI/HelpText.swift | 2 +- .../Configuration/RunnerConfiguration.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftMutationTesting/CLI/HelpText.swift b/Sources/SwiftMutationTesting/CLI/HelpText.swift index a4a6ee9..a1835fe 100644 --- a/Sources/SwiftMutationTesting/CLI/HelpText.swift +++ b/Sources/SwiftMutationTesting/CLI/HelpText.swift @@ -13,7 +13,7 @@ enum HelpText { --scheme Xcode scheme to build and test (required) --destination xcodebuild destination specifier (required) --target Test target name - --timeout Per-mutant test timeout in seconds (default: 60) + --timeout Per-mutant test timeout in seconds (default: 120) --concurrency Number of parallel test workers (default: CPUs - 1) --no-cache Disable the result cache --output Write mutation report JSON to path diff --git a/Sources/SwiftMutationTesting/Configuration/RunnerConfiguration.swift b/Sources/SwiftMutationTesting/Configuration/RunnerConfiguration.swift index d8d374e..0381901 100644 --- a/Sources/SwiftMutationTesting/Configuration/RunnerConfiguration.swift +++ b/Sources/SwiftMutationTesting/Configuration/RunnerConfiguration.swift @@ -1,7 +1,7 @@ import Foundation struct RunnerConfiguration: Sendable { - static let defaultTimeout: Double = 60.0 + static let defaultTimeout: Double = 120.0 static let defaultConcurrency: Int = max(1, ProcessInfo.processInfo.processorCount - 1) let projectPath: String From fb779dbe8e3b46a4d1d07c84abb9cfb91899e862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Perez=20Neto?= Date: Mon, 30 Mar 2026 11:09:21 -0300 Subject: [PATCH 4/5] chore: update generated config defaults --- .../Configuration/ConfigurationFileWriter.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/SwiftMutationTesting/Configuration/ConfigurationFileWriter.swift b/Sources/SwiftMutationTesting/Configuration/ConfigurationFileWriter.swift index fe0d613..867d48d 100644 --- a/Sources/SwiftMutationTesting/Configuration/ConfigurationFileWriter.swift +++ b/Sources/SwiftMutationTesting/Configuration/ConfigurationFileWriter.swift @@ -42,11 +42,11 @@ struct ConfigurationFileWriter: Sendable { } lines.append("") - lines.append("# Per-mutant test timeout in seconds (default: 60)") - lines.append("timeout: 60") + lines.append("# Per-mutant test timeout in seconds (default: 120)") + lines.append("timeout: 120") lines.append("") lines.append("# Number of parallel workers (default: max(1, CPU count - 1))") - lines.append("# concurrency: 4") + lines.append("concurrency: 4") lines.append("") lines.append("# Disable result cache (re-runs all mutants on every execution)") lines.append("# noCache: true") @@ -54,7 +54,7 @@ struct ConfigurationFileWriter: Sendable { lines.append("# Report output paths") lines.append("# output: mutation-report.json") lines.append("# htmlOutput: mutation-report.html") - lines.append("# sonarOutput: sonar-report.json") + lines.append("sonarOutput: sonar-mutation-report.json") lines.append("") lines.append("# Source file glob patterns to exclude from mutation") From 8ad595865adaeaa5113497969c8fd3a62b7ff774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Perez=20Neto?= Date: Mon, 30 Mar 2026 11:09:28 -0300 Subject: [PATCH 5/5] test: update ConfigurationFileWriter expectations for new defaults --- .../Unit/Configuration/ConfigurationFileWriterTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/SwiftMutationTestingTests/Unit/Configuration/ConfigurationFileWriterTests.swift b/Tests/SwiftMutationTestingTests/Unit/Configuration/ConfigurationFileWriterTests.swift index bfe7099..54024ae 100644 --- a/Tests/SwiftMutationTestingTests/Unit/Configuration/ConfigurationFileWriterTests.swift +++ b/Tests/SwiftMutationTestingTests/Unit/Configuration/ConfigurationFileWriterTests.swift @@ -89,8 +89,8 @@ struct ConfigurationFileWriterTests { try writer.write(to: dir.path, project: .empty) let values = try ConfigurationFileParser().parse(at: dir.path) - #expect(values["timeout"] == "60") - #expect(values["concurrency"] == nil) + #expect(values["timeout"] == "120") + #expect(values["concurrency"] == "4") } @Test("Given multiple schemes detected, when write called, then available schemes comment is included")