Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^5: Test/ Code Ratio

by Aristotle (Chancellor)
on Jan 28, 2005 at 23:06 UTC ( #426152=note: print w/replies, xml ) Need Help??

in reply to Re^4: Test/ Code Ratio
in thread Test/ Code Ratio

It sounds like what you're doing is more testing implementation. That's not what TDD as it has been pubilicized widely is. TDD is about testing interfaces rather than implementation (though the line is admittedly blurry at times).

Personally, I can't follow you argument about having to look at the testcase to track down the failure; maybe if you only used a simple ok() function? The more expressive tests in Test::More like is() and friends will not only tell there was a failure but also what was expected and what happened; together with descriptive test names I almost never have to look into my testcases to track down a failure.

My own experience with doing interface tests inline is that this makes aggressive refactors hard (which runs contrary to the spirit of test-first development). I find that particularly the tests I write first often suggest a completely different direction than what the eventual structure of the code grows into. That doesn't hinder me; they're separate from the code, after all.

The Test:: modules were written with that approach in mind, and since you want something other than that, they obviously won't be a particularly good fit. That doesn't make them subpar in itself, it just means there's an impendance mismatch between your goals and theirs.

Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426152]
[Corion]: marto: Great! The German Perl Workshop was a success even though things looked dire before, and I'm now back at home with two days off work still to go ;)
[Corion]: I hope things have settled down a bit for you and the boys are alright?!
[choroba]: Good morning, if a bit rainy
[marto]: life is a struggle :P I'm glad the GPW went well.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-06-29 08:04 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (655 votes). Check out past polls.