Kotlin mutation testing
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with runner.py, coverage.py, sites.py, and functions.py, then compare their Java handling with the Kotlin grammar and the Gradle JaCoCo report described in the issue. Check the existing tests for build plans, coverage parsing, mutation sites, and visibility. Done means Kotlin uses the Java build plan, JaCoCo coverage is read, the listed Kotlin operators and visibility rules are handled, and the baseline test command succeeds.
Written by the indexing model from the issue text.
Description
With crapper's Kotlin reader (unclebob/crapper#4, PR #5) next to mutator, mutator already finds Kotlin functions. Three things stop it from testing them. Measured with the Gradle branch (#3, PR #4) and crapper's Kotlin branch, on a small Kotlin 2.0.21 / Gradle project.
1. No operator mutants
The same class in Java and in Kotlin, --scan:
| Sites | Kinds | |
|---|---|---|
| Java | 22 | 0 -> 1, 1 -> 0, >, <, >=, <=, ==, !=, &&, delete !, delete - |
| Kotlin | 9 | 0 -> 1, 1 -> 0 only |
sites.py finds operators through _BINARY_PARENTS and _UNARY_PARENTS. Kotlin's grammar uses comparison_expression, equality_expression, conjunction_expression, disjunction_expression, additive_expression, multiplicative_expression and prefix_expression, so none match.
2. Coverage is not read
Total 0 killed 0 survived 9 uncovered
The Gradle JaCoCo report lists Calc.kt with covered lines, but covered_lines reads JaCoCo only for language == "java". Kotlin falls through to LCOV and finds nothing.
3. No test command
Baseline failed for src/main/kotlin/demo/Calc.kt: false
_PLANS in runner.py has no "kotlin", and the fallback is ["false"].
Proposed
runner.py:"kotlin"uses the Java plan (Gradle, or Maven when the nearest build file ispom.xml).coverage.py: JaCoCo for"kotlin"as for"java".sites.py: the Kotlin expression types, then Kotlin's own operators:is/!is,in/!in,../..<,until,?:.?.and!!are not valid mutants on a nullable value.functions.pyis_private:private;internalstays public.
- Dominant language
- Python
- Stars
- 55
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unclebob/mutator
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 3 days
-
Workers leave out source in a directory named build, out, dist, target or coverage, so every mutant is reported KILLEDPossibly taken @lohmag claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
A differential run can carry a killed outcome onto a surviving mutant and exit 0Possibly taken @andrewmolyuk claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 3 days
-
Edits made to the file under test during a run are reverted when the run endsPossibly taken @andrewmolyuk claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 3 days
All issues in unclebob/mutator
Similar issues
-
infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NatLabRockies/H2Integrate#977 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
topoteretes/cognee#6470 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
area:docs priority:p2 type:docs wave:9
Difficulty 1/5 Under an hour Newbie friendliness 84/100
jejjohnson/radtrax#293 ·
Maintainers usually reply within 1 day
-
bug core plugins
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bunkerity/bunkerweb#4121 · 1 comment ·
Maintainers usually reply within 1 day