You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Demo video of running mutation testing on a Go web project</p>
20
-
</div>
21
-
22
17
## Table of Contents
23
18
24
19
-[Overview](#overview)
@@ -37,21 +32,23 @@ Mutahunter uses LLM models to inject context-aware faults into your codebase. Th
37
32
38
33
## Features
39
34
40
-
-**Change-Based:** Runs mutation tests on modified files and lines based on the latest commit or pull request changes.
41
-
-**Multi-Language Support:** Compatible with languages that provide coverage reports in Cobertura XML, Jacoco XML, and lcov formats.
42
-
-**Extensible:** Extensible to additional languages and testing frameworks.
43
-
-**Context-Aware:** Uses a map of your entire git repository to generate contextually relevant mutants using [aider](https://aider.chat/docs/repomap.html).
44
-
-**LLM Support:** Supports self-hosted, Anthropic, OpenAI, and any LLM models using [LiteLLM](https://github.com/BerriAI/litellm).
45
-
-**Mutant Report** Provides detailed reports on mutation coverage, killed mutants, and survived mutants.
35
+
-**Extreme Mutation Testing:** Leverages language agnostic [TreeSitter](https://tree-sitter.github.io/) parser to apply extreme mutations to the codebase without using LLMs. [Research](https://arxiv.org/abs/2103.08480) shows that this approach is effective at detecting pseudo-tested methods with significantly lower computational cost. Currently supports Python, Java, JavaScript, and Go. Check the [scheme files](/src/mutahunter/core/pilot/aider/queries/) to see the supported operators. We welcome contributions to add more operators and languages.
36
+
-**LLM Context-aware Mutations:** Utilizes LLM models to generate context-aware mutants. [Research](https://arxiv.org/abs/2406.09843) indicates that LLM-generated mutants have higher fault detection potential, fewer equivalent mutants, and higher coupling and semantic similarity to real faults. It uses a map of your entire git repository to generate contextually relevant mutants using [aider's repomap](https://aider.chat/docs/repomap.html). Supports self-hosted LLMs, Anthropic, OpenAI, and any LLM models via [LiteLLM](https://github.com/BerriAI/litellm).
37
+
-**Change-Based Testing:** Runs mutation tests on modified files and lines based on the latest commit or pull request changes, ensuring that only relevant parts of the code are tested.
38
+
-**Language Agnostic:** Compatible with languages that provide coverage reports in Cobertura XML, Jacoco XML, and lcov formats. Extensible to additional languages and testing frameworks.
39
+
-**Detailed Mutant Reports:** Provides comprehensive reports on mutation coverage, killed mutants, and survived mutants.
46
40
47
-
## Getting Started
41
+
## Recommended Mutation Testing Process
42
+
43
+

48
44
49
-
⚠️ We highly suggest:
45
+
1.**Achieve High Line Coverage:** Ensure your test suite has high line coverage, preferably 100%.
50
46
51
-
- Using `--modified-files-only` flag to run mutation testing on only on modified files.
52
-
- Using `--only-mutate-file-paths` flag to focus on specific files. T
47
+
2.**Strict Mutation Testing:** Use strict mutation testing to improve mutation coverage without additional cost. Utilize the `--only-mutate-file-paths` flag for targeted testing on critical files.
53
48
54
-
The above flags will make the mutation testing significantly **faster** and **cost effective.**
49
+
3.**LLM-Based Mutation Testing on Changed Files:** Inject context-aware mutants using LLMs on changed files during pull requests as the final line of defense. Use the `--modified-files-only` flag to focus on recent changes. In this way it will make the mutation testing significantly **faster** and **cost effective.**
50
+
51
+
## Getting Started
55
52
56
53
```bash
57
54
# Install Mutahunter package via GitHub. Python 3.11+ is required.
Description: Runs mutation testing only on modified files and lines based on the latest commit.
146
-
Required: No
147
-
```
148
-
149
100
## Mutant Report
150
101
151
102
Check the logs directory to view the report:
@@ -160,21 +111,15 @@ Help us improve Mutahunter and get rewarded! We have a cash bounty program to in
160
111
161
112
## Roadmap
162
113
163
-
### Mutation Testing Capabilities
164
-
165
114
- [x] **Fault Injection:** Utilize advanced LLM models to inject context-aware faults into the codebase, ensuring comprehensive mutation testing.
166
115
- [x] **Language Support:** Expand support to include various programming languages.
167
116
- [x] **Support for Other Coverage Report Formats:** Add compatibility for various coverage report formats.
117
+
- [x] **Change-Based Testing:** Implement mutation testing on modified files based on the latest commit or pull request changes.
118
+
- [x] **Extreme Mutation Testing:** Apply mutations to the codebase without using LLMs to detect pseudo-tested methods with significantly lower computational cost.
168
119
- [ ] **Mutant Analysis:** Automatically analyze survived mutants to identify potential weaknesses in the test suite. Any suggestions are welcome!
169
-
170
-
### Continuous Integration and Deployment
171
-
172
120
- [ ] **CI/CD Integration:** Develop connectors for popular CI/CD platforms like GitHub Actions.
173
-
- [ ] **PR Changeset Focus:** Generate mutations specifically targeting pull request changesets or modified code based on commit history.
174
121
- [ ] **Automatic PR Bot:** Create a bot that automatically identifies bugs from the survived mutants list and provides fix suggestions.
175
122
176
-
---
177
-
178
123
## Acknowledgements
179
124
180
125
Mutahunter makes use of the following open-source libraries:
0 commit comments