in reply to when do you stop writing test?

In the real world situation that you've got, I'd write tests to cover everything that you've documented, plus corner cases and places where you know your code might be a bit dodgy, and stop when you think you've covered everything. Then when you find a bug, you write a test to cover it and then change the code to fix it - and also make sure you still pass all your old tests.

You might find some of the code coverage modules on the CPAN useful - if they find code that's not covered when you run your tests, that's a sure sign that you need more tests.