Search the web
Sign In
New User? Sign Up
extremeprogramming · Extreme Programming
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Unit Test Rulz   Message List  
Reply | Forward Message #111829 of 152428 |

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.



Michael Feathers
www.objectmentor.com





Tue Sep 6, 2005 1:50 pm

mfeathers256
Offline Offline
Send Email Send Email

Forward
Message #111829 of 152428 |
Expand Messages Author Sort by Date

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...
Michael Feathers
mfeathers256
Offline Send Email
Sep 6, 2005
1:50 pm

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 6, 2005
2:03 pm

... 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...
Phlip
phlipcpp
Offline Send Email
Sep 6, 2005
2:17 pm

... 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...
Jim Shore
jimlittle82
Offline Send Email
Sep 6, 2005
8:54 pm

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 7, 2005
12:59 pm

... 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. :)...
Jim Shore
jimlittle82
Offline Send Email
Sep 8, 2005
6:48 am

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 8, 2005
12:10 pm

... 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...
Ron Jeffries
RonaldEJeffries
Offline Send Email
Sep 8, 2005
12:18 pm

... 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...
Phlip
phlipcpp
Offline Send Email
Sep 7, 2005
2:24 am

... 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...
Phlip
phlipcpp
Offline Send Email
Sep 7, 2005
1:36 pm

I like the term "executable design spec". ... [Non-text portions of this message have been removed]...
Steven Gordon
sfman2k
Offline Send Email
Sep 7, 2005
8:47 pm

... 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@...
Send Email
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@...
Send Email
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...
Cory Foy
cory_foy
Online Now Send Email
Sep 8, 2005
12:20 pm

... good definition! -- steven woody (id: narke)...
Steven Woody
narkewoody@...
Send Email
Sep 8, 2005
12:55 pm

... "design tests". "designer tests". "driver tests". "exemplar tests". "exemplars". "anchor tests." "nails". "nailtests." "atomic tests". "thinEnd...
Chris Dollin
eccentric_he...
Offline Send Email
Sep 8, 2005
2:23 pm

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@...
Send Email
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 Jeffries
RonaldEJeffries
Offline Send Email
Sep 6, 2005
5:03 pm

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 6, 2005
5:45 pm

... 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...
Ron Jeffries
RonaldEJeffries
Offline Send Email
Sep 6, 2005
6:53 pm

... We've won one battle, we can win another. Michael Feathers www.objectmentor.com...
Michael Feathers
mfeathers256
Offline Send Email
Sep 6, 2005
7:09 pm

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 6, 2005
7:18 pm

... 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...
Ron Jeffries
RonaldEJeffries
Offline Send Email
Sep 6, 2005
10:31 pm

... Ok, I understand more about where you are coming from. Thanks for clarifying that. Cory...
Cory Foy
cory_foy
Online Now Send Email
Sep 7, 2005
1:00 pm

... 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...
Cory Foy
cory_foy
Online Now Send Email
Sep 7, 2005
6:15 pm

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
kdmurthy2001
Offline Send Email
Sep 6, 2005
5:34 pm

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 Feathers
mfeathers256
Offline Send Email
Sep 6, 2005
6:14 pm

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...
Dakshinamurthy Karra
kdmurthy2001
Offline Send Email
Sep 6, 2005
6:55 pm

... 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...
Georg Tuparev
gtupar
Offline Send Email
Sep 7, 2005
11:10 am
First  | < Prev  |  Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help