Are you absolutely sure that they do what they say they do? For example, you may create an function called add(). You may just have a return statement that adds two variables. But what if you wanted that function to also be able to handle non-numeric additions. What if you wanted it to add two vectors or two complex numbers?
Normally those assumptions would be a made in the writers mind as a fog of thought that lead to the act of typing the code. When someone else reads the code again, they form assumptions on how they expect the code to function based on their impression of what the application should be doing and how the code should have been written.
Writing unit tests is the act of making those assumptions explicit. I think it is wrong to call test as “tests”. I feel it is more appropriate to call them assumptions or expectations.
Published: April 13, 2013