Program and functions for input/output test