This project is provided to investigate and recommend co-changed entities for JavaScript programs.
#Requirements:
-
Eclipse Luna standard 4.4, jdk 1.8.
-
Sqlite3.
-
Node.js 10.15.
-
Additional for TypedAST: Python 3.6+, pip3, Docker engine.
-
Download the projects to your project repo folder.
-
change line 334 in gittool.GitMinerVersion.java to the project repo folder.
-
For the project (Meteor for example) without package.json file, uncomment line 243-294 in gittool.GitMinerVersion.java to generate package.json files.
-
Read the document https://buildmedia.readthedocs.org/media/pdf/r2c/latest/r2c.pdf to learn how to get access to TypedAST, and generate AST.json files for the changed JavaScript files you have mined in the previous step (Git commit mining).
-
Run ast-consumer to extract AST.json archive.
-
Run vt.edu.util.UnZipTgz to unzip tgz files.
-
Change line 35 in jstest.ChangeExtracterClient3.java to the folder where the AST.json files are stored.
-
Change line 27 in jstest.TestChange2.java to the project repo folder.
-
Change line 12 in vt.edu.sql.SqliteManager.java to the sqlite file that is used.
-
Change line 20, 21 in jstest.jsToJson to where the "jsonModule.js" and "jsonScript.js" files are stored.
-
Run mainNode method in jstest.TestChange2.java to extract CDGs for those projects (Node.js) without AST.json files. Run mainOthers method in jstest.TestChange2 to extract CDGs for those projects with AST.json files.
-
Run vt.edu.empirical.GraphStatExtraction to characterize the co-changed entities.
Change the project String Array in vt.edu.graph.LMatchPatternExtraction.java, vt.edu.graph.LMatchCollapser.java, vt.edu.graph.LMatchPicGenerator.java, vt.edu.graph.LMatchSummary.java, vt.edu.graph.LMatchTopPattern.java. Run the main method in those java files in sequence.
-
For the projects without AST.json files (Node.js), run mainNodeData method in jstest.TestChange2.java.
-
For other projects, run mianFromDataOthers method in jstest.TestChange2.java.
-
Convert the data file to arff files (use wekaPre.ARFFGenerator.java)
-
Change line 322 and line 323 in wekaPre.WekaTest.java to where the training and testing arffs are stored.
-
Many typeds of machine learning models can be used to train the data in wekaPre.WekaTest.java.
https://drive.google.com/drive/folders/1TDcIHvBMLJJ00jUzV_-SYwhlbc-CYMkp?usp=sharing