author	 = {Christian Hovy and Julian Kunkel},
	title	 = {{Towards Automatic and Flexible Unit Test Generation for Legacy HPC Code}},
	year	 = {2016},
	booktitle	 = {{Proceedings of the Fourth International Workshop on Software Engineering for High Performance Computing in Computational Science and Engineering}},
	conference	 = {SEHPCCSE16},
	location	 = {Salt Lake City, Utah, USA},
	doi	 = {},
	abstract	 = {Unit testing is an established practice in professional software development. However, in high-performance computing (HPC) with its scientific applications, it is not widely applied. Besides general problems regarding testing of scientific software, for many HPC applications the effort of creating small test cases with a consistent set of test data is high.
    We have created a tool called FortranTestGenerator, that significantly reduces the effort of creating unit tests for subroutines of an existing Fortran application. It is based on Capture \& Replay (C\&R), that is, it extracts data while running the original application and uses the extracted data as test input data. The tool automatically generates code for capturing the input data and a basic test driver which can be extended by the developer to an appropriate unit test. A static source code analysis is conducted, to reduce the number of captured variables. Code is generated based on flexibly customizable templates. Thus, both the capturing process and the unit tests can easily be integrated into an existing software ecosystem.
    Since most HPC applications use message passing for parallel processing, we also present an approach to extend our C\&R model to MPI communication. This allows extraction of unit tests from massively parallel applications that can be run with a single process.},