Unit testing, sometimes called “module testing” or “element testing”, is a software testing method by which individual “units” of source code are tested to determine whether they are fit for use . Unit tests are added to Nektar++ through the CMake system, and implemented using the Boost test framework. As an example, the set of linear algebra unit tests is listed in this file:
and the actual tests are implemented in this file:
To register a new test, you use BOOST_AUTO_TEST_CASE( TestName ), implement the unit test, and test the result using BOOST_CHECK_CLOSE(...), BOOST_CHECK_EQUAL(...), etc. Unit tests are invaluable in maintaining the integrity of the code base and for localizing, finding, and debugging errors entered into the code. It is important to remember a unit test should test very specific functionality of the code - in the best case, a single function should be tested per unit test.
While it is beyond the scope of this document to go into more detail on writing unit tests, a good summary of the Boost test system can be found here:
Integration testing involves testing ecosystems of components and their interoperability. System testing tests complete applications and regression testing focuses on ensuring previously fixed bugs do not resurface. In Nektar++ all of these are often colloquially referred to as regression testing. It is not white-box in that it does not examine how the code arrives at a particular answer, but rather in a black-box fashion tests to see if code when operating on certain data yields the predicted response .
Nektar++ uses the buildbot continuous integration to perform testing of the code across multiple operating systems. Builds are automatically instigated when merge requests are opened and subsequently when the associated branches receive additional commits.
For more information, go to: