Skip to content

Commit

Permalink
cleaner jar generation, updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
s0nata committed May 20, 2022
1 parent 1c54537 commit 63d9094
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ Please see below for the experiment replication instructions.
`upDoc` is written in Java 11 and developed with `java-11-openjdk-amd64`.


### Compiling the sources
### Compiling and building the sources

Execute: `$ mvn clean compile`
To compile the sources execute: `$ mvn clean compile`

To build a jar execute: `$ mvn package`

## Test and Run

Expand All @@ -65,11 +66,18 @@ Use maven to run the unit tests: `$ mvn test`

### Code-comment mapping demo

To see how `upDoc` maps code to comments, you can run this command:
To see how `upDoc` maps code to comments, you can run these commands:

1) execution from the sources

`mvn exec:java -Dexec.mainClass="upDoc" -Dexec.args="analysis:mapping src/test/resources/paper-example/ FromAdaptiveIsomorphismInspectorFactory.java 0.2"`

It will run `upDoc` on a single method and report the similarities of the sentences of the javadoc comment to the method signature.
2) executing the jar

`java -jar upDoc-1.0.jar analysis:mapping ../src/test/resources/paper-example/ FromAdaptiveIsomorphismInspectorFactory.java 0.2
`

The demo will run `upDoc` on a single method and report the similarities of the sentences of the javadoc comment to the method signature.

### Replicate the experimental results from the publication

Expand All @@ -82,5 +90,3 @@ Execute `$ mvn -Dtest=PaperExampleStatTest test`
Execute `$ mvn -Dtest=ICPC19StatsTest test -DuseWMD="true"`

Please note that while in the paper we talk about 67 changes, in the outputs you will read a total of 40. It is because some changes were essentially equivalent, and it was not worth it to write a test for each duplicate (check the [google doc](https://docs.google.com/spreadsheets/d/1maRH6YY0OVuKSB2ACDhrz1-CQCS7sRHHoaZJDvLWi2Y/edit?usp=sharing) for the manual ICPC19 dataset analysis, where we list al lthe 67 changes in question)


22 changes: 13 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>doc-code-analysis</groupId>
<artifactId>upDoc</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>
<!-- Output to jar format -->
<packaging>jar</packaging>

Expand Down Expand Up @@ -41,7 +41,7 @@
<version>3.9.2</version>
<classifier>models</classifier>
</dependency>
<!-- added because of the models dependency above. TODO: remove output -->
<!-- added because of the models dependency above. -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down Expand Up @@ -132,28 +132,31 @@
<!-- For downloading and unzipping WMD models -->
<!-- NOTE: if for any reason these tasks fail, just follow the URL and
download + unzip the models manually. The unzipped .txt model (it is a single file)
must be under src/main/resources-->
must be under src/main/resources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-files</id>
<phase>prepare-package</phase>
<!-- <phase>compile</phase>-->
<goals>
<goal>run</goal>
</goals>
<configuration>
<!-- see https://ant.apache.org/manual/Tasks/ for reference -->
<tasks>
<!-- download file -->
<get src="http://star-rep.inf.usi.ch/alberto/glove/raw/master/glove-models.zip"
dest="${project.build.directory}/downloads/"
verbose="false"
usetimestamp="true"/>
<get src="https://star-rep.inf.usi.ch/alberto/glove/raw/master/glove-models.zip"
dest="${project.build.directory}/glove-models.zip"
verbose="off"
usetimestamp="false"
/>
<!-- unzip file -->
<unzip src="${project.build.directory}/downloads/"
<unzip src="${project.build.directory}/glove-models.zip"
dest="${project.basedir}/src/main/resources"/>

<delete file="${project.build.directory}/glove-models.zip"/>
</tasks>
</configuration>
</execution>
Expand All @@ -163,6 +166,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<systemProperties>
<property>
Expand Down

0 comments on commit 63d9094

Please sign in to comment.