ham1 opened a new pull request, #6872: URL: https://github.com/apache/jmeter/pull/6872
I ran PIT mutation testing (https://pitest.org) locally on each module, then added tests where a mutant survived in code that decides what users see: statistics, saved results, assertions and extractors. A surviving mutant means a change to the code, for example a removed null check or a flipped condition, left every test passing. Tests only, no main code changes. Each commit covers one class: - `StatCalculator`: percent point on an empty calculator, `addEachValue` counts in the distribution - `Converter`: null defaults, the `Number` branches of `getInt`/`getLong`, `Calendar` conversion - `HashTree`: `traverse` callback order, `hashCode` for different trees - `ResponseAssertion`: failure message for each field and test type, equals vs match vs contains, substring vs contains, assume success - `BoundaryExtractor`: each "field to check" option reads the right part of the result - `JSONPostProcessor`: `_ALL` concatenation, match number in and out of range, mismatched argument counts - `SampleResult`: sub result size totals and thread name, `isBinaryType`, first assertion failure message - `CSVSaveService`: reading back a CSV results file with the default fields, errors-only reading, bad lines PIT results for the changed classes, before and after (default mutators): | Class | Lines covered | Mutants killed | |---|---|---| | Converter | 80% -> 86% | 63% -> 82% | | HashTree | 36% -> 36% | 19% -> 24% | | StatCalculator | 76% -> 77% | 69% -> 76% | | ResponseAssertion | 83% -> 90% | 45% -> 71% | | BoundaryExtractor | 87% -> 92% | 71% -> 88% | | JSONPostProcessor | 87% -> 92% | 72% -> 89% | | CSVSaveService | 38% -> 65% | 33% -> 52% | | SampleResult | 56% -> 59% | 46% -> 58% | The old `//TODO - need a lot more tests` in ResponseAssertionTest is removed. The PIT setup was a local init script outside the repo, so nothing in the build changes. Engine, thread and remote classes were left out because their mutants need real threads or servers to test. `./gradlew style` and the tests of the changed modules pass locally. Generated-by: claude-opus-5-5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
