Part 3: Testing with Faktor-IPS

Summary

In a typical Faktor-IPS project, approx. 60-80% of the business model are generated. This generated part of the source code needs no further testing because it was already tested once and for all in the course of the Faktor-IPS development. Tests for the remaining, custom made part of the source code can be defined with JUnit or using the Faktor-IPS test functions. The following diagram shows criteria that can help you to decide which approach is better suited under the given circumstances.

decision criteria
Figure 1. Decision criteria for test tool

The test support in Faktor-IPS is based on the separation between test case types and the test cases themselves. Test case types are defined by the application developer. As it is the case with the business object model, a model-driven approach is used. This approach consists in modeling the structure of the test data first and then generating the source code to read the test data of specific test cases. The only thing that remains for the developer to do, is to call the functions he wants to have tested and to match the actual results against the expected results.

Test cases with concrete test data can be created on the basis of a test case type. To do this, a specific Test Case Editor is provided. You can execute test cases in the test runner and display any differences that might show up. What’s more, you can run one test case, multiple test cases, or all test cases in a project.

Both the Test Case Editor and test runner are integrated into the product definition perspective of Faktor-IPS and can easily be used by business users. This way, business users can take advantage of a unified user interface for defining products and tests. It can be used to define and test new products independently of the operational systems.