02. Tests
Testing helps verify that the code behaves as expected. By writing and running tests, we as developers can check that our programs produce the correct outputs for given inputs, and that the software performs its intended functions accurately. This is especially important when we are adding new features or modifying current ones. Automated testing with FPM allows developers to run a suite of tests to ensure that recent changes do not break existing functionality.
The full test suite in solver/test
gives an example of how to test certain aspects of the code and ensure the software is running properly.
Exercise
Design and run a test for the KronProd
subroutine in src/linear_algebra.f90
.
There is a full set of issues for the testing suite here. You can also develop tests relating to any of these issues.