"test" terminology

I’ve just learned that “unit” and “functional” tests, in the context of
Rails application development, really mean “model” and “controller”
tests, respectively. [1] What terms should I use for actual unit tests?
Is it sufficient to let context make the distinction clear, or does my
vocabulary still need a few more patches?

  1. “Integration” tests seem to retain the traditional meaning, and there
    are apparently no “view” tests, so at least we’re only inconsistently
    inconsistent.

Hi Jeff,

On Wed, 2009-03-04 at 19:31 -0500, Jeff S. wrote:

What terms should I use for actual unit tests? Is it
sufficient to let context make the distinction clear,
or does my vocabulary still need a few more patches?

IME, you’ll do yourself and those around you a big favor if you adjust
your vocabulary. What follows is one man’s experience. YMMV.

You’ve got two audiences: customers and fellow developers.

To customers you say something like: We’re expanding the scope of our
Unit tests. That’s all they want to know. To them, Unit testing is
what the developers do before they get to see the product. Expanded
Unit testing - all good.

To your fellow developers you say something very similar, but with a bit
more explanation. You can avoid redefinition with the customoer, but
not with your fellow developers. Say something like: We’re expanding
the scope of our Unit tests to include automated tests that are
structured to mirror Rails’ MVC pattern. We need to adjust our
terminology a little though, because in Rails lingo, the terms Unit /
Functional / Integration test have a different meaning than we’re used
to. In Rails lingo, Unit / Functional / Integration tests are specific
to our Rails Models / Controllers / Views. To avoid confusion, let’s
use a prefix: ‘automated-unit tests’ or ‘rails-unit tests’ or something
to help us distinguish between what we used to mean when we said ‘unit
tests’ and what we now mean. We’ll get through the adjustment period
more quickly if help each other. So if I ask ‘where are your unit
tests?’, you should ask ‘you mean my automated-unit tests?’ Expect it
to take time and effort for the team to adjust.

BTW, in case it doesn’t come through clearly, I disagree with your
assessment that %q{“Integration” tests seem to retain the traditional
meaning, and there are apparently no “view” tests.} All of Rails’ tests
fall into the ‘traditional meaning’ of Unit tests. “View” tests in
Rails are accomplished via Integration tests.

HTH,
Bill

bill walton wrote:

Hi Jeff,

On Wed, 2009-03-04 at 19:31 -0500, Jeff S. wrote:

What terms should I use for actual unit tests? Is it
sufficient to let context make the distinction clear,
or does my vocabulary still need a few more patches?

IME, you’ll do yourself and those around you a big favor if you adjust
your vocabulary. What follows is one man’s experience. YMMV.

Thanks for the guidance.

Expect it
to take time and effort for the team to adjust.

There’s no team. Just me. I was asking for purposes of discussion in
fora like this one.

BTW, in case it doesn’t come through clearly, I disagree with your
assessment that %q{“Integration” tests seem to retain the traditional
meaning, and there are apparently no “view” tests.} All of Rails’ tests
fall into the ‘traditional meaning’ of Unit tests.

Unit and Functional tests sort of do. I should have been clearer: to
me, a Unit Test tests exactly one thing.

“View” tests in
Rails are accomplished via Integration tests.

By “view tests,” I meant “traditional unit tests of views.” If an
integration test fails, by definition, you don’t immediately know which
component (if any) was at fault. If a traditional unit test of a view
failed, you would know the view (or the test) was broken.