Theories in Practice: Easy-to-Write Specifications that Catch Bugs
Automated testing during development helps ensure that software works according to the test suite. Traditional test suites verify a few well-picked scenarios or example inputs. However, such example-based testing does not uncover errors in legal inputs that the test writer overlooked. We propose the...
Автори: | , , |
---|---|
Інші автори: | |
Опубліковано: |
2008
|
Предмети: | |
Онлайн доступ: | http://hdl.handle.net/1721.1/40090 |
_version_ | 1826202853777080320 |
---|---|
author | Saff, David Boshernitsan, Marat Ernst, Michael D. |
author2 | Michael Ernst |
author_facet | Michael Ernst Saff, David Boshernitsan, Marat Ernst, Michael D. |
author_sort | Saff, David |
collection | MIT |
description | Automated testing during development helps ensure that software works according to the test suite. Traditional test suites verify a few well-picked scenarios or example inputs. However, such example-based testing does not uncover errors in legal inputs that the test writer overlooked. We propose theory-based testing as an adjunct to example-based testing. A theory generalizes a (possibly infinite) set of example-based tests. A theory is an assertion that should be true for any data, and it can be exercised by human-chosen data or by automatic data generation. A theory is expressed in an ordinary programming language, it is easy for developers to use (often even easier than example-based testing), and it serves as a lightweight form of specification. Six case studies demonstrate the utility of theories that generalize existing tests to prevent bugs, clarify intentions, and reveal design problems. |
first_indexed | 2024-09-23T12:21:08Z |
id | mit-1721.1/40090 |
institution | Massachusetts Institute of Technology |
last_indexed | 2024-09-23T12:21:08Z |
publishDate | 2008 |
record_format | dspace |
spelling | mit-1721.1/400902019-04-11T08:11:31Z Theories in Practice: Easy-to-Write Specifications that Catch Bugs Saff, David Boshernitsan, Marat Ernst, Michael D. Michael Ernst Program Analysis JUnit, testing, partial specification Automated testing during development helps ensure that software works according to the test suite. Traditional test suites verify a few well-picked scenarios or example inputs. However, such example-based testing does not uncover errors in legal inputs that the test writer overlooked. We propose theory-based testing as an adjunct to example-based testing. A theory generalizes a (possibly infinite) set of example-based tests. A theory is an assertion that should be true for any data, and it can be exercised by human-chosen data or by automatic data generation. A theory is expressed in an ordinary programming language, it is easy for developers to use (often even easier than example-based testing), and it serves as a lightweight form of specification. Six case studies demonstrate the utility of theories that generalize existing tests to prevent bugs, clarify intentions, and reveal design problems. 2008-01-15T14:15:58Z 2008-01-15T14:15:58Z 2008-01-14 MIT-CSAIL-TR-2008-002 http://hdl.handle.net/1721.1/40090 Massachusetts Institute of Technology Computer Science and Artificial Intelligence Laboratory 10 p. application/pdf application/postscript |
spellingShingle | JUnit, testing, partial specification Saff, David Boshernitsan, Marat Ernst, Michael D. Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title | Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title_full | Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title_fullStr | Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title_full_unstemmed | Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title_short | Theories in Practice: Easy-to-Write Specifications that Catch Bugs |
title_sort | theories in practice easy to write specifications that catch bugs |
topic | JUnit, testing, partial specification |
url | http://hdl.handle.net/1721.1/40090 |
work_keys_str_mv | AT saffdavid theoriesinpracticeeasytowritespecificationsthatcatchbugs AT boshernitsanmarat theoriesinpracticeeasytowritespecificationsthatcatchbugs AT ernstmichaeld theoriesinpracticeeasytowritespecificationsthatcatchbugs |