Skip to content

Add unit tests for KnownProperties#435

Merged
msmygit merged 2 commits into
datastax:mainfrom
vasiliy-mikhailov:add-KnownProperties-tests
Jun 30, 2026
Merged

Add unit tests for KnownProperties#435
msmygit merged 2 commits into
datastax:mainfrom
vasiliy-mikhailov:add-KnownProperties-tests

Conversation

@vasiliy-mikhailov

@vasiliy-mikhailov vasiliy-mikhailov commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Additive unit tests for KnownProperties — edge cases and current behavior pinned with explicit assertions. No existing test or production code changed (append-only).

Verified green under Java 11 (mvn -pl . test -Dtest=KnownPropertiesTest → Tests run: 41, Failures: 0, Errors: 0). On this class the additions raise line coverage from 200 to 200/201 lines and the PIT mutation kill-rate from 97 to 102 mutants.


How this was produced

This PR was generated with an AI-assisted pipeline built around mutation testing (PIT). The pipeline mutates the target class (flipping conditions and changing boundary/edge cases) and runs the existing tests against each mutant. Where a mutant survives (the existing tests do not catch that edge case), it writes a focused test for that case and reruns PIT to confirm the new test actually kills that specific mutant. So every added test is verified to catch a concrete edge case the suite missed before, rather than being speculative or redundant. The change is additive only (no production code modified), and the module builds green under its CI JDK.

@vasiliy-mikhailov
vasiliy-mikhailov requested a review from a team as a code owner June 24, 2026 18:27
@msmygit msmygit added the Needs Review This requires review by team members label Jun 24, 2026
@msmygit

msmygit commented Jun 24, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution @vasiliy-mikhailov! Curious, what made you do this work? Was there an edge case that you had experienced when using CDM?

Also, have you considered increasing the COVEREDRATIO and decreasing the MISSEDCOUNT to see if there is an improvement experienced with your additional tests coverage?

Also, please understand that beginning the 6.x version, the project has given away Java 11 and standardized on 17 as the base version.

@msmygit
msmygit force-pushed the add-KnownProperties-tests branch from bea7a48 to 799c040 Compare June 24, 2026 19:24
@vasiliy-mikhailov

Copy link
Copy Markdown
Contributor Author

Thanks @msmygit! No specific production edge case — I was strengthening test coverage on classes where the existing suite executed the code but did not fully assert on its behaviour (mutation-testing-guided), so these are regression-pinning characterization tests for KnownProperties rather than a bug fix. Good point on the COVEREDRATIO/MISSEDCOUNT thresholds — these additions should move that ratio; happy to tighten them in this PR if you would like. And noted on 6.x standardizing on Java 17 — the tests run green under 17.

@msmygit

msmygit commented Jun 24, 2026

Copy link
Copy Markdown
Member

@vasiliy-mikhailov yes, please adjust to the levels we could improve them on this PR!

Good point on the COVEREDRATIO/MISSEDCOUNT thresholds — these additions should move that ratio; happy to tighten them in this PR if you would like.

@vasiliy-mikhailov

Copy link
Copy Markdown
Contributor Author

Thanks @msmygit! Done. I tightened the BUNDLE gate to lock in the coverage these tests add:

  • INSTRUCTION coveredratio: 45% -> 53%
  • COMPLEXITY coveredratio: 0.33 -> 0.42
  • LINE missedcount: 1500 -> 1490

Those are the levels the suite now clears (measured INSTRUCTION 54.1%, COMPLEXITY 0.437, LINE missed 1475 under JDK 17), so the gate ratchets up while staying green. Verified with a full build (605 tests pass).

vasiliy-mikhailov and others added 2 commits June 30, 2026 19:12
Additive unit tests only - no existing test or production code changed.

Signed-off-by: vasiliy-mikhailov <vasiliy-mikhailov@users.noreply.github.com>
INSTRUCTION 45% to 53%, COMPLEXITY 0.33 to 0.42, LINE missed 1500 to 1490; verified green (605 tests).
@msmygit
msmygit force-pushed the add-KnownProperties-tests branch from 3457ee8 to 34b7694 Compare June 30, 2026 23:13
@msmygit
msmygit merged commit 2fe8746 into datastax:main Jun 30, 2026
9 checks passed
@msmygit msmygit removed the Needs Review This requires review by team members label Jun 30, 2026
@msmygit

msmygit commented Jul 12, 2026

Copy link
Copy Markdown
Member

@all-contributors please add @vasiliy-mikhailov to test

@allcontributors

Copy link
Copy Markdown
Contributor

@msmygit

I've put up a pull request to add @vasiliy-mikhailov! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants