Skip to content

Commit 6248efd

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: adjust column names and metric formulas
1 parent 9e0027c commit 6248efd

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

java/ql/src/Metrics/Summaries/GeneratedVsManualCoverage.ql

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,16 @@ float getNumApisWithoutMadModel(string package) {
6868
)
6969
}
7070

71-
// ! Note: adjust metric formulas as needed after more discussion with Yorck
72-
/*
73-
* metric1:
74-
* Proportion of manual models covered by automation: “both” / (“both” + “manual-only”)
75-
* Auto-generated vs all positive manual (percentage of manual models covered by auto-generation)
76-
*/
77-
78-
/*
79-
* metric2:
80-
* Coverage relative to total number of APIs: (“auto-only” + “both” + “manual-only”) / “all”
81-
* Auto-generated vs specific pos+neg subset (top-N manual, random)
82-
*/
83-
8471
from
85-
string package, float generatedPos, float manualPos, float bothPos, float notModeled, float all,
86-
float metric1, float metric2
72+
string package, float generatedOnly, float both, float manualOnly, float non, float all,
73+
float generatedCoverage, float manualCoverage
8774
where
88-
generatedPos = getNumMadModels(package, "generated") and
89-
manualPos = getNumMadModels(package, "manual") and
90-
bothPos = getNumMadModels(package, "both") and
91-
notModeled = getNumApisWithoutMadModel(package) and
92-
all = generatedPos + manualPos + bothPos + notModeled and
93-
metric1 = (bothPos / (bothPos + manualPos)) and // ! I believe this metric was intended to be only on the positive ones?
94-
metric2 = (generatedPos + bothPos + manualPos) / all
95-
select package, generatedPos, manualPos, bothPos, notModeled, all, metric1, metric2 order by package
75+
generatedOnly = getNumMadModels(package, "generated") and
76+
manualOnly = getNumMadModels(package, "manual") and
77+
both = getNumMadModels(package, "both") and
78+
non = getNumApisWithoutMadModel(package) and // ! edit this
79+
all = generatedOnly + both + manualOnly + non and
80+
generatedCoverage = (both / (both + manualOnly)) and // Proportion of manual models covered by generated ones
81+
manualCoverage = (both / (both + generatedOnly)) // Proportion of generated models covered by manual ones
82+
select package, generatedOnly, both, manualOnly, non, all, generatedCoverage, manualCoverage
83+
order by package

0 commit comments

Comments
 (0)