VariMetrics

Companion webpage of the VariMetrics toolchain.


Maintenance actions

Hereafter, we detail the maintenance actions applied on the JFreeChart system for the qualitative evaluation detailed in section 5.2 of the paper.

Identified weaknesses

In the quantitative evaluation, 10 classes have been identified as both variable and quality-critical in JFreeChart.

  • org.jfree.chart.plot.CategoryPlot
  • org.jfree.chart.plot.XYPlot
  • org.jfree.chart.axis.DateAxis
  • org.jfree.chart.axis.NumberAxis
  • org.jfree.chart.JFreeChart
  • org.jfree.chart.title.TextTitle
  • org.jfree.chart.ChartPanel
  • org.jfree.chart.entity.ChartEntity
  • org.jfree.chart.labels.IntervalXYItemLabelGenerator
  • org.jfree.data.general.DefaultPieDataset

To reduce the set of classes in which applying modifications, we selected the ones maximizing their number of duplicated blocks or minimizing their test coverage, finally reducing the set to the 6 following classes.

Classes with code duplication

  • org.jfree.chart.plot.CategoryPlot
  • org.jfree.chart.plot.XYPlot
  • org.jfree.chart.axis.DateAxis
  • org.jfree.chart.axis.NumberAxis

Classes lacking tests

  • org.jfree.chart.ChartPanel
  • org.jfree.chart.entity.ChartEntity

Details of the maintenance actions

Classes with code duplication

The maintenance action for such classes is factorizing some duplicated blocks. Hereafter we detail the duplications that have been refactored.

Between org.jfree.chart.plot.XYPlot and org.jfree.chart.plot.CategoryPlot

Metrics evolution
  • CategoryPlot
    • cognitive complexity: 503 → 392
    • duplicated blocks: 23 → 16
  • XYPlot
    • cognitive complexity: 666 → 603
    • duplicated blocks: 24 → 21

In org.jfree.chart.axis.DateAxis

Metrics evolution
  • DateAxis
    • cognitive complexity: 201 → 139
    • duplicated blocks: 10 → 0
  • PeriodAxis
    • cognitive complexity: 112 → 104
    • duplicated blocks: 2 → 1

In org.jfree.chart.axis.NumberAxis

Metrics evolution
  • NumberAxis
    • cognitive complexity: 163 → 127
    • duplicated blocks: 12 → 4
  • LogAxis
    • cognitive complexity: 92 → 87
    • duplicated blocks: 10 → 7
  • LogarithmicAxis
    • cognitive complexity: 315 → 281
    • duplicated blocks: 4 → 0

Classes lacking tests

The maintenance action for such classes is adding test cases for several methods that are little to not tested. Hereafter we detail the methods for which tests have been added.

In org.jfree.chart.ChartPanel

Metrics evolution
  • coverage (JaCoCo): 25.7% → 52.2%

In org.jfree.chart.entity.ChartEntity

Metrics evolution
  • coverage (JaCoCo): 30.7% → 90.5%