I'm having difficulties finding a hard definition of the word "test case". Some sources claim that a test case is a class that extends TestCase
. Other sources claim that a test case is a single test method. The JUnit documentation is unclear, it appears to me the words "test case" and "test" mean the same:
The
Test
annotation tells JUnit that thepublic void
method to which it is attached can be run as a test case. To run the method, JUnit first constructs a fresh instance of the class then invokes the annotated method. Any exceptions thrown by the test will be reported by JUnit as a failure. If no exceptions are thrown, the test is assumed to have succeeded.
So what exactly is a "test case", and what is its relationship to a "test"?