cqfn / jpeek

Hosted and command-line calculator of cohesion metrics for Java code
https://i.jpeek.org
MIT License
207 stars 81 forks source link

SCOM: MetricsTest does not provide a way to test the SCOM_minK value #222

Closed llorllale closed 6 years ago

llorllale commented 6 years ago

(This may or may not be relevant if the proposal for #169 is approved.)

Problem: As per #142, I am implementing calculation of SCOM_minK value for SCOM. I have the calculation ready. It will be stored in a new var in the metric.xml, but MetricsTest currently only tests the //class/@value of metrics.

Proposal Ideally, enable tests of arbitrary xpaths in MetricsTest. Otherwise, enable tests of <var> using an xpath similar to : //var[@id = 'SCOM_minK'].

0crat commented 6 years ago

@yegor256/z please, pay attention to this issue

yegor256 commented 6 years ago

@llorllale but only @value matters for us. Or you want our tests to be more detailed oriented. I didn't understand, what is broken?

llorllale commented 6 years ago

@yegor256 For SCOM_minK I need the tests to be more detail oriented.

SCOM_minK is another number calculated for SCOM separate from its @value. The paper says that if SCOM < SCOM_minK then you should consider splitting the class into more cohesive classes.

yegor256 commented 6 years ago

@llorllale we don't need to test those supplementary variables. Each metric has them. We just have them in the XML report for visibility. That's enough.