Automatic Test Case Generation: What If Test Code Quality Matters?

Fabio Palomba, Annibale Panichella, Andy Zaidman, Rocco Oliveto

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

40 Citations (Scopus)
118 Downloads (Pure)


Test case generation tools that optimize code coverage have been extensively investigated. Recently, researchers have suggested to add other non-coverage criteria, such as mem- ory consumption or readability, to increase the practical use- fulness of generated tests. In this paper, we observe that test code quality metrics, and test cohesion and coupling in particular, are valuable candidates as additional criteria. Indeed, tests with low cohesion and/or high coupling have been shown to have a negative impact on future mainte- nance activities. In an exploratory investigation we show that most generated tests are indeed affected by poor test code quality. For this reason, we incorporate cohesion and coupling metrics into the main loop of search-based algo- rithm for test case generation. Through an empirical study we show that our approach is not only able to generate tests that are more cohesive and less coupled, but can (i) increase branch coverage up to 10% when enough time is given to the search and (ii) result in statistically shorter tests.
Original languageEnglish
Title of host publicationProceedings of the 25th International Symposium on Software Testing and Analysis, ISSTA 2016
Place of PublicationNew York, NY
PublisherAssociation for Computing Machinery (ACM)
Number of pages12
ISBN (Electronic)978-1-4503-4390-9
Publication statusPublished - Jul 2016


  • Evolutionary testing
  • many-objective optimization
  • branch coverage
  • test code quality


Dive into the research topics of 'Automatic Test Case Generation: What If Test Code Quality Matters?'. Together they form a unique fingerprint.

Cite this