write input/output testcode