Published October 3, 2025 | Version v1
Conference paper Open

Idiomatic Correctness-Checking via Julienne in Fortran 2023

  • 1. ROR icon Lawrence Berkeley National Laboratory
  • 2. Sourcery Institute
  • 3. Archaeologic Inc.
  • 4. Archaeologic, Inc.

Description

This paper presents a unified approach to unit testing and runtime assertion checking using Fortran 2023.  The paper describes the support for our approach in the Julienne framework.  Julienne leverages recent Fortran standards to implement object-oriented design patterns, support testing parallel programs, and implement functional programming patterns in order to craft idioms inspired by natural-language expressions. The presented idioms employ novel operators to write expressions that evaluate to a test-diagnosis object encapsulating two components: (1) the test outcome or assertion outcome and (2) an automatically generated diagnostic string.  Two other novel aspects of the approach include (1) the ability to enforce assertions inside pure procedures and (2) the ability to output rich diagnostic information inside pure procedures during error termination when assertions fail.  The latter capability mitigates against a reason that Fortran programmers commonly cite for not writing pure procedures: difficulty obtaining useful program output inside pure procedures when debugging code.  This paper demonstrates how the adoption of the proposed idioms leads naturally to a unifying theme across two otherwise disparate technologies: unit testing and runtime assertion checking.  Finally, this paper describes the usage of the Julienne testing framework for writing unit tests and assertions in the Matcha high-performance computing application and the Fiats deep learning library.

Files

10-3-5.pdf

Files (221.3 kB)

Name Size Download all
md5:715c67538b57efcd52ea2a22d79995d5
221.3 kB Preview Download

Additional details

Identifiers

Related works

Describes
Software: 10.11578/dc.20250404.1 (DOI)
Software: 10.11578/dc.20240806.2 (DOI)

Funding

Office of Advanced Scientific Computing Research
DE-AC02-05CH11231

Software

Repository URL
https://go.lbl.gov/julienne
Programming language
Fortran
Development Status
Active