Skip to content

Commit c442d29

Browse files
committed
latex table for papers
1 parent 9786d4d commit c442d29

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,4 @@ dotnet_3/em/embedded/rest/ScsDriver/generated-tests/
251251
/jdk_8_maven/em/external/thrift/scs/target/
252252
/jdk_17_maven/cs/web/spring-petclinic/target/
253253
/jdk_17_maven/em/embedded/web/spring-petclinic/target/
254+
/statistics/table_suts.tex

statistics/analyze.R

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ handleMultiValues <- function(s){
88
return(gsub(";", ", ", s))
99
}
1010

11+
### return a boolean vector, where each position in respect to x is true if that element appear in y
12+
areInTheSubset <- function(x,y){
13+
14+
### first consider vector with all FALSE
15+
result = x!=x
16+
for(k in y){
17+
result = result | x==k
18+
}
19+
return(result)
20+
}
21+
22+
1123
markdown <- function (){
1224

1325
dt <- read.csv(DATA_FILE,header=T)
@@ -44,6 +56,52 @@ markdown <- function (){
4456
}
4557

4658

59+
latex <- function(TABLE,SUTS){
60+
61+
# TODO what columns to include further could be passed as boolean selection.
62+
# will implement when needed
63+
64+
dt <- read.csv(DATA_FILE,header=T)
65+
dt = dt[areInTheSubset(dt$NAME,SUTS),]
66+
dt = dt[order(dt$NAME),]
67+
68+
unlink(TABLE)
69+
sink(TABLE, append = TRUE, split = TRUE)
70+
71+
cat("\\begin{tabular}{l rrr}\\\\ \n")
72+
cat("\\toprule \n")
73+
cat("SUT & \\#SourceFiles & \\#LOCs & \\#Enbdpoints \\\\ \n")
74+
cat("\\midrule \n")
75+
76+
for (i in 1:nrow(dt)){
77+
78+
row = dt[i,]
79+
cat("\\emph{",row$NAME,"}",sep="")
80+
81+
cat(" & ", row$FILES)
82+
cat(" & ", row$LOCS)
83+
cat(" & ", row$ENDPOINTS)
84+
85+
cat(" \\\\ \n")
86+
}
87+
88+
cat("\\midrule \n")
89+
cat("Total",nrow(dt))
90+
cat(" & ")
91+
cat(sum(dt$FILES))
92+
cat(" & ")
93+
cat(sum(dt$LOCS))
94+
cat(" & ")
95+
cat(sum(dt$ENDPOINTS))
96+
cat(" \\\\ \n")
97+
98+
cat("\\bottomrule \n")
99+
cat("\\end{tabular} \n")
100+
101+
sink()
102+
}
103+
104+
47105
oldLatexTable <- function(){
48106

49107
dt <- read.csv(DATA_FILE,header=T)

statistics/suts.R

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
source("analyze.R")
2+
3+
suts <- function(){
4+
5+
# This generated table should be added to Git, as will change based on papers
6+
TABLE = "./table_suts.tex"
7+
8+
#Names here should match what in data.csv
9+
SUTS = c(
10+
"catwatch",
11+
"cwa-verification",
12+
"features-service",
13+
"gestaohospital",
14+
"languagetool",
15+
"ocvn",
16+
"proxyprint",
17+
"rest-ncs",
18+
"rest-news",
19+
"rest-scs",
20+
"restcountries",
21+
"scout-api",
22+
"genome-nexus",
23+
"market",
24+
#"petclinic-graphql",
25+
#"patio-api",
26+
#"timbuctoo",
27+
#"graphql-ncs",
28+
#"graphql-scs",
29+
#"thrift-ncs",
30+
#"thrift-scs",
31+
#"grpc-ncs",
32+
#"grpc-scs",
33+
#"signal-registration",
34+
"ind0",
35+
#"ind1",
36+
""
37+
)
38+
39+
latex(TABLE,SUTS)
40+
}
41+

0 commit comments

Comments
 (0)