# "test" terminology

**URL:** <https://www.ruby-forum.com/t/test-terminology/162030>\
**Category:** Rails\
**Created:** [March 5, 2009, 1:48am UTC](https://www.ruby-forum.com/t/test-terminology/162030 "2009-03-05T01:48:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 5, 2009, 1:48am UTC](https://www.ruby-forum.com/t/test-terminology/162030/1 "2009-03-05T01:48:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 5, 2009, 6:13pm UTC](https://www.ruby-forum.com/t/test-terminology/162030/2 "2009-03-05T18:13:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 5, 2009, 6:46pm UTC](https://www.ruby-forum.com/t/test-terminology/162030/3 "2009-03-05T18:46:41Z")

</div>

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.
