Adding mutation testing to build gradle with PiTest#1204
Merged
Yury-Fridlyand merged 19 commits intoopensearch-project:mainfrom Jan 11, 2023
Merged
Adding mutation testing to build gradle with PiTest#1204Yury-Fridlyand merged 19 commits intoopensearch-project:mainfrom
Yury-Fridlyand merged 19 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Adding mutation testing to build gradle with PiTest
Codecov Report
@@ Coverage Diff @@
## main #1204 +/- ##
============================================
- Coverage 98.31% 95.83% -2.48%
- Complexity 3535 3550 +15
============================================
Files 342 354 +12
Lines 8730 9420 +690
Branches 554 673 +119
============================================
+ Hits 8583 9028 +445
- Misses 142 334 +192
- Partials 5 58 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Collaborator
|
Thanks for adding this. Could you help updating https://github.com/opensearch-project/sql/blob/main/DEVELOPER_GUIDE.rst also. |
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Collaborator
Done |
acarbonetto
approved these changes
Jan 4, 2023
penghuo
approved these changes
Jan 11, 2023
dai-chen
approved these changes
Jan 11, 2023
Collaborator
|
Do we need to backport? |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds PiTest Gradle to build.gradle in core. This adds support for Mutation testng/Analysis to our testing ability. It should help us make more effective tests for past/future features.
Why does this help?
Mutation testing is used to find missing parts of your project not covered by existing tests. It modifies (mutates) one part of code and checks if a test is killed (fails) because of the mutation. Sometimes it will make return statements return null, other times it will switch
==to!=, or<with>, or||with&&and lots more mutations. More mutations can be found in thedefault mutationscolumn here https://pitest.org/quickstart/mutators/. Often mutation testing provides a more clear picture of the quality of tests compared to line/branch coverage alone.If you notice mutations that "survive" your test suite, consider adding additional tests to kill the mutations.
Short presentation PDF on mutation testing MutationTesting_Presentation.pdf.
Docs for Gradle plugin for PiTest.
Currently to be manually run, but could be added to GitHub actions later. It generates an html page indicating mutations that survived and were killed by our test suite.
Only adding support for running mutation testing in core & OpenSearch modules (for now).
Steps to run
./gradlew pitestReport will be placed in
core/build/reports/pitest/index.html.Reports can be found in artifacts under
coreandopensearchrespectively.Sample Report
PiTest_Results.zip
Check List
CVE
hcoles/pitest#1084
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.