An automated refactoring approach for asynchronous mechanism
DOI:
CSTR:
Author:
Affiliation:

Clc Number:

Fund Project:

The National Natural Science Foundation of China (61440012);the Supported by Foundation of Hebei Province for Basic Research Program (18960106D);the Supported by Foundation of Hebei Educational Committee for Scientific Research Program (ZD2019093)

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    As synchronization blocking will waste system resources and affect program performance in concurrent processing, an automatic refactoring approach on the asynchronous mechanism of CompletableFuture was proposed. Firstly, several static analyses by Wala static program analysis tool, such as visitor pattern analysis, alias analysis, and data flow analysis are used in this approach. The operation mode of shared variable data is determined, and then four asynchronous refactoring modes are set based on the asynchronous mechanism of CompletableFuture. Finally, the code is refactored according to different modes. An automatic tool AsynRef was implemented as the plugin by Eclipse JDT and four large-scale practical applications such as HSQLDB, Jenkins, JGroups, and SPECjbb2005 are automatically refactored by AsynRef. AsynRef is evaluated via the number of refactored locks, changed lines of code, accuracy, program performance after refactoring. The experimental results show that AsynRef can effectively complete the asynchronous refactoring of code and save time and effort compared with the traditional manual refactoring.

    Reference
    Related
    Cited by
Get Citation
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:July 05,2021
  • Revised:July 05,2021
  • Adopted:November 08,2021
  • Online:
  • Published:
Article QR Code