A study on the changes of dynamic feature code when fixing bugs: towards the benefits and costs of Python dynamic features

被引:4
作者
Zhifei CHEN
Wanwangying MA
Wei LIN
Lin CHEN
Yanhui LI
Baowen XU
机构
[1] StateKeyLaboratoryforNovelSoftwareTechnology,NanjingUniversity
关键词
Python; fine-grained code changes; change behaviors; dynamic features; bug fixing;
D O I
暂无
中图分类号
TP312 [程序语言、算法语言];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:169 / 186
页数:18
相关论文
共 12 条
[1]  
Empirical analysis of network measures for predicting high severity software faults[J]. Lin CHEN,Wanwangying MA,Yuming ZHOU,Lei XU,Ziyuan WANG,Zhifei CHEN,Baowen XU.Science China(Information Sciences). 2016(12)
[2]   Mubug:a mobile service for rapid bug tracking [J].
Yang FENG ;
Qin LIU ;
Mengyu DOU ;
Jia LIU ;
Zhenyu CHEN .
Science China(Information Sciences), 2016, 59 (01) :213-217
[3]  
Identifying extract class refactoring opportunities for internetware[J]. CHEN Lin,QIAN Ju,ZHOU YuMing,WANG Peng,XU BaoWen.Science China(Information Sciences). 2014(07)
[4]  
Finding shrink critical section refactoring opportunities for the evolution of concurrent code in trustworthy software[J]. QIAN Ju,CHEN Lin,XU BaoWen.Science China(Information Sciences). 2013(01)
[5]  
Towards an understanding of change types in bug fixing code[J] . Yangyang Zhao,Hareton Leung,Yibiao Yang,Yuming Zhou,Baowen Xu.Information and Software Technology . 2017
[6]  
A survey on bug-report analysis[J] . Jie Zhang,XiaoYin Wang,Dan Hao,Bing Xie,Lu Zhang,Hong Mei.Science China Information Sciences . 2015 (2)
[7]  
How changes affect software entropy: an empirical study[J] . Gerardo Canfora,Luigi Cerulo,Marta Cimitile,Massimiliano Di Penta.Empirical Software Engineering . 2014 (1)
[8]   A Large-Scale Empirical Study of Just-in-Time Quality Assurance [J].
Kamei, Yasutaka ;
Shihab, Emad ;
Adams, Bram ;
Hassan, Ahmed E. ;
Mockus, Audris ;
Sinha, Anand ;
Ubayashi, Naoyasu .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2013, 39 (06) :757-773
[9]   An exploratory study of the impact of antipatterns on class change- and fault-proneness [J].
Khomh, Foutse ;
Di Penta, Massimiliano ;
Gueheneuc, Yann-Gael ;
Antoniol, Giuliano .
EMPIRICAL SOFTWARE ENGINEERING, 2012, 17 (03) :243-275
[10]  
An analysis of the dynamic behavior of JavaScript programs[J] . Gregor Richards,Sylvain Lebresne,Brian Burg,Jan Vitek.ACM SIGPLAN Notices . 2010 (6)