-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworks mutation testing docs #271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nunomaduro
Some suggestions to improve the docs to match the used terminology.
./vendor/bin/pest --mutate | ||
``` | ||
|
||
Optionally, you may run mutation testing in parallel to speed up the process. Of course, your test suite must be able to run in tests in parallel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, you may run mutation testing in parallel to speed up the process. Of course, your test suite must be able to run in tests in parallel. | |
Optionally, you may run mutation testing in parallel to speed up the process. Of course, your test suite must be able to run the tests in parallel. |
./vendor/bin/pest --mutate --parallel | ||
``` | ||
|
||
After running mutation testing, you will see a detailed report showing the number of mutations, how many were caught, and the mutation score. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running mutation testing, you will see a detailed report showing the number of mutations, how many were caught, and the mutation score. | |
After running mutation testing, you will see a detailed report showing the number of mutations, how many were untested, and the mutation score. |
|
||
The higher the mutation score, the better your test suite is. A mutation score of 100% means that all mutations were "covered", which is the goal of mutation testing. | ||
|
||
Now, if you see "uncovered" mutations, or are a mutation score below 100%, typically means that you have **missing tests** or that **your tests are not covering all the edge cases**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, if you see "uncovered" mutations, or are a mutation score below 100%, typically means that you have **missing tests** or that **your tests are not covering all the edge cases**. | |
Now, if you see "untested" mutations, or have a mutation score below 100%, typically means that you have **missing tests** or that **your tests are not covering all the edge cases**. |
<a name="covered-vs-uncovered-mutations"></a> | ||
## Covered Vs Uncovered Mutations | ||
|
||
When running mutation testing, you will see two types of mutations: **covered** and **uncovered** mutations. | ||
|
||
- **Covered Mutations**: These are mutations that were detected by your test suite. They are considered "covered" because your tests were able to catch the changes introduced by the mutation. | ||
|
||
As example, the following mutation is considered "covered" because the test suite was able to detect the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a name="covered-vs-uncovered-mutations"></a> | |
## Covered Vs Uncovered Mutations | |
When running mutation testing, you will see two types of mutations: **covered** and **uncovered** mutations. | |
- **Covered Mutations**: These are mutations that were detected by your test suite. They are considered "covered" because your tests were able to catch the changes introduced by the mutation. | |
As example, the following mutation is considered "covered" because the test suite was able to detect the change. | |
<a name="tested-vs-untested-mutations"></a> | |
## Tested vs Untested and Uncovered Mutations | |
When running mutation testing, you will see three types of mutations: **tested**, **untested** and **uncovered** mutations. | |
- **Tested Mutations**: These are mutations that were detected by your test suite. They are considered "tested" because your tests were able to catch the changes introduced by the mutation. | |
As example, the following mutation is considered "tested" because the test suite was able to detect the change. |
- **Uncovered Mutations**: These are mutations that were not detected by your test suite. They are considered "uncovered" because your tests were not able to catch the changes introduced by the mutation. | ||
|
||
As example, the following mutation is considered "uncovered" because the test suite was not able to detect the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Uncovered Mutations**: These are mutations that were not detected by your test suite. They are considered "uncovered" because your tests were not able to catch the changes introduced by the mutation. | |
As example, the following mutation is considered "uncovered" because the test suite was not able to detect the change. | |
- **Untested Mutations**: These are mutations that were not detected by your test suite. They are considered "untested" because your tests were not able to catch the changes introduced by the mutation. | |
As example, the following mutation is considered "untested" because the test suite was not able to detect the change. |
``` | ||
|
||
Changing the return value is only one of many possible mutations. Typically, a mutation can be a change in the return value, a change in the method call, a change in the method arguments, and so on. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Uncovered Mutations**: These are mutations were no test is excuting the mutated code at all. In this case it **always** means that a test is missing. | |
No description provided.