Loading ...
Sorry, an error occurred while loading the content.
 

Unit Test Rulz

Expand Messages
  • Michael Feathers
    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
    Message 1 of 36 , Sep 6, 2005
      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
    • Craig
      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
      Message 36 of 36 , Sep 8, 2005
        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 clearly express intent as well.


        -----Original Message-----
        From: extremeprogramming@yahoogroups.com
        [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Chris Dollin
        Sent: 08 September 2005 15:21
        To: extremeprogramming@yahoogroups.com
        Subject: Re: [XP] Unit Test Rulz

        On Wednesday 07 September 2005 21:41, Steve Bate wrote:
        > > Phlip wrote:
        > >
        > > Stephen Freeman wrote:
        > > > ...
        > > > Any of these will hurt if you assume it to be true. So unit tests
        > > > should avoid them all?
        > >
        > > Don't call them "unit tests". Call them "tests that drive a clean
        > > design to emerge".
        > >
        > > Coupling to all those problems is bad. Cohering to them is good. So
        > > some tests will work the network layer without a real network. Others
        > > will use a real network, and others will mock the network and inject
        > > faults.
        >
        > Yes. This "unit test" term seems to be causing no end of confusion,
        > especially in an XP context. There are no many different definitions
        > of it that the term seems to have little information content. I like
        > your suggestion, but it's a little verbose. Unfortunately, I don't have
        > a better suggestion.

        "design tests". "designer tests". "driver tests". "exemplar tests".
        "exemplars". "anchor tests." "nails". "nailtests." "atomic tests".
        "thinEnd [OfTheWedge] tests". "navigation tests". "revelation tests".
        "revelations". "testoscopes". "probe tests". "focus tests". "bulb
        tests". "chunk tests." "item tests". "testometers." "testettes."

        Some of those I could like. But surely little tests should be called,
        test- ... no, I'm not going to write that from this address.

        --
        Chris "biological metaphors are powerful" Dollin
        Logic is rational /re/construction. Life is construction.



        To Post a message, send it to: extremeprogramming@...

        To Unsubscribe, send a blank message to:
        extremeprogramming-unsubscribe@...

        ad-free courtesy of objectmentor.com
        Yahoo! Groups Links
      Your message has been successfully submitted and would be delivered to recipients shortly.