kirancodes.me
To Proof Maintenance & Beyond!

Improving oracle quality by detecting brittle assertions and unused inputs in tests

Chen Huo, James Clause

Abstract

Writing oracles is challenging. As a result, developers often create oracles that check too little, resulting in tests that are unable to detect failures, or check too much, resulting in tests that are brittle and difficult to maintain. In this paper we present a new technique for automatically analyzing test oracles. The technique is based on dynamic tainting and detects both brittle assertions—assertions that depend on values that are derived from uncontrolled inputs—and unused inputs—inputs provided by the test that are not checked by an assertion. We also presented OraclePolish, an implementation of the technique that can analyze tests that are written in Java and use the JUnit testing framework. Using OraclePolish, we conducted an empirical evaluation of more than 4000 real test cases. The results of the evaluation show that OraclePolish is effective; it detected 164 tests that contain brittle assertions and 1618 tests that have unused inputs. In addition, the results also demonstrate that the costs associated with using the technique are reasonable.

BibTeX
@inproceedings{Huo-Clause:FSE14,
  author    = {Chen Huo and
               James Clause},
  title     = {Improving oracle quality by detecting brittle assertions and unused inputs in tests},
  booktitle = {FSE},
  pages     = {621--631},
  publisher = {{ACM}},
  year      = {2014},
}

Related papers