Skip to content

Commit 10d7269

Browse files
authored
Merge pull request #68 from EMResearch/sut-table
Sut table
2 parents 93dbdd4 + c442d29 commit 10d7269

File tree

9 files changed

+252
-36
lines changed

9 files changed

+252
-36
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

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ We just re-implemented in different languages, and put them behind a web service
6868
For the RESTful APIs, each API has an endpoint where the OpenAPI/Swagger schemas can be downloaded from.
6969
For simplicity, all schemas are also available as JSON/YML files under the folder [openapi-swagger](./openapi-swagger).
7070

71+
More details (e.g., #LOCs and used databases) on these APIs can be found [in this table](statistics/table_emb.md).
72+
7173
### REST: Java/Kotlin
7274

7375
* Genome Nexus (MIT), [jdk_8_maven/cs/rest-gui/genome-nexus](jdk_8_maven/cs/rest-gui/genome-nexus), from [https://github.com/genome-nexus/genome-nexus](https://github.com/genome-nexus/genome-nexus)
@@ -113,13 +115,17 @@ For simplicity, all schemas are also available as JSON/YML files under the folde
113115
* SCS, [jdk_8_maven/cs/graphql/graphql-scs](jdk_8_maven/cs/graphql/graphql-scs), (not-known license, artificial string examples coming from different sources)
114116

115117

116-
### RPC (Thrift/gRPC): Java
118+
### RPC (e.g.,Thrift and gRPC): Java
117119

118120
* Signal-Registration (not-known license), [jdk_17_maven/cs/grpc/signal-registration](jdk_17_maven/cs/grpc/signal-registration), from [https://github.com/signalapp/registration-service]()
119121

120-
* NCS (not-known license, artificial numerical examples coming from different sources)
122+
* NCS (not-known license, artificial numerical examples coming from different sources).
123+
Thrift: [jdk_8_maven/cs/rpc/thrift/artificial/thrift-ncs](jdk_8_maven/cs/rpc/thrift/artificial/thrift-ncs).
124+
gRPC: [jdk_8_maven/cs/rpc/grpc/artificial/grpc-ncs](jdk_8_maven/cs/rpc/grpc/artificial/grpc-ncs).
121125

122-
* SCS (not-known license, artificial string examples coming from different sources)
126+
* SCS (not-known license, artificial string examples coming from different sources).
127+
Thrift: [jdk_8_maven/cs/rpc/thrift/artificial/thrift-scs](jdk_8_maven/cs/rpc/thrift/artificial/thrift-scs).
128+
gRPC: [jdk_8_maven/cs/rpc/grpc/artificial/grpc-scs](jdk_8_maven/cs/rpc/grpc/artificial/grpc-scs).
123129

124130

125131
### WEB: backend in Java/Kotlin

notes_adding_suts.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ As there are quite a few things to keep in mind, we list here the most important
7575
Need to specify the license, folder location on EMB, and original source repositories.
7676
See other SUT entries to check exactly how to do it (especially how to add clickable links in Markdown).
7777

78+
- the content of folder "statistics" needs to be updated.
79+
In particular, need to create a new entry for the API in "data.csv" file.
80+
To count #Files, can use bash command
81+
82+
find . -name *.java | wc -l
83+
84+
assuming the project is in Java (.kt for Kotlin otherwise).
85+
Note that this pick up everything, including tests, and automatically generated files from build (eg. for .proto)/
86+
To count LOCs, can use
87+
88+
cat `find . -name *.java` | wc -l
89+
90+
- once "data.csv" file has been updated, need to recreate "table_emb.md" from "analyze.R" -> "markdown()" function.
91+
7892
- the drivers should be written under "jdk_X_Y/em/embedded" and "jdk_X_Y/em/external", following the same tree structure
7993
of the SUT under "cs", eg, "jdk_17_maven/cs/grpc/NAME" would lead to embedded driver be under
8094
"jdk_17_maven/em/embedded/grpc/NAME".

statistics/analyze.R

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,114 @@
11

2-
# NAME,TYPE,LANGUAGE,FILES,LOCS,DATABASE,LICENSE,URL
2+
#EMB,NAME,TYPE,LANGUAGE,RUNTIME,BUILD,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL
33
DATA_FILE="./data.csv"
44

5-
latexTable <- function(){
5+
UNDEFINED = "UNDEFINED"
6+
7+
handleMultiValues <- function(s){
8+
return(gsub(";", ", ", s))
9+
}
10+
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+
23+
markdown <- function (){
24+
25+
dt <- read.csv(DATA_FILE,header=T)
26+
27+
dt = dt[order(dt$TYPE, dt$LANGUAGE, -dt$LOCS, dt$NAME),]
28+
# skip industrial APIs that are not stored in EMB
29+
dt = dt[dt$EMB==TRUE,]
30+
31+
TABLE = "./table_emb.md"
32+
unlink(TABLE)
33+
sink(TABLE, append = TRUE, split = TRUE)
34+
35+
#EMB,NAME,TYPE,LANGUAGE,RUNTIME,BUILD,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL
36+
cat("|Name|Type|#LOCs|#SourceFiles|#Endpoints|Language(s)|Runtime|Build Tool|Database(s)|\n")
37+
cat("|----|----|----:|-----------:|---------:|-----------|-------|----------|-----------|\n")
38+
39+
for (i in 1:nrow(dt)){
40+
41+
row = dt[i,]
42+
cat("|__",row$NAME,"__|",sep="")
43+
44+
cat(row$TYPE,"|",sep="")
45+
cat(row$LOCS,"|",sep="")
46+
cat(row$FILES,"|",sep="")
47+
cat(row$ENDPOINTS,"|",sep="")
48+
cat(handleMultiValues(row$LANGUAGE),"|",sep="")
49+
cat(row$RUNTIME,"|",sep="")
50+
cat(row$BUILD,"|",sep="")
51+
cat(handleMultiValues(row$DATABASE),"|",sep="")
52+
cat("\n")
53+
}
54+
55+
sink()
56+
}
57+
58+
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+
105+
oldLatexTable <- function(){
6106

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

9109
dt = dt[order(dt$TYPE, dt$LANGUAGE, -dt$LOCS, dt$NAME),]
10110

11-
TABLE = "./statistics_table_emb.tex"
111+
TABLE = "./old_statistics_table_emb.tex"
12112
unlink(TABLE)
13113
sink(TABLE, append = TRUE, split = TRUE)
14114

statistics/data.csv

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
NAME,TYPE,LANGUAGE,FILES,LOCS,DATABASE,LICENSE,URL
2-
cyclotron,REST,JavaScript,25,5803,MongoDB,MIT,https://github.com/ExpediaInceCommercePlatform/cyclotron
3-
disease-sh-api,REST,JavaScript,57,3343,Redis,GPL,https://github.com/disease-sh/API
4-
js-rest-ncs,REST,JavaScript,8,775,,UNDEFINED,UNDEFINED
5-
js-rest-scs,REST,JavaScript,13,1046,,UNDEFINED,UNDEFINED
6-
realworld-app,REST,TypeScript,37,1229,MySQL,ISC,https://github.com/lujakob/nestjs-realworld-example-app
7-
spacex-api,REST,JavaScript,63,4966,MongoDB,Apache,https://github.com/r-spacex/SpaceX-API
8-
catwatch,REST,Java,106,9636,H2,Apache,https://github.com/zalando-incubator/catwatch
9-
cwa-verification,REST,Java,47,3955,H2,Apache,https://github.com/corona-warn-app/cwa-verification-server
10-
features-service,REST,Java,39,2275,H2,Apache,https://github.com/JavierMF/features-service
11-
gestaohospital-rest,REST,Java,33,3506,MongoDB,UNDEFINED,https://github.com/ValchanOficial/GestaoHospital
12-
languagetool,REST,Java,1385,174781,,LGPL,https://github.com/languagetool-org/languagetool
13-
ocvn-rest,REST,Java,526,45521,H2;MongoDB,MIT,https://github.com/devgateway/ocvn
14-
proxyprint,REST,Java,73,8338,H2,Apache,https://github.com/ProxyPrint/proxyprint-kitchen
15-
rest-ncs,REST,Java,9,605,,UNDEFINED,UNDEFINED
16-
rest-news,REST,Kotlin,11,857,H2,LGPL,https://github.com/arcuri82/testing_security_development_enterprise_systems
17-
rest-scs,REST,Java,13,862,,UNDEFINED,UNDEFINED
18-
restcountries,REST,Java,24,1977,,MPL,https://github.com/apilayer/restcountries
19-
scout-api,REST,Java,93,9736,H2,MIT,https://github.com/mikaelsvensson/scout-api
20-
genome-nexus,REST,Java,405,30004,MongoDB,MIT,https://github.com/genome-nexus/genome-nexus
21-
market,REST,Java,124,9861,H2,MIT,https://github.com/aleksey-lukyanets/market
22-
petclinic-graphql,GraphQL,Java,89,5212,PostgreSQL,Apache,https://github.com/spring-petclinic/spring-petclinic-graphql
23-
patio-api,GraphQL,Java,178,18048,PostgreSQL,GPL,https://github.com/patio-team/patio-api
24-
timbuctoo,GraphQL,Java,1113,107729,Neo4j,GPL,https://github.com/HuygensING/timbuctoo
25-
graphql-ncs,GraphQL,Kotlin,8,548,,UNDEFINED,UNDEFINED
26-
graphql-scs,GraphQL,Kotlin,13,577,,UNDEFINED,UNDEFINED
27-
react-finland,GraphQL,TypeScript,461,16206,,UNDEFINED,https://github.com/ReactFinland/graphql-api
28-
ecommerce-server,GraphQL,TypeScript,49,1815,PostgreSQL,MIT,https://github.com/react-shop/react-ecommerce
29-
rpc-thrift-ncs,RPC-Thrift,Java,9,585,,UNDEFINED,UNDEFINED
30-
rpc-thrift-scs,RPC-Thrift,Java,14,772,,UNDEFINED,UNDEFINED
1+
EMB,NAME,TYPE,LANGUAGE,RUNTIME,BUILD,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL
2+
TRUE,catwatch,REST,Java,JDK 8,Maven,106,9636,H2,Apache,14,https://github.com/zalando-incubator/catwatch
3+
TRUE,cwa-verification,REST,Java,JDK 11,Maven,47,3955,H2,Apache,5,https://github.com/corona-warn-app/cwa-verification-server
4+
TRUE,features-service,REST,Java,JDK 8,Maven,39,2275,H2,Apache,18,https://github.com/JavierMF/features-service
5+
TRUE,gestaohospital,REST,Java,JDK 8,Maven,33,3506,MongoDB,UNDEFINED,20,https://github.com/ValchanOficial/GestaoHospital
6+
TRUE,languagetool,REST,Java,JDK 8,Maven,1385,174781,,LGPL,2,https://github.com/languagetool-org/languagetool
7+
TRUE,ocvn,REST,Java,JDK 8,Maven,526,45521,H2;MongoDB,MIT,258,https://github.com/devgateway/ocvn
8+
TRUE,proxyprint,REST,Java,JDK 8,Maven,73,8338,H2,Apache,74,https://github.com/ProxyPrint/proxyprint-kitchen
9+
TRUE,rest-ncs,REST,Java,JDK 8,Maven,9,605,,UNDEFINED,6,UNDEFINED
10+
TRUE,rest-news,REST,Kotlin,JDK 8,Maven,11,857,H2,LGPL,7,https://github.com/arcuri82/testing_security_development_enterprise_systems
11+
TRUE,rest-scs,REST,Java,JDK 8,Maven,13,862,,UNDEFINED,11,UNDEFINED
12+
TRUE,restcountries,REST,Java,JDK 8,Maven,24,1977,,MPL,22,https://github.com/apilayer/restcountries
13+
TRUE,scout-api,REST,Java,JDK 8,Maven,93,9736,H2,MIT,49,https://github.com/mikaelsvensson/scout-api
14+
TRUE,genome-nexus,REST,Java,JDK 8,Maven,405,30004,MongoDB,MIT,23,https://github.com/genome-nexus/genome-nexus
15+
TRUE,market,REST,Java,JDK 11,Maven,124,9861,H2,MIT,13,https://github.com/aleksey-lukyanets/market
16+
TRUE,petclinic-graphql,GraphQL,Java,JDK 8,Maven,89,5212,PostgreSQL,Apache,15,https://github.com/spring-petclinic/spring-petclinic-graphql
17+
TRUE,patio-api,GraphQL,Java,JDK 11,Gradle,178,18048,PostgreSQL,GPL,20,https://github.com/patio-team/patio-api
18+
TRUE,timbuctoo,GraphQL,Java,JDK 11,Maven,1113,107729,Neo4j,GPL,18,https://github.com/HuygensING/timbuctoo
19+
TRUE,graphql-ncs,GraphQL,Kotlin,JDK 8,Maven,8,548,,UNDEFINED,6,UNDEFINED
20+
TRUE,graphql-scs,GraphQL,Kotlin,JDK 8,Maven,13,577,,UNDEFINED,11,UNDEFINED
21+
TRUE,thrift-ncs,Thrift,Java,JDK 8,Maven,9,585,,UNDEFINED,6,UNDEFINED
22+
TRUE,thrift-scs,Thrift,Java,JDK 8,Maven,14,772,,UNDEFINED,11,UNDEFINED
23+
TRUE,grpc-ncs,gRPC,Java,JDK 8,Maven,9,638,,UNDEFINED,6,UNDEFINED
24+
TRUE,grpc-scs,gRPC,Java,JDK 8,Maven,14,894,,UNDEFINED,11,UNDEFINED
25+
TRUE,signal-registration,gRPC,Java,JDK 17,Maven,177,13652,,UNDEFINED,5,https://github.com/signalapp/registration-service
26+
FALSE,ind0,REST,Java,JDK 8,Gradle,103,17039,PostgreSQL,Proprietary,20,UNDEFINED
27+
FALSE,ind1,REST,Java;Kotlin,JDK 11,Gradle,163,15240,PostgreSQL,Proprietary,53,UNDEFINED
3128

statistics/old_data.csv

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
NAME,TYPE,LANGUAGE,FILES,LOCS,DATABASE,LICENSE,URL
2+
cyclotron,REST,JavaScript,25,5803,MongoDB,MIT,https://github.com/ExpediaInceCommercePlatform/cyclotron
3+
disease-sh-api,REST,JavaScript,57,3343,Redis,GPL,https://github.com/disease-sh/API
4+
js-rest-ncs,REST,JavaScript,8,775,,UNDEFINED,UNDEFINED
5+
js-rest-scs,REST,JavaScript,13,1046,,UNDEFINED,UNDEFINED
6+
realworld-app,REST,TypeScript,37,1229,MySQL,ISC,https://github.com/lujakob/nestjs-realworld-example-app
7+
spacex-api,REST,JavaScript,63,4966,MongoDB,Apache,https://github.com/r-spacex/SpaceX-API
8+
catwatch,REST,Java,106,9636,H2,Apache,https://github.com/zalando-incubator/catwatch
9+
cwa-verification,REST,Java,47,3955,H2,Apache,https://github.com/corona-warn-app/cwa-verification-server
10+
features-service,REST,Java,39,2275,H2,Apache,https://github.com/JavierMF/features-service
11+
gestaohospital-rest,REST,Java,33,3506,MongoDB,UNDEFINED,https://github.com/ValchanOficial/GestaoHospital
12+
languagetool,REST,Java,1385,174781,,LGPL,https://github.com/languagetool-org/languagetool
13+
ocvn-rest,REST,Java,526,45521,H2;MongoDB,MIT,https://github.com/devgateway/ocvn
14+
proxyprint,REST,Java,73,8338,H2,Apache,https://github.com/ProxyPrint/proxyprint-kitchen
15+
rest-ncs,REST,Java,9,605,,UNDEFINED,UNDEFINED
16+
rest-news,REST,Kotlin,11,857,H2,LGPL,https://github.com/arcuri82/testing_security_development_enterprise_systems
17+
rest-scs,REST,Java,13,862,,UNDEFINED,UNDEFINED
18+
restcountries,REST,Java,24,1977,,MPL,https://github.com/apilayer/restcountries
19+
scout-api,REST,Java,93,9736,H2,MIT,https://github.com/mikaelsvensson/scout-api
20+
genome-nexus,REST,Java,405,30004,MongoDB,MIT,https://github.com/genome-nexus/genome-nexus
21+
market,REST,Java,124,9861,H2,MIT,https://github.com/aleksey-lukyanets/market
22+
petclinic-graphql,GraphQL,Java,89,5212,PostgreSQL,Apache,https://github.com/spring-petclinic/spring-petclinic-graphql
23+
patio-api,GraphQL,Java,178,18048,PostgreSQL,GPL,https://github.com/patio-team/patio-api
24+
timbuctoo,GraphQL,Java,1113,107729,Neo4j,GPL,https://github.com/HuygensING/timbuctoo
25+
graphql-ncs,GraphQL,Kotlin,8,548,,UNDEFINED,UNDEFINED
26+
graphql-scs,GraphQL,Kotlin,13,577,,UNDEFINED,UNDEFINED
27+
react-finland,GraphQL,TypeScript,461,16206,,UNDEFINED,https://github.com/ReactFinland/graphql-api
28+
ecommerce-server,GraphQL,TypeScript,49,1815,PostgreSQL,MIT,https://github.com/react-shop/react-ecommerce
29+
rpc-thrift-ncs,RPC-Thrift,Java,9,585,,UNDEFINED,UNDEFINED
30+
rpc-thrift-scs,RPC-Thrift,Java,14,772,,UNDEFINED,UNDEFINED
31+

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+

statistics/table_emb.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
|Name|Type|#LOCs|#SourceFiles|#Endpoints|Language(s)|Runtime|Build Tool|Database(s)|
2+
|----|----|----:|-----------:|---------:|-----------|-------|----------|-----------|
3+
|__timbuctoo__|GraphQL|107729|1113|18|Java|JDK 11|Maven|Neo4j|
4+
|__patio-api__|GraphQL|18048|178|20|Java|JDK 11|Gradle|PostgreSQL|
5+
|__petclinic-graphql__|GraphQL|5212|89|15|Java|JDK 8|Maven|PostgreSQL|
6+
|__graphql-scs__|GraphQL|577|13|11|Kotlin|JDK 8|Maven||
7+
|__graphql-ncs__|GraphQL|548|8|6|Kotlin|JDK 8|Maven||
8+
|__signal-registration__|gRPC|13652|177|5|Java|JDK 17|Maven||
9+
|__grpc-scs__|gRPC|894|14|11|Java|JDK 8|Maven||
10+
|__grpc-ncs__|gRPC|638|9|6|Java|JDK 8|Maven||
11+
|__languagetool__|REST|174781|1385|2|Java|JDK 8|Maven||
12+
|__ocvn__|REST|45521|526|258|Java|JDK 8|Maven|H2, MongoDB|
13+
|__genome-nexus__|REST|30004|405|23|Java|JDK 8|Maven|MongoDB|
14+
|__market__|REST|9861|124|13|Java|JDK 11|Maven|H2|
15+
|__scout-api__|REST|9736|93|49|Java|JDK 8|Maven|H2|
16+
|__catwatch__|REST|9636|106|14|Java|JDK 8|Maven|H2|
17+
|__proxyprint__|REST|8338|73|74|Java|JDK 8|Maven|H2|
18+
|__cwa-verification__|REST|3955|47|5|Java|JDK 11|Maven|H2|
19+
|__gestaohospital__|REST|3506|33|20|Java|JDK 8|Maven|MongoDB|
20+
|__features-service__|REST|2275|39|18|Java|JDK 8|Maven|H2|
21+
|__restcountries__|REST|1977|24|22|Java|JDK 8|Maven||
22+
|__rest-scs__|REST|862|13|11|Java|JDK 8|Maven||
23+
|__rest-ncs__|REST|605|9|6|Java|JDK 8|Maven||
24+
|__rest-news__|REST|857|11|7|Kotlin|JDK 8|Maven|H2|
25+
|__thrift-scs__|Thrift|772|14|11|Java|JDK 8|Maven||
26+
|__thrift-ncs__|Thrift|585|9|6|Java|JDK 8|Maven||

0 commit comments

Comments
 (0)