muter  by muter-mutation-testing

Mutation testing tool for Swift projects

created 7 years ago
526 stars

Top 60.9% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Muter is a mutation testing tool designed to enhance the quality and effectiveness of Swift test suites. It helps developers identify gaps in test coverage, validate assertion strength, and assess test suite stability by introducing small code changes (mutants) and checking if existing tests fail. This process yields a mutation score, providing actionable insights into test suite health.

How It Works

Muter operates by generating "mutants" – modified versions of the source code – using predefined mutation operators. It then executes the project's test suite against each mutant. A mutant is "killed" if a test fails, indicating the test suite effectively caught the code change. The mutation score, calculated as (killed mutants / total mutants) * 100, quantifies test suite robustness. Muter works on a copy of the codebase to prevent unintended modifications.

Quick Start & Requirements

  • Installation: brew install muter-mutation-testing/formulae/muter or build from source (git clone ... && cd muter && make install).
  • Configuration: Run muter init to generate a muter.conf.yml file.
  • Execution: Run muter from the project root.
  • Prerequisites: macOS 10.15 or higher. Supports Xcode Projects, Workspaces, and Swift Package Manager.

Highlighted Details

  • Supports Xcode integration for real-time reporting in the Issue Navigator.
  • Offers multiple report formats: plain, JSON, and HTML.
  • Includes a mutate-without-running and run-without-mutating workflow to handle compilation issues with mutants.
  • Can ignore specific files, paths, or function calls via configuration.

Maintenance & Community

The project appears to be actively maintained by a dedicated team. Further community engagement details (Discord/Slack links, roadmap) are not explicitly provided in the README.

Licensing & Compatibility

The README does not explicitly state a license. Given the GitHub repository, it's likely MIT or a similar permissive license, but this requires verification. Compatibility with commercial or closed-source projects is assumed unless otherwise stated.

Limitations & Caveats

Muter has known limitations with @resultBuilder annotated functions due to implicit return requirements, potentially causing compilation errors. It also assumes specific code formatting (spaces around operators, no semicolons on lines with multiple expressions). Objective-C code is not supported.

Health Check
Last commit

4 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Travis Fischer Travis Fischer(Founder of Agentic).

LiveCodeBench by LiveCodeBench

0.8%
606
Benchmark for holistic LLM code evaluation
created 1 year ago
updated 2 weeks ago
Feedback? Help us improve.