From d3db9d1392fdcef6459e48c1246d5873b6b4acf9 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 29 Apr 2019 15:00:45 +0200 Subject: [PATCH] added a PiTest section to HOWTO.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index ab087684..b56a0f1a 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,44 @@ To create and push a new tag use: After you've moved an existing the tag to another commit, you can use: git push origin HOWTO-... --force + +## Special Build Tasks + +Besides common build tasks like `build`, `test` or `bootRun` this projects has some not so common tasks which are explained in this section. + +### Mutation Testing PiTest + + ./gradlew pitest + +Runs (almost) all JUnit tests under mutation testing. +Mutation testing is a means to determine the quality of the tests. + +#### Some Background Information on Mutation Testing + +PiTest does it with these steps: + +- initially PiTest checks which production code is executed by which tests +- if the tests don't pass, it stops +- otherwise the production code is 'mutated' and PiTest checks whether this makes a test fail ('mutant killed') +- Finally it checks thresholds for coverage and mutant killing. + +More information about can be found here: + +- PiTest: http://pitest.org/ +- gradle-plugin: https://gradle-pitest-plugin.solidsoft.info/ + +#### How to Configure PiTest + +These thresholds can be configured in `build.gradle`, +but we should generally not lower these. + +There is also a list of excluded files, all generated by JHipster or MapStruct, not containing any changes by us. + +As you might figure, mutation testing is CPU-hungry. +To limit load in our Jenkins build server, it only uses 2 CPU threads, thus it needs over an hour. + +If you want to spend more CPU threads on your local system, you can change that via command line: + + ./gradlew pitest -Doverride.pitest.threads=7 + +I suggest to leave one CPU thread for other tasks or your might lag extremely.