AdaCore Unveils GNATtest Unit Test Harness Generator for Ada

AdaCore introduced the GNATtest unit test harness generator for Ada. GNATtest is included in GNAT Pro and supports all versions of Ada and all target configurations. It is based on, and replaces, the earlier AUnit technology. The AdaCore GNATtest tool helps automate the essential, but tedious and error-prone, processes for developing and managing the large number of test cases that accompany the verification of large software systems.

The task of writing and managing unit tests and their invocation framework is critical to the development of high-reliability software, but it is repetitive and cumbersome for large projects, and error-prone when done manually. Changes to the application software during development and maintenance, such as adding a subprogram to a package (module) or changing a subprogram’s specification (interface), require corresponding modifications to the test suite and its invocation harness. GNATtest addresses this issue by automatically creating and maintaining the harnessing code, as well as the unit test skeletons for each subprogram to be tested, taking into account all Ada semantics (subprogram overloading, visibility, etc.). The developer can thus focus on the high-value task of writing the actual test cases.

GNATtest is a useful tool for developing all kinds of software, whether host-based or embedded, across the entire spectrum of application domains, and fits in smoothly with modern development approaches such as agile methods. It can be used for systems requiring high levels of reliability, safety, and/or security. The tool simplifies the effort required to implement test procedures and produce test cases that meet the objectives of certification standards such as DO-178B and DO-178C. These standards emphasize requirements-based testing as a critical part of the software verification process. Since individual subprograms often directly implement low-level requirements, the test harness and skeletons generated by GNATtest can become an immediate part of the application’s certification evidence. When combined with a coverage technology such as GNATcoverage, GNATtest offers a unique solution for verifying embedded Ada software.

GNATtest is also useful for developers who are using the more advanced features of the Ada language. The AdaCore tool handles object-oriented programs and can help verify type substitutability (known as the Liskov Substitution Principle) as required by DO-178C’s supplement on Object-Oriented Technology and Related Techniques (DO-332). GNATtest also takes advantage of Ada 2012 programming-by-contract capabilities, such as preconditions, postconditions and invariants.

More info: AdaCore