Cargando…
Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing
Property-based testing uses randomly generated inputs to validate high-level program specifications. It can be shockingly effective at finding bugs, but it often requires generating a very large number of inputs to do so. In this paper, we apply ideas from combinatorial testing, a powerful and widel...
Autores principales: | , , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
2021
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7984547/ http://dx.doi.org/10.1007/978-3-030-72019-3_10 |
_version_ | 1783668088334450688 |
---|---|
author | Goldstein, Harrison Hughes, John Lampropoulos, Leonidas Pierce, Benjamin C. |
author_facet | Goldstein, Harrison Hughes, John Lampropoulos, Leonidas Pierce, Benjamin C. |
author_sort | Goldstein, Harrison |
collection | PubMed |
description | Property-based testing uses randomly generated inputs to validate high-level program specifications. It can be shockingly effective at finding bugs, but it often requires generating a very large number of inputs to do so. In this paper, we apply ideas from combinatorial testing, a powerful and widely studied testing methodology, to modify the distributions of our random generators so as to find bugs with fewer tests. The key concept is combinatorial coverage, which measures the degree to which a given set of tests exercises every possible choice of values for every small combination of input features. In its “classical” form, combinatorial coverage only applies to programs whose inputs have a very particular shape—essentially, a Cartesian product of finite sets. We generalize combinatorial coverage to the richer world of algebraic data types by formalizing a class of sparse test descriptions based on regular tree expressions. This new definition of coverage inspires a novel combinatorial thinning algorithm for improving the coverage of random test generators, requiring many fewer tests to catch bugs. We evaluate this algorithm on two case studies, a typed evaluator for System F terms and a Haskell compiler, showing significant improvements in both. |
format | Online Article Text |
id | pubmed-7984547 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2021 |
record_format | MEDLINE/PubMed |
spelling | pubmed-79845472021-03-23 Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing Goldstein, Harrison Hughes, John Lampropoulos, Leonidas Pierce, Benjamin C. Programming Languages and Systems Article Property-based testing uses randomly generated inputs to validate high-level program specifications. It can be shockingly effective at finding bugs, but it often requires generating a very large number of inputs to do so. In this paper, we apply ideas from combinatorial testing, a powerful and widely studied testing methodology, to modify the distributions of our random generators so as to find bugs with fewer tests. The key concept is combinatorial coverage, which measures the degree to which a given set of tests exercises every possible choice of values for every small combination of input features. In its “classical” form, combinatorial coverage only applies to programs whose inputs have a very particular shape—essentially, a Cartesian product of finite sets. We generalize combinatorial coverage to the richer world of algebraic data types by formalizing a class of sparse test descriptions based on regular tree expressions. This new definition of coverage inspires a novel combinatorial thinning algorithm for improving the coverage of random test generators, requiring many fewer tests to catch bugs. We evaluate this algorithm on two case studies, a typed evaluator for System F terms and a Haskell compiler, showing significant improvements in both. 2021-03-23 /pmc/articles/PMC7984547/ http://dx.doi.org/10.1007/978-3-030-72019-3_10 Text en © The Author(s) 2021 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. |
spellingShingle | Article Goldstein, Harrison Hughes, John Lampropoulos, Leonidas Pierce, Benjamin C. Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title | Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title_full | Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title_fullStr | Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title_full_unstemmed | Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title_short | Do Judge a Test by its Cover: Combining Combinatorial and Property-Based Testing |
title_sort | do judge a test by its cover: combining combinatorial and property-based testing |
topic | Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7984547/ http://dx.doi.org/10.1007/978-3-030-72019-3_10 |
work_keys_str_mv | AT goldsteinharrison dojudgeatestbyitscovercombiningcombinatorialandpropertybasedtesting AT hughesjohn dojudgeatestbyitscovercombiningcombinatorialandpropertybasedtesting AT lampropoulosleonidas dojudgeatestbyitscovercombiningcombinatorialandpropertybasedtesting AT piercebenjaminc dojudgeatestbyitscovercombiningcombinatorialandpropertybasedtesting |