-
Notifications
You must be signed in to change notification settings - Fork 140
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
Adding mutation testing to build gradle with PiTest #1204
Adding mutation testing to build gradle with PiTest #1204
Conversation
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
Signed-off-by: MitchellGale-BitQuill <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Done |
Do we need to backport? |
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 mutations
column 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 pitest
Report will be placed in
core/build/reports/pitest/index.html
.Reports can be found in artifacts under
core
andopensearch
respectively.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.