http://qs321.pair.com?node_id=599637


in reply to when do you stop writing test?

Boy Howdy, I'd love to be in the position in my project of, "when do I stop making tests" :)

I'm currently on a project that starts its (about) 7th year, only having a test suite since last September.

The test suite barely covers any of the functionality, but the parts that it has, have become invaluable.

Since it's sort of a weird position to be in, from here on out, I'm doing this:

* Write a new (failing) test for any and all bugs submitted. Work on making the tests pass. Keep these tests for as long as they're applicable. Note the bug in the test script itself

* Any new code, write tests that cover as much as possible. Tests for new code is easier, since you can write the tests at the same time as you write the code - you *think* a bit more clearer when writing the code since you sort of wonder a bit how this could be tested

* All other code, write tests when time allows. Untested code is a big question mark in the sentence of, "Is this *really* working the way I think it is?"

Some good times to write tests are when people submit patches that don't change any API but give some sort of performance improvement - does the patch do this without breaking functionality?

Another good time is if you're writing new documentation. Write a test to verify that your documentation is correct.

Hope that gives some insight ;)

 

-justin simoni
skazat me

<script language="JavaScript" src="http://quotes.prolix.nu/cgi-bin/random_quote_js.pl"> </script>