Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Testing, Documentation, and Software Engineering

Where to go deeper on testing scientific code, documenting it, and making results reproducible. Sources are tagged Tier 1 (works and tools we are confident exist and recommend) and Tier 2 (real and worth seeking, but confirm the current edition, URL, or version yourself). Testing is learned by doing — several of these are tools to install and turn on today, not books to read.

Tools you should install and use

  • pFUnit — the parallel Fortran unit-testing framework (github.com/Goddard-Fortran-Ecosystem/pFUnit). The standard xUnit-style framework for modern Fortran, from NASA Goddard: @test, @assertEqual with tolerances, and MPI-aware parallel tests. Read the user guide, then wire it into your solver's test/ directory. Tier 1.
  • FORD — the FORtran Documentator (forddocs.readthedocs.io). The documentation generator this chapter uses: point it at your source, and the !>/!! doc comments become a browsable, cross-linked API site. The docs show the project-file settings and every doc-comment convention. Tier 1.
  • GitHub Actions (docs.github.com/actions) and fortran-lang/setup-fpm. The CI service and the action that installs fpm on a runner. Copy this chapter's workflow into .github/workflows/ci.yml, push, and watch the compiler-matrix build run. Tier 1 (Actions); Tier 2 (the setup-fpm action — check the current version tag).
  • The Fortran Package Manager (fpm, fpm.fortran-lang.org). fpm test discovers and runs everything in test/; its manifest pins dependency versions to a git tag — the reproducibility habit of §37.5 built into the build. Tier 1.

Testing and numerical verification

Reproducibility — the culture and the argument

  • Jonathan B. Buckheit and David L. Donoho, "WaveLab and Reproducible Research" (1995). The essay that popularized Jon Claerbout's argument that a computational-science article is merely advertising of the scholarship — the real scholarship is the code and the instructions that made the figures. The intellectual root of §37.5. Tier 2 (a widely cited essay; confirm the reprint venue).
  • Greg Wilson et al., "Best Practices for Scientific Computing" and "Good Enough Practices in Scientific Computing." Short, practical papers from the Software Carpentry community on version control, testing, and provenance for scientists — the habits of §37.4–§37.5 stated as a checklist. Tier 1.
  • The Turing Way (the-turing-way.netlify.app). A large, open, community handbook on reproducible research — data management, version control, testing, and provenance — a modern, practical companion to this chapter. Tier 2 (living online resource; content evolves).

Primary sources and background

  • The GCC / gfortran documentation — compiler_version and compiler_options. The iso_fortran_env intrinsics that let a program self-report its build (§37.5), and the flag reference behind the reproducibility warnings (Chapter 30). Tier 1.
  • Pro Git, by Scott Chacon and Ben Straub (git-scm.com/book, free online). The definitive git reference; read the chapters on tagging and on writing good commit messages for the scientific-git habits of §37.4. Tier 1.

Suggested order

  1. Turn on CI today. Copy the §37.3 workflow into your solver's repository and push — nothing teaches the value of automated testing like watching a red X appear the first time you break something.
  2. Write the three tests of the Project Checkpoint (unit, regression, verification) with the hand-rolled harness, then adopt pFUnit and re-express them — you will understand the framework because you built its core first.
  3. Read Wilson et al. and skim Roache on verification once the mechanics feel solid; they reframe the how of this chapter as the why that carries into the Chapter 38 capstone.
  4. Bookmark The Turing Way and Pro Git as references for the day you prepare a result for publication — and you will.