new to testing, I just started writing test for the webapp i wrote, using Test::More and Test::WWW::Mechanzie (i wrote the webapp first. otherwise would be interesting to try test-first before writting code). with corner cases and bad inputs, i feel that i have tested the webapp enough ( so it works the way it should ) along with T::W::M testing, i also test module requirements, configuration file. so far it has been joyful.
however, based on what i read from here and perldoc, i seem to missing unit test. i.e test each function and module API. I think Test::Tutorial has an example on this. i also read this:
from http://www.artima.com/intv/testdriven4.htmlBill Venners: When do you stop writing tests? You say in Refactoring, +"There's a point of diminishing returns with testing, and there's a d +anger that by writing too many tests you become discouraged and end u +p not writing any. You should concentrate on where the risk is." How +do you know where the risk is? Martin Fowler: Ask yourself which bits of the program would you be sca +red to change? One test I've come up with since the Refactoring book +is asking if there is any line of code that you could comment out and + the tests wouldn't fail? If so, you are either missing a test or you +'ve got an unnecessary line of code. Similarly, take any Boolean expr +ession. Could you just reverse it? What test would fail? If there's n +ot a test failing, then, you've obviously got some more tests to writ +e or some code to remove.
It reads fine. but i got the feeling that i am going to write hella more tests if using his method. now for the experienced monks, I am interested in how much unit testing or just general testing do you do?
In reply to when do you stop writing test? by Qiang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |