Generating Readable Unit Tests for Guava

  • Ermira Daka
  • José Campos
  • Jonathan Dorn
  • Gordon Fraser
  • Westley Weimer
Conference paper

DOI: 10.1007/978-3-319-22183-0_17

Part of the Lecture Notes in Computer Science book series (LNCS, volume 9275)
Cite this paper as:
Daka E., Campos J., Dorn J., Fraser G., Weimer W. (2015) Generating Readable Unit Tests for Guava. In: Barros M., Labiche Y. (eds) Search-Based Software Engineering. SSBSE 2015. Lecture Notes in Computer Science, vol 9275. Springer, Cham

Abstract

Unit tests for object-oriented classes can be generated automatically using search-based testing techniques. As the search algorithms are typically guided by structural coverage criteria, the resulting unit tests are often long and confusing, with possible negative implications for developer adoption of such test generation tools, and the difficulty of the test oracle problem and test maintenance. To counter this problem, we integrate a further optimization target based on a model of test readability learned from human annotation data. We demonstrate on a selection of classes from the Guava library how this approach produces more readable unit tests without loss of coverage.

Keywords

Readability Unit testing Automated test generation 

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Ermira Daka
    • 1
  • José Campos
    • 1
  • Jonathan Dorn
    • 2
  • Gordon Fraser
    • 1
  • Westley Weimer
    • 2
  1. 1.Department of Computer ScienceThe University of SheffieldSheffieldUK
  2. 2.University of VirginiaCharlottesvilleUSA

Personalised recommendations