Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code coverage for GUI classes #11514

Open
pbludov opened this issue Apr 5, 2022 · 3 comments
Open

Improve code coverage for GUI classes #11514

pbludov opened this issue Apr 5, 2022 · 3 comments

Comments

@pbludov
Copy link
Member

pbludov commented Apr 5, 2022

Current coverage:

Class Coverage
BaseCellEditor 8%
TreeTable.TreeTableCellEditor 8%
TreeTableCellRenderer 35%
TreeTable 89%
ListToTreeSelectionModelWrapper 63%
ParseTreeTableModel 80%
TreeTableModelAdapter 56%
CodeSelector 80%
TreeTableModelAdapter.UpdatingTreeModelListener 60%

The goal is 100% code coverage.

Notes

It is possible to run GUI from IDE and collect the coverage report:
image

Some code may be unreachable from any user input (mouse, keyboard, changing system properties and so on).
Such code should be considered as "dead" code and should be deleted.

Before deleting any code, make sure that it is not executed in Windows, Mac & Linux.

Please send one PR per class. Use existing GUI tests from the package com.puppycrawl.tools.checkstyle.gui for reference.

remove exclude:

checkstyle/pom.xml

Lines 834 to 849 in 70946a8

<!-- Swing related classes -->
<exclude>com.puppycrawl.tools.checkstyle.gui.BaseCellEditor</exclude>
<exclude>com.puppycrawl.tools.checkstyle.gui.CodeSelector</exclude>
<exclude>
com.puppycrawl.tools.checkstyle.gui.ListToTreeSelectionModelWrapper
</exclude>
<exclude>com.puppycrawl.tools.checkstyle.gui.ParseTreeTableModel</exclude>
<exclude>com.puppycrawl.tools.checkstyle.gui.TreeTable</exclude>
<exclude>
com.puppycrawl.tools.checkstyle.gui.TreeTable.TreeTableCellEditor
</exclude>
<exclude>com.puppycrawl.tools.checkstyle.gui.TreeTableCellRenderer</exclude>
<exclude>com.puppycrawl.tools.checkstyle.gui.TreeTableModelAdapter</exclude>
<exclude>
com.puppycrawl.tools.checkstyle.gui.TreeTableModelAdapter.UpdatingTreeModelListener
</exclude>

and all further more specific low level coverage, like:

checkstyle/pom.xml

Lines 868 to 882 in 70946a8

<rule>
<element>CLASS</element>
<includes>
<include>com.puppycrawl.tools.checkstyle.gui.BaseCellEditor</include>
</includes>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.09</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>

@romani
Copy link
Member

romani commented Apr 6, 2022

@pbludov, we need to enforce current coverage number, to make sure CI will not allow going down.
Human can not track this.

pbludov added a commit to pbludov/checkstyle that referenced this issue Apr 6, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Apr 6, 2022
heyannely added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 21, 2023
JAZwielich pushed a commit to JAZwielich/checkstyle that referenced this issue May 21, 2023
…eeTebleModelAdapter class to increase overall coverage
pymoura added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
heyannely added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
JAZwielich pushed a commit to JAZwielich/checkstyle that referenced this issue May 21, 2023
…eeTebleModelAdapter class to increase overall coverage
pymoura added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
heyannely added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 21, 2023
romani pushed a commit that referenced this issue May 21, 2023
…elAdapter class to increase overall coverage
@github-actions github-actions bot added this to the 10.12.0 milestone May 21, 2023
heyannely added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
heyannely added a commit to heyannely/checkstyle that referenced this issue May 21, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 23, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 23, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 24, 2023
alimhtsai added a commit to alimhtsai/checkstyle that referenced this issue May 24, 2023
@romani
Copy link
Member

romani commented May 25, 2023

One more improvement is merged

@romani
Copy link
Member

romani commented Sep 7, 2023

We do not do assignments, just make a comment "I am on it" and start a work. We appreciate your help.

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

No branches or pull requests

2 participants