[Zope3-dev] XP Jargon?

Jim Fulton jim at zope.com
Wed Jan 28 10:55:05 EST 2004


Tres has been correcting me on my XP jargon.  I thought I'd share
the definitions with everyone, and give Tres another opportunity
to correct me. :)

Unit tests -- Tests that test one thing at the lowest level.

    A unit test suite should test one component or class. Ideally,
    a test should test a minimal interaction, although, we often
    compromise on this.

    Many of our so-called unit tests are really integration tests.
    Often a component depends on a number of other components to
    do it's work, and tests require significant setup. Sometimes,
    this is unavoidable.  But I'm learning, over time, that, with
    care, we often can avoid a lot of setup, either using scaffolding
    or by being careful just to test components in isolation.

    A good example of this, imo are the ZODB tests. To test persistence,
    we have often fallen into the trap of creating databases and storing
    objects in the databases and making sure we can load them, look at their
    state, and so on.  OTOH, on occasion, we've managed to get things right.
    I'm especially proud of persistence.tests.test_persistence.

    I'm not religious on this issue, but I've found that adhering to the
    principal of *only* testing one thing can make writing tests simpler
    and makes the tests more readable.

Integration tests -- Test multiple components working together

    Tres argues that our functional testing framework really is an integration
    testing framework.

Functional tests -- Test the external behavior of the system

    Tres argues that these tests need to run the entire system,
    including the HTTP server.

    I'm willing to go along with this, but I'd be interested in other
    people's opinions.

Refactoring -- Minor software changes that should not require
    changes to tests. This might include factoring common code or
    renaming variables.  Cosmetic changes to tests are considered ok.

    (Given this definition, I have trouble understanding how refactoring
     can be merciless.)

Restructuring -- Major changes, such as architecture changes.  These
    typically require some test changes.  Most of the work we've been
    doing to clean up Zope 3 have been restructurings.


I'd like some new jargon. I'd like to distinguish between restructurings
that affect persistent data (zodb, rdbms, etc.) and those that don't.
Restructurings that affect persistent data require us to:

- Include icky backward compatibility code,

- write database conversions, or

- throw away databases (which we try *very* hard to avoid).

Any suggestions?

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list