The axioms strike back: testing with concepts and axioms in C++

  • Authors:
  • Anya Helene Bagge;Valentin David;Magne Haveraaen

  • Affiliations:
  • University of Bergen, Bergen, Norway;University of Bergen, Bergen, Norway;University of Bergen, Bergen, Norway

  • Venue:
  • GPCE '09 Proceedings of the eighth international conference on Generative programming and component engineering
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern development practises encourage extensive testing of code while it is still under development, using unit tests to check individual code units in isolation. Such tests are typically case-based, checking a likely error scenario or an error that has previously been identified and fixed. Coming up with good test cases is challenging, and focusing on individual tests can distract from creating tests that cover the full functionality. Axioms, known from program specification, allow for an alternative way of generating test cases, where the intended functionality is described as rules or equations that can be checked automatically. Axioms are proposed as part of the concept feature of the upcoming C++0x standard. In this paper, we describe how tests may be generated automatically from axioms in C++ concepts, and supplied with appropriate test data to form effective automated unit tests.