DeathStar3 / jfreechart

GNU Lesser General Public License v2.1
0 stars 0 forks source link

Add tests and split methods in `ChartPanel` #2

Open j-mortara opened 2 years ago

j-mortara commented 2 years ago

Class description

Class full name

org.jfree.chart.ChartPanel

Implemented variability :heavy_check_mark:

This class represents where the chart with all its elements will be rendered

Method level:

5 constructors

  1. create the Panel
  2. create the Panel using a buffer to speed up repainting
  3. create the Panel and specify which buttons should appear on the window (save, print, zoom, tooltips, properties editor)
  4. same as 3. and specifying maximum dimensions
  5. same as 4. + copy option on the window

6 method variants

Actual coverage (JaCoCo)

Visualization

Entity

TODO

Split the most cognitively complex methods

Add tests for the following methods that are currently not or partially covered

Other methods are not tested, but are fully dedicated to graphical behavior, so they might be hard to test

collet commented 2 years ago

getToolTipText is not that complex.

collet commented 2 years ago

For the graphical behavior method, there are indeed very hard to understand and we observe that:

collet commented 2 years ago

https://stackoverflow.com/questions/329118/how-do-i-activate-jbutton-actionlistener-inside-code-unit-testing-purposes https://stackoverflow.com/questions/62614105/how-to-junit-test-an-actionlistener

collet commented 2 years ago

https://stackoverflow.com/questions/8986368/junit-testing-overridden-paint-component