I've used these rules with a large number of teams. They encourage good
design and rapid feedback and they seem to help teams avoid a lot of
trouble.
---
A test is not a unit test if:
1) It talks to the database
2) It communicates across the network
3) It touches the file system
4) It can't run correctly at the same time as any of your other unit tests
5) You have to do special things to your environment (such as editing
config files) to run it.
Tests that do things things aren't bad. Often they are worth writing,
and they can be written in a unit test harness. However, it is
important to be able to separate them from true unit tests so that we
can keep a set of tests that we can run fast whenever we make our changes.
I've used these rules with a large number of teams. They encourage good design and rapid feedback and they seem to help teams avoid a lot of trouble. ... A...
... I just wanted to add in some of the background you had in your book for those that don't have /Working Effectively with Legacy Code/. The context is that...
... And the reward for writing one Real Unit Test is a Hershey's Special Edition Dark Chocolate Bar, small sized, right? (Oh, yeah, the other reward is your...
... NUnitAsp tests itself with 242 tests and they took 23 seconds last time I ran them. This isn't a speed-demon, either... it's a two-year-old laptop with...
... Sorry Jim - I didn't mean to imply that NUnitAsp itself was the cause of the slow down. We are testing a lot of datagrids, including editing and inserting...
... No, I didn't think you did. Although it's easy for me to get defensive about my "baby." :) ... Come to my Test-Driven ASP.NET course next week. :)...
... I'd love to - but you all are just about as far away from us as you could be. Good luck on it (though from what I've seen so far, I don't think luck will...
... No! That could never happen!?!? Could it?? ;-> Ron Jeffries www.XProgramming.com Find the simple path to what works and follow it, always looking for a...
... That's why I suggested the chocolate reward. It is a "reward-worthy" unit test. That and the decoupling force it applies on the code. "Whaddaya mean I...
... It's not the tests, it's the code they generate. Plenty of tests may use your test environment. Call them "integration tests". And they are all still...
... be not in unit-tests does not have to be not in tests. ... the fail-first method just make you have a good pace of walking. this time of red-light makes...
Woody.Wu
Woody.Wu@...
Sep 8, 2005 5:57 am
... no. i think it should be just not include other systems, but the interactions with other systems should be included....
Woody.Wu
Woody.Wu@...
Sep 8, 2005 6:03 am
... Don't get me wrong. I agree very much that interactions between systems should be tested. I think Ron is right, we have a terminology issue. So my...
Hi Developer Tests > help developers write code. Customer Tests > help customers assert suitability. Seem to be banded about a lot these days. The names quite...
Craig
craig@...
Sep 8, 2005 2:54 pm
... Michael ... I think your guidelines are good ones, but I would raise two issues: 1. The phrase "unit test" already has a fairly solid meaning in the ...
... Ron, Can you explain a little more how the above "rules" differ from the solid meaning of "unit test" here? I am confused because it seems like the...
... Well, my concern wasn't with my mind, which although not necessarily OK has served me reasonably well so far. My concern was with the definition in the...
... Didn't mean to come across that your mind was anyone's concern. ;) It should have read more along the lines of "in your opinion, how does the definition of...
... My dear friend Michael is saying "it's not a unit test if it does X". But it might well be a unit test in the sense even of TDD tests, and certainly would...
... Actually, I wonder if he meant that as a stake in the ground, not all that dissimilar from what Jim put up recently. I know the text from Michael's post...
Rules (1), (2) and (3) allows to *speed-up* the unit tests. Other than that what other benefits do we have? Thanks and Regards KD ... -- Dakshinamurthy Karra...
Dakshinamurthy Karra wrote: (4) is about true isolation, (5) is about making sure that whatever dependencies you break get reflected back in the code. (1-3)...
Michael, In my understanding having automated UTs helps in maintaining the health of the system. The major benefit is that the UTs provide a measure of...
... If you use a crappy middle tear - perhaps. We use Apple's WebObject/ EOF and WOUnit for testing and it just works... (see complete example at the end of...