as many of you know I am a big fan of Unit Testing where it is possible. sometimes you can do weird things/setups to do testing and I am not that fanatical about it.

in my common library of methods/etensions for Xojo, I have over 3,000 unit tests and I am missing some. and people that hear that number are in shock that I have that many. well with over a decade of programming in REALBasic/Real Studio/Xojo (that is what the language was called over the years), you tend to collect a lot of various methods/extensions. my general rule of thumb for unit tests is to have ten(10) for each method. now sometimes that doesnt make sense. for instance if I had a method that tool a boolean and converted it to a string, there is only two possible answers. true and false. so writing ten(10) unit tests doesnt make sense. two(2) covers all bases and is enough.

so my personal goal of trying to have ten(10) unit tests per method is not a hard and fast rule. also, if I find an edge case that I have to write/update code for, that is a separate unit test that doesnt count towards the ten(10) goal.

how many unit tests do you have? how many should you have? not sure. more the merrier.

–headmonkey