Concepts and Definitions - TestCentric/tc-lite GitHub Wiki

TC-Lite is based on a number of concepts common to various test frameworks with a few wrinkles of its own. In some cases, there are distinct choices to be made and we want to make clear which choices have been made by TC-Lite.

Tests

A Test can mean many things. We use it in TC-Lite to indicate code, which may fail or succeed, with success indicating that the system under test is working as intended, at least within the scope of the particular behavior being tested. "Test" is a concept and doesn't imply any particular implementation. When we want to specify the implementation in more detail, we may refer to a "test method", "test class" etc.

A Test Suite is a special kind of Test, which contains other tests. One important type of Test Suite is a Test Fixture.

It's important to remember that Tests, Test Fixtures and Test Suites are concepts and don't imply any particular implementation. For implementation details, see the following sections.

Test Methods

A Test Method is a user-defined method implementing a Test. It may or may not have arguments and it may or may not return a value. Test Methods are recognized in TC-Lite by means of special attributes (e.g. [Test]) applied to the method by the user.

Each Test Method may create one or more Test Cases. A Test Case is a kind of Test formed by combining a Test Method with some particular set of data to be used as arguments. A method that takes no arguments automatically represents a single Test Case, while one that takes arguments results in multiple cases, depending upon how many sets of arguments are supplied by the user.

Test Classes

A Test Class is a class, defined by the user, which contains one or more Test Methods. The class implements a special kind of test, called a TestFixture, which contains a group of individual tests. The TestFixture only succeeds if all the contained tests succeed.

Just as for methods, a Test Class that takes arguments in it's constructor may generate multiple Test Fixtures

Other Test Suites

Other groupings or suites of tests may be viewed as tests within TC-Lite. For example a namespace containing multiple Test Classes may sometimes be treated as a Test.

Assertions

Test Methods almost always contain one or more Assertions. An assertion is essentially a statement that some condition is true with respect to the operation of the software under test. The key thing to understand is that an assertion is expected to either succeed or fail. In the most common case, failure of any assertion causes a failure of the test that contains it.

Various syntactic forms are used to make assertions in TC-Lite and will be described in the documentation. In general, they all have three things in common:

  1. A value to which the assertion is being applied. This is usually some result from the software under test.

  2. A Constraint which is being applied to the value. Constraints are essentially enhanced predicates with the ability to give an understandable error message in case of failure.

  3. A Verb indicating what action should be taken in case of failure. Usually, the Assert verb is used to indicate that the test should fail. But other verbs may cause different results, such as issuing a warning or declaring the test to be inconclusive.