Open Access
- 26 April 2025
- journal article
- Published by Keysight Technologies UK Ltd in OpenFOAM® Journal
- Vol. 5, 115-130
Abstract
While testing is increasingly recognized as essential in scientific software development, it is not yet standard practice within the OpenFOAM community for developing new solvers and features. This gap stems partly from the challenges of integrating testing into typical OpenFOAM workflows and limited guidance on implementing effective tests. Writing tests for complex software like OpenFOAM based projects presents unique obstacles, including difficulty in configuring tests for various cases. This paper addresses these issues by discussing established test types in the context of OpenFOAM, identifying common challenges in developing tests for this platform, and suggesting best practices to enhance the testability of code based on OpenFOAM. Detailed guidance is provided for integrating the Catch2 unit test framework, alongside two new tools: the foamUT framework and the OpenFOAM Benchmark Runner (OBR), which facilitate unit and integration testing. To illustrate these tools in practice, we present three case studies. The first demonstrates the direct integration of Catch2 in the WENOExt project, showcasing test case creation and its synergy with OpenFOAM projects. The second introduces the foamUT framework, which simplifies Catch2 integration for OpenFOAM projects. Finally, the OBR framework is used for benchmarking and integration tests in the OpenFOAM Ginkgo layer. Additionally, we discuss the current state of testing in OpenFOAM and emphasize the need for more comprehensive testing practices within this community, particularly with libraries such as Catch2. Overall, this paper serves as a practical introduction to unit and integration testing for OpenFOAM developers and introduces new tools that lower the barrier to entry, improve test suite robustness, and simplify unit test integration.Keywords
This publication has 8 references indexed in Scilit:
- Towards a platform-portable linear algebra backend for OpenFOAMMeccanica, 2024
- Introducing the FAIR Principles for research softwareScientific Data, 2022
- Developers perception of peer code review in research software developmentEmpirical Software Engineering, 2021
- Efficient WENO library for OpenFOAMSoftwareX, 2020
- Testing scientific software: A systematic literature reviewInformation and Software Technology, 2014
- Test Code Quality and Its Relation to Issue Handling PerformanceIEEE Transactions on Software Engineering, 2014
- A Scientist's Nightmare: Software Problem Leads to Five RetractionsScience, 2006
- Test-driven development concepts, taxonomy, and future directionComputer, 2005