On the Effectiveness of Unit Tests in Test-driven Development

被引:11
作者
Tosun, Ayse [1 ]
Ahmed, Muzamil [2 ]
Turhan, Burak [3 ]
Juristo, Natalia [4 ]
机构
[1] Istanbul Tech Univ, Istanbul, Turkey
[2] Univ Oulu, Oulu, Finland
[3] Brunel Univ London, Uxbridge, Middx, England
[4] Univ Politech Madrid, Madrid, Spain
来源
PROCEEDINGS OF THE 2018 INTERNATIONAL CONFERENCE ON SOFTWARE AND SYSTEM PROCESS (ICSSP 2018) | 2018年
基金
芬兰科学院;
关键词
Test-driven development; unit testing; mutation score; code coverage; empirical study; MUTATION; TOOL;
D O I
10.1145/3202710.3203153
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Background: Writing unit tests is one of the primary activities in test-driven development. Yet, the existing reviews report few evidence supporting or refuting the effect of this development approach on test case quality. Lack of ability and skills of developers to produce sufficiently good test cases are also reported as limitations of applying test-driven development in industrial practice. Objective: We investigate the impact of test-driven development on the effectiveness of unit test cases compared to an incremental test last development in an industrial context. Method: We conducted an experiment in an industrial setting with 24 professionals. Professionals followed the two development approaches to implement the tasks. We measure unit test effectiveness in terms of mutation score. We also measure branch and method coverage of test suites to compare our results with the literature. Results: In terms of mutation score, we have found that the test cases written for a test-driven development task have a higher defect detection ability than test cases written for an incremental test-last development task. Subjects wrote test cases that cover more branches on a test-driven development task compared to the other task. However, test cases written for an incremental test-last development task cover more methods than those written for the second task. Conclusion: Our findings are different from previous studies conducted at academic settings. Professionals were able to perform more effective unit testing with test-driven development. Furthermore, we observe that the coverage measure preferred in academic studies reveal different aspects of a development approach. Our results need to be validated in larger industrial contexts.
引用
收藏
页码:113 / 122
页数:10
相关论文
共 40 条
[1]   Is mutation an appropriate tool for testing experiments? [J].
Andrews, JH ;
Briand, LC ;
Labiche, Y .
ICSE 05: 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, PROCEEDINGS, 2005, :402-411
[2]   What Do The Asserts in a Unit Test Tell Us About Code Quality? A Study on Open Source and Industrial Projects [J].
Aniche, Mauricio Finavaro ;
Oliva, Gustavo Ansaldi ;
Gerosa, Marco Aurelio .
PROCEEDINGS OF THE 17TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR 2013), 2013, :111-120
[3]  
Basili V. R., 1992, Technical Report
[4]  
Bavota G, 2012, 2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), P56, DOI 10.1109/ICSM.2012.6405253
[5]  
Beck K., 2003, Test Driven Development: By Example
[6]  
Bhat T., 2006, 2006 ACM IEEE INT S, P356
[7]   How Good Are My Tests? [J].
Bowes, David ;
Hall, Tracy ;
Petric, Jean ;
Shippey, Thomas ;
Turhan, Burak .
2017 IEEE/ACM 8TH WORKSHOP ON EMERGING TRENDS IN SOFTWARE METRICS (WETSOM), 2017, :9-14
[8]  
Campbell D.T., 2001, Experimental and quasiexperimental designs for generalized causal inference
[9]  
Causevic A., 2012, 16 INT C EV ASS SOFT
[10]  
Causevic A., 2011, 4 IEEE INT C SOFTW T