Rotten green tests in Java']Java, Pharo and Python']Python An empirical study

被引:1
作者
Aranega, Vincent [1 ]
Delplanque, Julien [1 ]
Martinez, Matias [2 ]
Black, Andrew P. [3 ]
Ducasse, Stephane [1 ]
Etien, Anne [1 ]
Fuhrman, Christopher [4 ]
Polito, Guillermo [1 ]
机构
[1] Univ Lille, CNRS, Cent Lille, INRIA,UMR 9189,CRIStAL, F-59000 Lille, France
[2] Univ Polytech Hauts France, LAMIH UMR CNRS 8201, Valenciennes, France
[3] Portland State Univ, Dept Comp Sci, Portland, OR 97207 USA
[4] Ecole Technol Super, Montreal, PQ, Canada
关键词
Testing; Rotten Green Tests; Empirical study; Software quality;
D O I
10.1007/s10664-021-10016-2
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Rotten Green Tests are tests that pass, but not because the assertions they contain are true: a rotten test passes because some or all of its assertions are not actually executed. The presence of a rotten green test is a test smell, and a bad one, because the existence of a test gives us false confidence that the code under test is valid, when in fact that code may not have been tested at all. This article reports on an empirical evaluation of the tests in a corpus of projects found in the wild. We selected approximately one hundred mature projects written in each of Java, Pharo, and Python. We looked for rotten green tests in each project, taking into account test helper methods, inherited helpers, and trait composition. Previous work has shown the presence of rotten green tests in Pharo projects; the results reported here show that they are also present in Java and Python projects, and that they fall into similar categories. Furthermore, we found code bugs that were hidden by rotten tests in Pharo and Python. We also discuss two test smells -missed fail and missed skip -that arise from the misuse of testing frameworks, and which we observed in tests written in all three languages.
引用
收藏
页数:41
相关论文
共 38 条
  • [1] Automatic test case optimization:: A bacteriologic algorithm
    Baudry, B
    Fleurey, F
    Jézéquel, JM
    Le Traon, Y
    [J]. IEEE SOFTWARE, 2005, 22 (02) : 76 - +
  • [2] Baudry B., 2006, 28th International Conference on Software Engineering Proceedings, P82, DOI 10.1145/1134285.1134299
  • [3] Bavota G, 2012, 2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), P56, DOI 10.1109/ICSM.2012.6405253
  • [4] Beszédes A, 2012, 2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), P46, DOI 10.1109/ICSM.2012.6405252
  • [5] Black A.P., 2009, PHARO EXAMPLE
  • [6] Test case selection in industry: an analysis of issues related to static approaches
    Blondeau, Vincent
    Etien, Anne
    Anquetil, Nicolas
    Cresson, Sylvain
    Croisy, Pascal
    Ducasse, Stephane
    [J]. SOFTWARE QUALITY JOURNAL, 2017, 25 (04) : 1203 - 1237
  • [7] How Good Are My Tests?
    Bowes, David
    Hall, Tracy
    Petric, Jean
    Shippey, Thomas
    Turhan, Burak
    [J]. 2017 IEEE/ACM 8TH WORKSHOP ON EMERGING TRENDS IN SOFTWARE METRICS (WETSOM), 2017, : 9 - 14
  • [8] Breugelmans M, 2008, INT WORKSH ADV SOFTW
  • [9] Costiou S, 2020, ART SCI ENG PROGRAMM, V4, DOI [10.22152/programming-journal.org/2020/4/5, DOI 10.22152/PROGRAMMING-JOURNAL.ORG/2020/4/5]
  • [10] JCrasher: an automatic robustness tester for Java']Java
    Csallner, C
    Smaragdakis, Y
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 2004, 34 (11) : 1025 - 1050