Department of Computer Science and Technology

Technical reports

System tests from unit tests

Kathryn E. Gray, Alan Mycroft

March 2010, 27 pages

DOI: 10.48456/tr-776

Abstract

Large programs have bugs; software engineering practices reduce the number of bugs in deployed systems by relying on a combination of unit tests, to filter out bugs in individual procedures, and system tests, to identify bugs in an integrated system.

Our previous work showed how Floyd-Hoare triples, {P}C{Q}, could also be seen as unit tests, i.e. formed a link between verification and test-based validation. A transactional-style implementation allows test post-conditions to refer to values of data structures both before and after test execution. Here we argue that this style of specifications, with a transactional implementation, provide a novel source of system tests.

Given a set of unit tests for a system, we can run programs in test mode on real data. Based on an analysis of the unit tests, we intersperse the program’s execution with the pre- and post-conditions from the test suite to expose bugs or incompletenesses in either the program or the test suite itself. We use the results of these tests, as well as branch-trace coverage information, to identify and report anomalies in the running program.

Full text

PDF (0.3 MB)

BibTeX record

@TechReport{UCAM-CL-TR-776,
  author =	 {Gray, Kathryn E. and Mycroft, Alan},
  title = 	 {{System tests from unit tests}},
  year = 	 2010,
  month = 	 mar,
  url = 	 {https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-776.pdf},
  institution =  {University of Cambridge, Computer Laboratory},
  doi = 	 {10.48456/tr-776},
  number = 	 {UCAM-CL-TR-776}
}