A tool for automatic refactoring of Synchronous Javascript API to their Asynchronous equivalents. This repository contains the artifact for "Automatic Migration from Synchronous to Asynchronous JavaScript APIs" (OOPSLA 2021)
Refer to the Getting Started document for instructions for running the evaluation for this paper.
Asyncify (Desynchronizer) exports 3 functions, all of which return a promise upon completion. They are as follows:
- showTransformationsAndTransform(pathToCallgraphCSV: string): This method accepts 1 argument, path to the callgraph csv, returns a list of suggested transformations and changes associated with each transformation as a text file and html report, and applies all transformations automatically.
- showTransformations(pathToCallgraphCSV: string): This method accepts 1 argument, path to the callgraph csv, and returns a list of suggested transformations and changes associated with each transformation as a text file and html report.
- transform(pathToCallgraphCSV: string, nodesToTransform?: Array): This method accepts 1 argument, path to the callgraph csv, and applies all transformations automatically. Optionally, a second parameter containing an array of nodes (generated by showTrasnformations) may be provided to apply transformation to only a subset of the suggested transformations.
Run npm run build
to build the project with Webpack.
The build artifacts will be stored in the dist/
directory.
To execute the code, run node dist/asyncify.js
.
Note: Entry point for project is set to index.ts.
Run npm run mocha
to execute the unit tests via Mocha/Chai/Sinon.
Note: CLI output only, no files generated.
Run npm run test
to generate unit test coverage report using nyc.
Report location: reports/coverage
.
Run npm run lint
to generate a json and html lint report using TSLint-Html-report.
Report location: reports/tslint-html-report
Run npm run jscpd
to generate a json and html duplicity report using JSCPD-Html-report.
Report location: reports/code-duplicity
- Create a zip of all the contents of the asyncify directory (except node modules) into a file called "asyncify.zip"
- Ensure that this is present in the root of the project.
- Build the container using the command:
sudo docker build -t desynchronizer .
- Follow the steps in Getting Started to verify the evaluation.
- Or use the below command to run the container:
sudo docker run --name desynchronizer -it desynchronizer bash
- Or use the below command to run the container: