From 1dabd08158c507b5eb4527ae9832d42289d169ec Mon Sep 17 00:00:00 2001 From: Azat Abdullin Date: Mon, 26 Aug 2024 18:13:31 +0200 Subject: [PATCH] Revert "m" This reverts commit 43af9afcc1bf9033548a5f7c9a59247fe45256ed. --- .../kotlin/org/plan/research/tga/analysis/Main.kt | 10 +--------- .../kotlin/org/plan/research/tga/analysis/csvify.kt | 13 ++++++------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/Main.kt b/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/Main.kt index 88e4a8b..975879b 100644 --- a/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/Main.kt +++ b/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/Main.kt @@ -177,23 +177,15 @@ fun main(args: Array) { .computeMutationScore(benchmark, testSuite, compilationResult) allData += String.format( - "%s, %s, %d, %s, %s, %d, %d, %.2f, %d, %d, %.2f, %d, %d, %.2f, %d, %d, %.2f, %s", + "%s, %s, %d, %s, %s, %.2f, %.2f, %.2f, %.2f, %s", tool, runName, iteration, benchmark.buildId, benchmark.klass, - coverage.compilationRate.numerator, - coverage.compilationRate.denominator, coverage.compilationRate.ratio * 100.0, - coverage.coverage.first().lines.covered, - coverage.coverage.first().lines.total, coverage.coverage.first().lines.ratio * 100.0, - coverage.coverage.first().branches.covered, - coverage.coverage.first().branches.total, coverage.coverage.first().branches.ratio * 100.0, - mutationScore.numerator, - mutationScore.denominator, mutationScore.ratio * 100.0, benchmarkProperties[benchmarkName]?.toList() ?.joinToString(", ") { "${it.first} -> ${it.second}" } ?: "" diff --git a/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/csvify.kt b/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/csvify.kt index 7e7d5b3..61dd97e 100644 --- a/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/csvify.kt +++ b/tga-analysis/src/main/kotlin/org/plan/research/tga/analysis/csvify.kt @@ -38,10 +38,9 @@ fun main(args: Array) { } ?: emptyMap() val metricsProvider = MetricsProvider(Paths.get("metrics.json")) - val header = "tool,runName,iteration,benchmark buildId,benchmark klass,compiled tests,total tests,compilation rate," + - "covered lines,total lines,line coverage," + - "covered branches,total branches,branch coverage,mutation score,package,internal dependencies,stdlib dependencies," + - "external dependencies,language,comments,java docs,sloc,cyclomatic complexity" + val header = "tool,runName,iteration,benchmark buildId,benchmark klass,compilation rate,line coverage," + + "branch coverage,mutation score,package,internal dependencies,stdlib dependencies,external dependencies," + + "language,comments,java docs,sloc,cyclomatic complexity" val valueTypes = listOf( "PrimitiveModel" to PrimitiveModel, "NullModel" to NullModel, @@ -61,16 +60,16 @@ fun main(args: Array) { val fullHeader = header + "," + valueTypes.joinToString(separator = ",") { it.first } - val newCsv = Paths.get("TestSpark-metrics-gpt4o-300.csv").bufferedWriter().use { writer -> + val newCsv = Paths.get("TestSpark-metrics-llama2-300.csv").bufferedWriter().use { writer -> writer.write(fullHeader) writer.write("\n") for (file in input.listDirectoryEntries().filter { it.name.endsWith(".csv") }) { val (tool, _, runName, iteration) = file.name.removeSuffix(".csv").split('-') - if (runName != "gpt4o") continue + if (runName != "llama2") continue for (run in file.readLines()) { - val fixedLine = run.split(", ").take(15).toMutableList() + val fixedLine = run.split(", ").take(9).toMutableList() if (fixedLine[3] !in benchmarkProperties) { continue }