What do you normally do before coding some hard algorithm? Write directly the tests? Write some diagram first to detect what to test? Which type of diagrams or notes do you use?
And, do you follow the same steps for more easy algorithms? Or do you miss some steps?