fek
14-12-2005, 11:21
http://msdn.microsoft.com/msdnmag/issues/06/01/UnitTesting/default.aspx
"How do you know if you have good coverage for your new code? Try removing a line or a constraint check. If all tests still pass, you don't have enough code coverage and you probably need to add another unit test. The best way to make sure you are adding the correct test is to not uncomment that line or check until you produce a test that fails until you do uncomment it. This may be hard, but if you can't think of a way to make this code fail, you probably don't have a good reason for writing that line of code in the first place."
Al di la' del linguaggio e del testing framework usati, i principi sono validissimi e generali.
"How do you know if you have good coverage for your new code? Try removing a line or a constraint check. If all tests still pass, you don't have enough code coverage and you probably need to add another unit test. The best way to make sure you are adding the correct test is to not uncomment that line or check until you produce a test that fails until you do uncomment it. This may be hard, but if you can't think of a way to make this code fail, you probably don't have a good reason for writing that line of code in the first place."
Al di la' del linguaggio e del testing framework usati, i principi sono validissimi e generali.