Automated Syntactic Refactoring—Using AST Differencing as a Case Study

碩士 === 國立交通大學 === 資訊科學與工程研究所 === 107 === With the increasing complexity and scale of nowadays software systems, programmers havespent more time on repetitive code refactoring tasks such as fixing security bugs or upgradingdevelopment libraries. Those tasks are error-prone and undermine programmers’...

Full description

Bibliographic Details
Main Authors: Lee, Yun-Wei, 李昀瑋
Other Authors: You, Yi-Ping
Format: Others
Language:en_US
Published: 2019
Online Access:http://ndltd.ncl.edu.tw/handle/6ypyek
id ndltd-TW-107NCTU5394065
record_format oai_dc
spelling ndltd-TW-107NCTU53940652019-06-27T05:42:50Z http://ndltd.ncl.edu.tw/handle/6ypyek Automated Syntactic Refactoring—Using AST Differencing as a Case Study 自動化程式文法修改系統—使用抽象文法樹差異為例 Lee, Yun-Wei 李昀瑋 碩士 國立交通大學 資訊科學與工程研究所 107 With the increasing complexity and scale of nowadays software systems, programmers havespent more time on repetitive code refactoring tasks such as fixing security bugs or upgradingdevelopment libraries. Those tasks are error-prone and undermine programmers’ productivitygradually. Unfortunately, there is no tool that automates these tasks, and the cost of developingan exclusive tool for a specific refactoring task is extremely high. In this thesis, we propose aframework, calledSyntaFactor, that helps to automate the code refactoring process with usersof the framework providing code refactoring guidelines, which are written in the same languagethat they used for programming with only some new operators for expressing the changes aftercode refactoring. Given an input source code of a program and a code refactoring guideline,SyntaFactor transforms the input source code according to the guideline via an execution en-gine, which (1) constructs the abstract syntax trees (AST) of the program fragment before andafter refactoring from the guideline and also the AST of the input source code, (2) locates whereto perform refactoring in the input source code, (3) determines what to change by differentiat-ing the ASTs before and after refactoring, and (4) finally modifies the input source code withthe information in steps (2) and (3). A language-independent representation is also proposed inSyntaFactor in order to allow SyntaFactor to be extendable for supporting different program-ming languages. Our evaluations demonstrated that we have successfully automated the processof non-trivial API upgrades for four renowned open source projects and also the process of fix-ing MISRA C non-compliances (with a reduction of 80%) for five MIRSA C rules in five opensource projects. We believe that with SyntaFactor, we can free programmers from dealing withtedious and error-prone tasks and thus allow them to devote their time to more productive work. You, Yi-Ping Yang, Wuu 游逸平 楊武 2019 學位論文 ; thesis 25 en_US
collection NDLTD
language en_US
format Others
sources NDLTD
description 碩士 === 國立交通大學 === 資訊科學與工程研究所 === 107 === With the increasing complexity and scale of nowadays software systems, programmers havespent more time on repetitive code refactoring tasks such as fixing security bugs or upgradingdevelopment libraries. Those tasks are error-prone and undermine programmers’ productivitygradually. Unfortunately, there is no tool that automates these tasks, and the cost of developingan exclusive tool for a specific refactoring task is extremely high. In this thesis, we propose aframework, calledSyntaFactor, that helps to automate the code refactoring process with usersof the framework providing code refactoring guidelines, which are written in the same languagethat they used for programming with only some new operators for expressing the changes aftercode refactoring. Given an input source code of a program and a code refactoring guideline,SyntaFactor transforms the input source code according to the guideline via an execution en-gine, which (1) constructs the abstract syntax trees (AST) of the program fragment before andafter refactoring from the guideline and also the AST of the input source code, (2) locates whereto perform refactoring in the input source code, (3) determines what to change by differentiat-ing the ASTs before and after refactoring, and (4) finally modifies the input source code withthe information in steps (2) and (3). A language-independent representation is also proposed inSyntaFactor in order to allow SyntaFactor to be extendable for supporting different program-ming languages. Our evaluations demonstrated that we have successfully automated the processof non-trivial API upgrades for four renowned open source projects and also the process of fix-ing MISRA C non-compliances (with a reduction of 80%) for five MIRSA C rules in five opensource projects. We believe that with SyntaFactor, we can free programmers from dealing withtedious and error-prone tasks and thus allow them to devote their time to more productive work.
author2 You, Yi-Ping
author_facet You, Yi-Ping
Lee, Yun-Wei
李昀瑋
author Lee, Yun-Wei
李昀瑋
spellingShingle Lee, Yun-Wei
李昀瑋
Automated Syntactic Refactoring—Using AST Differencing as a Case Study
author_sort Lee, Yun-Wei
title Automated Syntactic Refactoring—Using AST Differencing as a Case Study
title_short Automated Syntactic Refactoring—Using AST Differencing as a Case Study
title_full Automated Syntactic Refactoring—Using AST Differencing as a Case Study
title_fullStr Automated Syntactic Refactoring—Using AST Differencing as a Case Study
title_full_unstemmed Automated Syntactic Refactoring—Using AST Differencing as a Case Study
title_sort automated syntactic refactoring—using ast differencing as a case study
publishDate 2019
url http://ndltd.ncl.edu.tw/handle/6ypyek
work_keys_str_mv AT leeyunwei automatedsyntacticrefactoringusingastdifferencingasacasestudy
AT lǐyúnwěi automatedsyntacticrefactoringusingastdifferencingasacasestudy
AT leeyunwei zìdònghuàchéngshìwénfǎxiūgǎixìtǒngshǐyòngchōuxiàngwénfǎshùchàyìwèilì
AT lǐyúnwěi zìdònghuàchéngshìwénfǎxiūgǎixìtǒngshǐyòngchōuxiàngwénfǎshùchàyìwèilì
_version_ 1719213401940426752