B-Refactoring: Automatic Test Code Refactoring to Improve Dynamic Analysis

Jifeng Xuan 1 Benoit Cornu 2 Matias Martinez 2 Benoit Baudry 3 Lionel Seinturier 4, 5, 2 Martin Monperrus 2, 5
2 SPIRALS - Self-adaptation for distributed services and large software systems
Inria Lille - Nord Europe, CRIStAL - Centre de Recherche en Informatique, Signal et Automatique de Lille (CRIStAL) - UMR 9189
3 DiverSe - Diversity-centric Software Engineering
Inria Rennes – Bretagne Atlantique , IRISA-D4 - LANGAGE ET GÉNIE LOGICIEL
Abstract : Context: Developers design test suites to verify that software meets its expected behaviors. Many dynamic analysis techniques are performed on the exploitation of execution traces from test cases. In practice, one test case may imply various behaviors. However, the execution of a test case only yields one trace, which can hide the others.Objective: In this article, we propose a new technique of test code refactoring, called B-Refactoring. The idea behind B-Refactoring is to split a test case into small test fragments, which cover a simpler part of the control flow to provide better support for dynamic analysis.Method: For a given dynamic analysis technique, B-Refactoring monitors the execution of test cases and constructs small test cases without loss of the testability. We apply B-Refactoring to assist two existing analysis tasks: automatic repair of if-condition bugs and automatic analysis of exception contracts.Results: Experimental results show that B-Refactoring can effectively improve the execution traces of the test suite. Real-world bugs that could not be previously fixed with the original test suites are fixed after applying B-Refactoring; meanwhile, exception contracts are better verified via applying B-Refactoring to original test suites.Conclusions: We conclude that applying B-Refactoring improves the execution traces of test cases for dynamic analysis. This improvement can enhance existing dynamic analysis tasks.
Type de document :
Article dans une revue
Information and Software Technology, Elsevier, 2016, 76, pp.65-80. 〈10.1016/j.infsof.2016.04.016〉
Liste complète des métadonnées

https://hal.archives-ouvertes.fr/hal-01309004
Contributeur : Martin Monperrus <>
Soumis le : vendredi 6 mai 2016 - 15:32:16
Dernière modification le : vendredi 17 novembre 2017 - 08:50:20
Document(s) archivé(s) le : mardi 15 novembre 2016 - 22:12:00

Fichiers

banana-refactoring.pdf
Fichiers produits par l'(les) auteur(s)

Identifiants

Citation

Jifeng Xuan, Benoit Cornu, Matias Martinez, Benoit Baudry, Lionel Seinturier, et al.. B-Refactoring: Automatic Test Code Refactoring to Improve Dynamic Analysis. Information and Software Technology, Elsevier, 2016, 76, pp.65-80. 〈10.1016/j.infsof.2016.04.016〉. 〈hal-01309004〉

Partager

Métriques

Consultations de
la notice

556

Téléchargements du document

284