Is this a bug or an obsolete test?

  • Authors:
  • Dan Hao;Tian Lan;Hongyu Zhang;Chao Guo;Lu Zhang

  • Affiliations:
  • Key Laboratory of High Confidence Software Technologies, Peking University, P.R. China,MoE Institute of Software, School of Electronics Engineering and Computer Science, Peking University, Beijing ...;Key Laboratory of High Confidence Software Technologies, Peking University, P.R. China,MoE Institute of Software, School of Electronics Engineering and Computer Science, Peking University, Beijing ...;Tsinghua University, P.R. China;Key Laboratory of High Confidence Software Technologies, Peking University, P.R. China,MoE Institute of Software, School of Electronics Engineering and Computer Science, Peking University, Beijing ...;Key Laboratory of High Confidence Software Technologies, Peking University, P.R. China,MoE Institute of Software, School of Electronics Engineering and Computer Science, Peking University, Beijing ...

  • Venue:
  • ECOOP'13 Proceedings of the 27th European conference on Object-Oriented Programming
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

In software evolution, developers typically need to identify whether the failure of a test is due to a bug in the source code under test or the obsoleteness of the test code when they execute a test suite. Only after finding the cause of a failure can developers determine whether to fix the bug or repair the obsolete test. Researchers have proposed several techniques to automate test repair. However, test-repair techniques typically assume that test failures are always due to obsolete tests. Thus, such techniques may not be applicable in real world software evolution when developers do not know whether the failure is due to a bug or an obsolete test. To know whether the cause of a test failure lies in the source code under test or in the test code, we view this problem as a classification problem and propose an automatic approach based on machine learning. Specifically, we target Java software using the JUnit testing framework and collect a set of features that may be related to failures of tests. Using this set of features, we adopt the Best-first Decision Tree Learning algorithm to train a classifier with some existing regression test failures as training instances. Then, we use the classifier to classify future failed tests. Furthermore, we evaluated our approach using two Java programs in three scenarios (within the same version, within different versions of a program, and between different programs), and found that our approach can effectively classify the causes of failed tests.