It's a good idea to record invariants about your code and your problem. Tests are one way, and there are some other ways. It's a good idea to have the checking of invariants be automatic somehow.
Any assumptions about the output of your code that you make but don't record in a checkable form, are something that could potentially be silently broken by a change in the code. And then you're wasting your time debugging rather than solving the problem you're working on.
Any assumptions about the output of your code that you make but don't record in a checkable form, are something that could potentially be silently broken by a change in the code. And then you're wasting your time debugging rather than solving the problem you're working on.