Test Case Generation from Meta-Languagehttps://repo.valu3s.eu/method/test-case-generation-from-meta-languagehttps://repo.valu3s.eu/@@site-logo/logo_valu3s_green_transparent.png
Test Case Generation from Meta-Language
Create test cases and documentation from an API specification in meta language.
The creation of test cases and documentation can be a time-consuming effort. This effort however can be drastically reduced. Furthermore, the manual process of creating specification documents, manuals, test scripts, etc., that build on each other are prone to introduce errors or miss items.
Using an API specification that is written in a meta language with specific keywords and function blocks, many tests, like API tests and tests of basic parameters, can be automatically created along with documentation and manuals and even the target implementation. The method is centred around a tool that creates an implementation that handles the API interface, an implementation of this API command in a user interface tool, test scripts, and a documentation solely from the source of an API specification. This allows maintaining only the specification documents while guaranteeing the consistency of requirements, test scripts, and API and reducing the possibility of human errors.
For the documentation a LaTeX generator was chosen. One benefit is the same documentation format for all subsystems, which improves readability. The test script generation can be further improved by added corner case tests for parameter ranges next to simple API functionality tests.
The implementation of this method adds automation to a manual process [GAPM-TPL04]. It reduces the time to create test cases and minimizes errors or inconsistencies in test case creation, which contributes to an overall reduction of development time and effort [GAPM-TPL05]. At least four steps are replaced by one single step:
Creation of an API command implementation
Creation of an implementation in a user interface
Creation of a test for this command
Documentation of the API
All of the above are created by the planned tool with the input of the command in the meta language.
The implementations are generic and include and test only the parameter ranges and check expected return values. The underlying function is called from within the autogenerated implementation.
Guaranteed consistency in implementation and documentation
Guaranteed consistency of related subsystems
Development time reduction
Consistent format of documents over multiple projects or releases
The initial API specification must be validated thoroughly, otherwise errors can be missed