OTX Reference  
OpenTestSystem.Otx.Extensions.UnitTest Namespace Reference

Protection of the OTX test logic against expected behavior More...

Namespaces

namespace  Actions
 Lists all ActionRealisation extensions defined in the UnitTest.
 
namespace  Declarations
 UnitTest Declarations
 
namespace  Exceptions
 Error handling.
 
namespace  Nodes
 UnitTest Nodes
 
namespace  Terms
 Lists all Terms defined in the UnitTest.
 

Classes

class  CheckerRule
 Comprehensive checker rule listing, see also Core checker rules. More...
 
class  TestProcedures
 Root element of UnitTest extension. More...
 

Detailed Description

Protection of the OTX test logic against expected behavior

With the UnitTest extension, OTX procedures can be tested related to expected behavior using unit tests or integration tests. Unit tests are part of the software development process to ensure the expected behavior of modules, see Introduction into Software Testing. Unit tests are a prerequisite for subsequent integration tests in order to be able to align the test cases with the interaction of larger functional parts or the entire application.

The following main functions are supported by the UnitTest Extension inside OTF:

  • Tests can be executed inside and outside OTF. Inside the OTF in the Test Explorer and outside with a stand-alone application with and without (console) a GUI.
  • Tests can be run in parallel
  • Support of data driven tests
  • Supports selective running of test cases inside OTF (Test Explorer)
  • Creation and comparing of human readable test reports inside OTF
  • Enables implementing test-driven development
  • Allows writing & running independent tests
  • Supports the complete simulation of the environment, including the vehicle communication (No hardware needed)
  • Supports parametrizable Test Procedures
  • Supports easy to write TestCases for the expected behavior
  • Checking of expected exceptions
  • Supports Assertions, Assumptions etc.

Note: Detailed information about the usage of the UnitTest extension can be found in Unit Tests with OTX.

The UnitTest extension extends OTX with a new type of procedure, the so-called test procedure. Several test cases can be assigned to each test procedure. A test cases describe the parameterization of the test and the expected results.

Note: The UnitTest extension complements the Assertion extension.

Note: In order to clearly separate the OTX test logic from its unit tests, all elements of the UnitTest extension cannot be used in normal OTX procedures, but only in test procedures. This restriction does not apply to the Assert action of the Assertion extension.

Note: The UnitTest Extension has no influence on the normal OTX test logic and is stored separately from it.

If a test was executed the test can have the following test results:

Test Result  Description
DISABLED The test was disabled if the TestProcedure or the TestCase is marked as DISABLED. No subsequent elements will be executed.
Use case: For incomplete or wrong test cases or test procedures.
PASSED The test was passed. The test procedure execution was successful. This will only happens if all expected results of all test cases are fulfilled, all Assert and Assume activities fulfill its condition or a Pass end node was executed.
FAILED The test execution was failed. This can only happens if an expected result of a test case does not match, an Assert activity does not fulfill its condition or a Fail end node was executed.
IGNORED The test was ignored. The default result of a test procedure is IGNORED, if this will not explicit changed via a test case or an action or and node or a disabled attribute. A test case can be explicit set to ignored, if the TestCase is marked as IGNORED or a Ignored end node was executed.
Conditions:
- Corner Case - This should be used if an known problem occurs but only in test conditions, which are not relevant for practical use cases
- Wrong Specification - If the test case is right but the specification is wrong
- Instable Test Case - The test case will be executed right, if it was executed stand alone, but if it executed inside the entire test suite it can happens sometimes (not every time!) that the test case failed. E.g. this can happens, if the environment is unstable and the problem behind is unknown.
Note: A test case wich is marked as IGNORED will be executed, but if it fails, the result is IGNORED and not FAILED.
Note: This result has no influence to the overall result of the parent element.
Note: An IGNORED test case should contain a understandable message, why it was ignored.
INCONCLUSIVE The test execution was inconclusive. This can only happens if an Assume activity does not fulfill its condition or a Inconclusive end node was executed. The behavior is similar to FAILED except that an assumption and not a result does not match.

Note: The severity order of the of the result states is DISABLED > FAILED > INCONCLUSIVE > IGNORED > PASSED.