Communication publiée dans un ouvrage (Colloques, congrès, conférences scientifiques et actes)
Private API Access and Functional Mocking in Automated Unit Test Generation
ARCURI, Andrea; Fraser, Gordon; Just, Rene
2017In IEEE International Conference on Software Testing, Verification and Validation (ICST)
Peer reviewed
 

Documents


Texte intégral
evosuite-mocking.pdf
Preprint Auteur (272.51 kB)
Demander un accès

Tous les documents dans ORBilu sont protégés par une licence d'utilisation.

Envoyer vers



Détails



Résumé :
[en] Not all object oriented code is easily testable: Dependency objects might be difficult or even impossible to instantiate, and object-oriented encapsulation makes testing potentially simple code difficult if it cannot easily be accessed. When this happens, then developers can resort to mock objects that simulate the complex dependencies, or circumvent objectoriented encapsulation and access private APIs directly through the use of, for example, Java reflection. Can automated unit test generation benefit from these techniques as well? In this paper we investigate this question by extending the EvoSuite unit test generation tool with the ability to directly access private APIs and to create mock objects using the popular Mockito framework. However, care needs to be taken that this does not impact the usefulness of the generated tests: For example, a test accessing a private field could later fail if that field is renamed, even if that renaming is part of a semantics-preserving refactoring. Such a failure would not be revealing a true regression bug, but is a false positive, which wastes the developer’s time for investigating and fixing the test. Our experiments on the SF110 and Defects4J benchmarks confirm the anticipated improvements in terms of code coverage and bug finding, but also confirm the existence of false positives. However, by ensuring the test generator only uses mocking and reflection if there is no other way to reach some part of the code, their number remains small.
Disciplines :
Sciences informatiques
Auteur, co-auteur :
ARCURI, Andrea;  University of Luxembourg > Interdisciplinary Centre for Security, Reliability and Trust (SNT)
Fraser, Gordon
Just, Rene
Co-auteurs externes :
yes
Langue du document :
Anglais
Titre :
Private API Access and Functional Mocking in Automated Unit Test Generation
Date de publication/diffusion :
2017
Nom de la manifestation :
IEEE International Conference on Software Testing, Verification and Validation (ICST)
Date de la manifestation :
13-17 March 2017
Titre de l'ouvrage principal :
IEEE International Conference on Software Testing, Verification and Validation (ICST)
Peer reviewed :
Peer reviewed
Projet FnR :
FNR3949772 - Validation And Verification Laboratory, 2010 (01/01/2012-31/07/2018) - Lionel Briand
Disponible sur ORBilu :
depuis le 13 janvier 2017

Statistiques


Nombre de vues
133 (dont 8 Unilu)
Nombre de téléchargements
3 (dont 3 Unilu)

citations Scopus®
 
41
citations Scopus®
sans auto-citations
34
citations OpenAlex
 
43
citations WoS
 
35

Bibliographie


Publications similaires



Contacter ORBilu