Project 5 - Expand integrated testing in the LAMMPS unittest tree
Overview and Motivation
LAMMPS ships with an internal test suite which contains a variety of tests that are aimed at assisting developers to detect whether their modifications will have unexpected side effects and thus alter the behavior of LAMMPS or produce different results. These tests are automatically run one every pull request update and merge in the LAMMPS repository on GitHub. The tests must pass or pull requests cannot be merged. When building LAMMPS with CMake they can be easily enabled and run locally.
The tests fall into multiple categories that test LAMMPS features at multiple levels. There are true unit tests that check individual functions, then more complex tests that require a LAMMPS class instance and finally tests similar to conventional regression tests that can be configured with YAML format files and run mini MD simulations with many different settings and require consistent forces, stresses and energies within a given maximum allowed relative error. Most tests are based on either the Googletest C++ library or the Python unittest module.
Unfortunately, LAMMPS is a very large package, unit testing is a rather recent feature, and there are continuously new features added. Also, writing tests can be challenging to developers with limited programming experience, thus adding tests is not a requirement for integrating code contributions into LAMMPS.
Hence we are lagging behind in having suitable test coverage for all of
LAMMPS. Progress can be monitored by enabling code
coverage.
Code coverage data created from pull requests and merges to the
develop
branch can also be monitored on the Codecov
website and this currently
shows that the tests cover about 1/3rd of the LAMMPS source code.
While a significant part of the source code not yet covered is
rarely used, there are still significant “holes” that could be
filled with rather little programming effort.
Tasks
Additional tests can be added at all levels of testing, either by extending existing test programs, writing new test programs, or adding new YAML files for the force style tests.
Instructions on how to write and add tests and some examples are given in the manual.