Structurally-Enhanced Approach for Automatic Code Transformation
Author:
Affiliation:

Clc Number:

Fund Project:

National Science Fund for Distinguished Young Scholars (61525201); National Natural Science Foundation of China (61972006)

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

    In software development, developers often need to change or update lost of similar codes. How to perform code transformation automatically has become a research hotspot in software engineering. An effective way is extracting the modification pattern from a set of similar code changes and applying it to automatic code transformation. In the related work, deep-learning-based approaches have achieved much progress, but they suffer from the problem of significant long-term dependency between the code. To address this challenge, an automatic code transformation method is proposed, namely ExpTrans. Based on the graph-based representations of code changes, ExpTrans is enhanced with the structural information of code. It labels the dependency between variables in code parsing and adopts the graph convolutional network and Transformer structure to capture the long-term dependency between the code. ExpTrans is first compared with existing learning-based approaches to evaluate its effectiveness; the results show that ExpTrans gains 11.8%--30.8% precision increment. Then, it is compared with rule-based approaches and the results demonstrate that ExpTrans significantly improves the correct rate of the modified instances.

    Reference
    Related
    Cited by
Get Citation

Yingkui Cao, Zeyu Sun, Yanzhen Zou, Bing Xie. Structurally-Enhanced Approach for Automatic Code Transformation. International Journal of Software and Informatics, 2021,11(3):357~378

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:
  • Revised:
  • Adopted:
  • Online: September 26,2021
  • Published: