It is tempting to write the code and the see if the result 'looks right' but as you rightly intuit. It's not a good idea. When the algorithm is hard you can do a number of things to make the manual calc of the result easier. 1. Use excel. set up a spreadsheet that does some or all of the calc for you. Keep it simple enough so that you can see the steps 2. Split your method up into smaller testable methods each with its own tests. When you are sure the smaller parts work. Use them to manually work through the next step. 3. Use agreegate properties to sense check. Ie say you have a probablity calculator you might not know what indivial results should be, but you know they all have to add up to 100% 4. Brute force. Write a program that generates all possible results and check that none are better than your algorithim generates.