O'Reilly logo

Modern Fortran in Practice by Arjen Markus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.

Unit Testing

The subject of this chapter is a simple framework for automating one particular aspect of testing: unit tests. Unit tests focus on “small” parts of a program, typically single subroutines or functions. The idea is these tests give confidence in the correct operation of routines. As the code for these tests should be considered part of the program, you can repeatedly run them during development and maintenance of the whole system. Some development methods take this to the extreme. Test-driven development (TDD), for instance, prescribes that the tests be written first, before you start implementing the actual code.1

This is just one way to develop a program, but thinking about the ways you can test a particular routine helps to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required