Add test code, and modify source code.