Write unit tests in the code to make sure that the code works correctly. This would help to detect and protect against bugs in the future.