Skip to content

Add test for Java parsing coverage#3916

Merged
wadoon merged 1 commit into
mainfrom
java-coverage-parsing-tests
Jul 13, 2026
Merged

Add test for Java parsing coverage#3916
wadoon merged 1 commit into
mainfrom
java-coverage-parsing-tests

Conversation

@unp1

@unp1 unp1 commented Jul 11, 2026

Copy link
Copy Markdown
Member

Intended Change

This PR adds 48 test cases for Java constructs that are parser supported (it is not checked whether KeY can deal with them on a calculus level).

The tests record the current status quo, this means they fail when a supported construct can no longer be supported and they fail if a construct becomes supported (in the latter case the error message says to change the test case to refelct that a new feature is supported)

One thing that stands out is that we can parse var x = 0; if the right-hand side is a primtiive type but something with a reference type var x = "hi"; fails.

The tests are an artifact of determining the Java coverage for KeY 3.0 (see https://keyproject.github.io/key-docs/user/SupportedFeatures/JavaCoverage/)

Type of pull request

  • Other: Adds additional tests

Ensuring quality

  • I have tested the feature as follows: The added feature are tests

Additional information and contact(s)

Created with AI tooling suuport

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

@unp1
unp1 force-pushed the java-coverage-parsing-tests branch from 153641e to d96609f Compare July 11, 2026 23:40
@unp1 unp1 self-assigned this Jul 11, 2026
@unp1 unp1 added the 🛠 Maintenance Code quality and related things w/o functional changes label Jul 11, 2026
@unp1 unp1 modified the milestone: v3.0.0 Jul 11, 2026
@unp1
unp1 force-pushed the java-coverage-parsing-tests branch from d96609f to 877ea2c Compare July 11, 2026 23:56
@wadoon

wadoon commented Jul 12, 2026

Copy link
Copy Markdown
Member

Would it not be nice to confirm this via jacoco?

@unp1

unp1 commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

Not sure I can follow. How would you use Jacoco to measure how much Java constructs are supported by KeY? Measuring how many visit/listener methods are executed?

@wadoon

wadoon commented Jul 13, 2026

Copy link
Copy Markdown
Member

Not sure I can follow. How would you use Jacoco to measure how much Java constructs are supported by KeY? Measuring how many visit/listener methods are executed?

You can measure the coverage quantitatively by jacoco to monitor the line hits in the GeneratedJavaParser class. This gives you a rough percentage of taken paths in the parser, correlating with the grammar rules.

@wadoon
wadoon added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit 8f9c6c7 Jul 13, 2026
36 checks passed
@wadoon
wadoon deleted the java-coverage-parsing-tests branch July 13, 2026 20:42
@WolframPfeifer WolframPfeifer added this to the v3.0.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠 Maintenance Code quality and related things w/o functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants