tags:

views:

129

answers:

3

The term test case used a lot, but what does it actually mean?

Test case as Fixture:

  1. http://en.wikipedia.org/wiki/Test_case

    A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system is working correctly or not.

  2. http://www.junit.org/junit/javadoc/3.8.1/junit/framework/TestCase.html

    A test case defines the fixture to run multiple tests.

  3. NUnit:

    [TestFixture] public class MyTests { }

Test case as tests container/organizer:

  1. http://xunitpatterns.com/test%20case.html

    Usually a synonym for test. In XUnit, it may also refer to a Testcase Class which is actually a Test Suite Factory as well as a place to put a set of related Test Methods.

  2. http://xunitpatterns.com/Testcase%20Class%20per%20Feature.html

    • Testcase Class Per Method
    • Testcase Class Per Feature
    • Testcase Class Per User Story
  3. http://guides.rubyonrails.org/testing.html

    They differentiate fixture from TestCase

Non technical:

  1. http://wordnetweb.princeton.edu/perl/webwn?s=test+case

    test case, test suit (a representative legal action whose outcome is likely to become a precedent)

So, what "case" actually stands for?

+3  A: 

http://dictionary.reference.com/browse/case

  1. an instance of the occurrence, existence, etc., of something: Sailing in such a storm was a case of poor judgment.
Paul Tarjan
It is hard for me to think about "test case" as "test occurrence" or "test existance".
alex2k8
it is an instance of a test. 1 test case.
Paul Tarjan
+2  A: 

"case" means "an example of something".

For example:

if( x < 3 ){ }

A case when this may go into the block, is when x = 2. Another case could be when it won't go in, i.e. x = 9.

Noon Silk
Interesting... Can I call a test method Should_throw_exception_if_password_to_short the test case? As this method describes particular "example". Than in context of jUnit the TestCase should be seen as TestCases.
alex2k8
xUnit Test Patterns seems to give such meaning as you suggested: "the test fixture will be newly constructed for each test case in the Testcase Class."
alex2k8
Also, in question itself I wrongly classified this definition "Usually a synonym for test" - it confirms your defintion as well.
alex2k8
+1  A: 

case = situation or condition

gw