机构地区:[1]State Key Laboratory for Novel Software Technology, Nanjing University
出 处:《Science China(Information Sciences)》2018年第1期165-182,共18页中国科学(信息科学)(英文版)
基 金:supported by National Natural Science Foundation of China (Grant Nos. 61472175, 61472178, 61403187);Natural Science Foundation of Jiangsu Province of China (Grant No. BK20140611);National Key Basic Research and Development Program of China (Grant No. 2014CB340702)
摘 要:Dynamic features in programming languages support the modification of the execution status at runtime, which is often considered helpful in rapid development and prototyping. However, it was also reported that some dynamic feature code tends to be change-prone or error-prone. We present the first study that analyzes the changes of dynamic feature code and the roles of dynamic features in bug-fix activities for the Python language. We used an AST-based differencing tool to capture fine-grained source code changes from 17926 bug-fix commits in 17 Python projects. Using this data, we conducted an empirical study on the changes of dynamic feature code when fixing bugs in Python. First, we investigated the characteristics of dynamic feature code changes, by comparing the changes between dynamic feature code and non-dynamic feature code when fixing bugs, and comparing dynamic feature changes between bug-fix and non-bugfix activities. Second, we explored 226 bug-fix commits to investigate the motivation and behaviors of dynamic feature changes when fixing bugs. The study results reveal that(1) the changes of dynamic feature code are significantly related to bug-fix activities rather than non-bugfix activities;(2) compared with non-dynamic feature code, dynamic feature code is inserted or updated more frequently when fixing bugs;(3) developers often insert dynamic feature code as type checks or attribute checks to fix type errors and attribute errors;(4) the misuse of dynamic features introduces bugs in dynamic feature code, and the bugs are often fixed by adding a check or adding an exception handling. As a benefit of this paper, we gain insights into the manner in which developers and researchers handle the changes of dynamic feature code when fixing bugs.Dynamic features in programming languages support the modification of the execution status at runtime, which is often considered helpful in rapid development and prototyping. However, it was also reported that some dynamic feature code tends to be change-prone or error-prone. We present the first study that analyzes the changes of dynamic feature code and the roles of dynamic features in bug-fix activities for the Python language. We used an AST-based differencing tool to capture fine-grained source code changes from 17926 bug-fix commits in 17 Python projects. Using this data, we conducted an empirical study on the changes of dynamic feature code when fixing bugs in Python. First, we investigated the characteristics of dynamic feature code changes, by comparing the changes between dynamic feature code and non-dynamic feature code when fixing bugs, and comparing dynamic feature changes between bug-fix and non-bugfix activities. Second, we explored 226 bug-fix commits to investigate the motivation and behaviors of dynamic feature changes when fixing bugs. The study results reveal that(1) the changes of dynamic feature code are significantly related to bug-fix activities rather than non-bugfix activities;(2) compared with non-dynamic feature code, dynamic feature code is inserted or updated more frequently when fixing bugs;(3) developers often insert dynamic feature code as type checks or attribute checks to fix type errors and attribute errors;(4) the misuse of dynamic features introduces bugs in dynamic feature code, and the bugs are often fixed by adding a check or adding an exception handling. As a benefit of this paper, we gain insights into the manner in which developers and researchers handle the changes of dynamic feature code when fixing bugs.
关 键 词:PYTHON fine-grained code changes change behaviors dynamic features bug fixing
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...