We already have PHPUnit tests and code coverage for the PHP code, but coverage alone does not tell us how well the tests detect changes in the code.
Add Infection to LibreSign to introduce mutation testing for the PHP test suite.
The xobject-template package can be used as a reference, but the implementation should follow the current LibreSign structure and dependencies.
Acceptance criteria
These files from xobject-template may be useful as references:
Good first issue
This should be a good opportunity to learn how the LibreSign PHP tests and CI are organized and to get some experience with mutation testing.
The implementation touches different parts of the test tooling. Please keep commits small and focused instead of putting the complete implementation in one large commit.
Additional context
- If you have questions, feel free to ask in this issue.
- Give a ⭐️ star to this repository if you find LibreSign useful and would like to support the project.
- You can also join our community: https://t.me/LibreSign
We already have PHPUnit tests and code coverage for the PHP code, but coverage alone does not tell us how well the tests detect changes in the code.
Add Infection to LibreSign to introduce mutation testing for the PHP test suite.
The xobject-template package can be used as a reference, but the implementation should follow the current LibreSign structure and dependencies.
Acceptance criteria
Infection is installed using the existing
bamarni/composer-bin-pluginpattern, with its dependencies isolated undervendor-bin/infection.An
infection.json5configuration file is added to the repository root, configured to run mutation testing against the PHP source code inlib/.Infection uses the existing PHPUnit setup.
A
mutation:testscript is added to the rootcomposer.json, so mutation tests can be executed with:A GitHub Actions workflow runs mutation tests for relevant PHP changes and prevents the check from passing when the configured mutation score is not reached.
Run Infection once without an MSI gate to get the initial scores. Use the resulting MSI and Covered Code MSI values as the initial
minMsiandminCoveredMsivalues.The mutation test can be executed successfully both locally and in CI.
These files from
xobject-templatemay be useful as references:infection.json5vendor-bin/mutation/composer.jsonmutation.ymlGood first issue
This should be a good opportunity to learn how the LibreSign PHP tests and CI are organized and to get some experience with mutation testing.
The implementation touches different parts of the test tooling. Please keep commits small and focused instead of putting the complete implementation in one large commit.
Additional context