Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate pFUnit Framework for Fortran Unit Testing in obs2ioda #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amstokely
Copy link
Collaborator

TYPE: enhancement

KEYWORDS: pfunit, testing, stability

SOURCE: internal

DESCRIPTION OF CHANGES:

Problem:
obs2ioda currently lacks a unit testing framework, which makes it challenging to ensure ongoing code stability as the code evolves. This gap increases the risk of unnoticed issues, such as a recent array out-of-bounds bug that went undetected for over a year. Without unit tests, developers also lack a mechanism to validate new features or bug fixes, making it difficult to enforce good software design practices.

Solution:
This PR integrates the pFUnit framework for Fortran unit testing, providing developers with the ability to create and run unit tests for existing and new code. An example test is included to demonstrate how pFUnit could have caught a recent array out-of-bounds error. To avoid impacting the majority of obs2ioda users, pFUnit is added as an optional dependency, required only for those building and running tests. While pFUnit installation is generally straightforward, there may be minor complications in environments with multiple versions of gptl. Clear guidance on installation is provided to mitigate these risks.

TESTS CONDUCTED:

  • Verified that example test detects intentional errors, confirming functionality.
  • Confirmed that pFUnit dependency does not interfere with normal obs2ioda usage.
  • Tested pFUnit installation in various environments to ensure manageable setup.

The addition of pFUnit as a testing framework strengthens code stability and enforces testable, modular code, benefiting the obs2ioda development workflow and quality assurance.

KEYWORDS: pfunit, testing, stability

SOURCE: internal

Subject: Integrate pFUnit framework for Fortran unit testing

Obs2ioda currently lacks a unit testing framework, which poses challenges to
ensuring code stability as it evolves. The lack of such framework leads to higher
risks of unnoticed issues and it also hinders the validation of new features or
bug fixes.

This commit integrates the pFUnit framework for Fortran unit testing, thereby
providing developers with tools for creating and running unit tests on both
existing and new code. An example test is included, demonstrating how pFUnit could
have detected a recent array out-of-bounds issue.

To avoid affecting most obs2ioda users, pFUnit is added as an optional dependency,
required only when building and running tests. Although pFUnit installation is
generally straightforward, complications may arise in environments with multiple
versions of gptl. Clear guidance on installation is provided to mitigate such risks.

Tests conducted indicate that the example test successfully detects intentional
errors, confirming its functionality. It has also been confirmed that the pFUnit
dependency does not interfere with normal obs2ioda usage. Moreover, the
installation of pFUnit has been tested in several environments to ensure ease of
setup.

The integration of pFUnit as a testing framework enhances code stability and
promotes testable, modular code. This is a significant enhancement to the
obs2ioda development workflow and quality assurance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant