Automated test generation tools (such as EvoSuite) typically aim to maximize code coverage. However, they frequently disregard non-coverage aspects that can be relevant for testers, such as the quality of the generated tests. Therefore, automatically generated tests are often affected by a set of test-specific bad programming practices that may hinder the quality of both test and production code, i.e., test smells. Given that other researchers have successfully integrated non-coverage quality metrics into EvoSuite, we decided to extend the EvoSuite tool such that the generated test code is smell-free. To this aim, we compiled 54 test smells from several sources and selected 16 smells that are relevant to the context of this work. We then augmented the tool with the respective test smell metrics and investigated the diffusion of the selected smells and the distribution of the metrics. Finally, we implemented an approach to optimize the test smell metrics as secondary criteria. After establishing the optimal configuration to optimize as secondary criteria (which we used throughout the remainder of the study), we conducted an empirical study to assess whether the tests became significantly less smelly. Furthermore, we studied how the proposed metrics affect the fault detection effectiveness, coverage, and size of the generated tests. Our study revealed that the proposed approach reduces the overall smelliness of the generated tests; in particular, the diffusion of the “Indirect Testing” and “Unrelated Assertions” smells improved considerably. Moreover, our approach improved the smelliness of the tests generated by EvoSuite without compromising the code coverage or fault detection effectiveness. The size and length of the generated tests were also not affected by the new secondary criteria.
Sun 14 MayDisplayed time zone: Hobart change
11:00 - 12:30 | |||
11:00 60mPanel | Discussion Panel: Testing and Security for Cyber-Physical Systems SBFT Aitor Arrieta Mondragon University, Annibale Panichella Delft University of Technology, Jane Cleland-Huang University of Notre Dame, Lionel Briand University of Luxembourg; University of Ottawa, Mohammad Reza Mousavi King's College London, Shaukat Ali Simula Research Laboratory | ||
12:00 15mTalk | On the Strengths of Pure Evolutionary Algorithms in Generating Adversarial Examples SBFT Antony Bartlett , Cynthia C. S. Liem Delft University of Technology, Annibale Panichella Delft University of Technology Pre-print | ||
12:15 15mTalk | Automatic Generation of Smell-free Unit Tests SBFT José Campos University of Porto, Portugal Pre-print |