Rule #3 Test-drive your code
Begin by the tests.
The tests will lead the development of your code. Begin by specifying them.
Do not develop in the void while leveraing the hope it will be used some day.
Oh .. and also test non-nominal cases. Proper handling should be tested.