Regular expressions are used to characterize sets of strings (ie, languages) using a pattern-based syntax. They are applied in different contexts as, for example, data validation in Web forms. However, writing a regular expression that exactly captures the desired set of strings could be particularly difficult, and techniques are sought to validate regular expressions or test their use in applications. A common means to regular expression validation and testing is the generation of a set of labelled strings (ie, strings together with their evaluation). We here propose a fault-based approach for generating strings usable as tests for regular expressions. We define some fault classes representing mistakes that could be made when writing a regular expression, and we introduce the notion of distinguishing string, ie, a string that is able to expose a fault. Given a regular expression, our approach generates a test suite composed of distinguishing strings that are able to detect possible faults in the regular expression. We present different versions of the approach, which provide different results in terms of test suite size and generation time. Experiments show that the proposed approach can generate compact test suites and that, using suitable optimizations, the generation time is reasonable. Exploiting the proposed fault classes, we use the notion of mutation score to assess the ability of a generic set of strings in exposing possible faults contained in the regular expression under test. A comparison with other test generation tools in terms of mutation score, size, and generation time shows the advantages and limits of our approach.

(2019). Fault-based test generation for regular expressions by mutation [journal article - articolo]. In SOFTWARE TESTING VERIFICATION & RELIABILITY. Retrieved from http://hdl.handle.net/10446/131425

Fault-based test generation for regular expressions by mutation

Arcaini, Paolo;Gargantini, Angelo;
2019-01-01

Abstract

Regular expressions are used to characterize sets of strings (ie, languages) using a pattern-based syntax. They are applied in different contexts as, for example, data validation in Web forms. However, writing a regular expression that exactly captures the desired set of strings could be particularly difficult, and techniques are sought to validate regular expressions or test their use in applications. A common means to regular expression validation and testing is the generation of a set of labelled strings (ie, strings together with their evaluation). We here propose a fault-based approach for generating strings usable as tests for regular expressions. We define some fault classes representing mistakes that could be made when writing a regular expression, and we introduce the notion of distinguishing string, ie, a string that is able to expose a fault. Given a regular expression, our approach generates a test suite composed of distinguishing strings that are able to detect possible faults in the regular expression. We present different versions of the approach, which provide different results in terms of test suite size and generation time. Experiments show that the proposed approach can generate compact test suites and that, using suitable optimizations, the generation time is reasonable. Exploiting the proposed fault classes, we use the notion of mutation score to assess the ability of a generic set of strings in exposing possible faults contained in the regular expression under test. A comparison with other test generation tools in terms of mutation score, size, and generation time shows the advantages and limits of our approach.
articolo
2019
Arcaini, Paolo; Gargantini, Angelo Michele; Riccobene, Elvinia
(2019). Fault-based test generation for regular expressions by mutation [journal article - articolo]. In SOFTWARE TESTING VERIFICATION & RELIABILITY. Retrieved from http://hdl.handle.net/10446/131425
File allegato/i alla scheda:
File Dimensione del file Formato  
Arcaini_et_al-2019-Software_Testing,_Verification_and_Reliability.pdf

Solo gestori di archivio

Versione: publisher's version - versione editoriale
Licenza: Licenza default Aisberg
Dimensione del file 8.07 MB
Formato Adobe PDF
8.07 MB Adobe PDF   Visualizza/Apri
Pubblicazioni consigliate

Aisberg ©2008 Servizi bibliotecari, Università degli studi di Bergamo | Terms of use/Condizioni di utilizzo

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10446/131425
Citazioni
  • Scopus 17
  • ???jsp.display-item.citation.isi??? 8
social impact