On Mon, Dec 29, 2008 at 11:17 PM, Erik Pukinskis <erikpukins...@gmail.com> wrote: > > This is one thing I don't get. I just started implementing steps, but > I feel like THAT code is all completely untested. I don't know if my > regular expression is correct, I don't know if it does what I think it > should do.
The tests are tested by your working application. If you have application code that clearly does the right thing in actual use, but your tests for that specific use case fail, your tests are broken. If your application has bugs but your tests for that use case pass, your tests are broken. If your application works and your tests pass, then practically speaking the tests are valid. If your tests fail and your application fails for that use case, the tests are valid. Is that the same as formal proof? No. From a formal logic perspective it's not even in the ballpark. And it's not necessarily sufficient, either. You could have entirely valid tests but still not be testing everything you should. There's always some edge case you didn't think of. TDD/BDD isn't formal, it's agile. It's supposed to make it easy to get to "good enough" and then improve incrementally from there, raising the bar for "good enough" with every iteration. As for writing tests for your tests... Sure, you could potentially have turtles all the way down. But as I see it, I'm not being paid to write tests. Or when I'm doing projects for personal goals, the test code isn't the goal. Eventually common sense has to kick in, and you have to trust yourself somewhere. If you can't trust yourself, if your regexes are so complicated that you can't understand them and determine their validity with a couple of passing/failing application cases, maybe you need to simplify things with clearer or more granular steps. -- Have Fun, Steve Eley (sfe...@gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users