I. Abstract
This OGC Testbed 17 Engineering Report (ER) documents the result of the work performed in the CITE thread of the OGC Testbed-17 initiative. CITE is the Compliance Interoperability & Testing Evaluation Subcommittee that provides a forum for an open, consensus discussion regarding approaches and issues related to conformance and interoperability testing as part of the OGC standards process. This ER provides information about the development of a test suite for the OGC API — Processes Standard (OGC18-062r2) to be executed in the OGC Test Evaluation tool (TEAM Engine). The ER also documents an evaluation of an alternative environment for OGC compliance testing.
II. Executive Summary
This Engineering Report (ER) captures the result of the work performed in the CITE thread as part of the OGC Testbed-17 initiative. The document provides information about the development of a test suite for the OGC API – Processes standard to be executed in the OGC Validator tool (which is implemented using open source TEAM Engine software product) and evaluation of an alternative environment for OGC testing. The work is done under the umbrella of the Compliance Interoperability & Testing Evaluation (CITE) Subcommittee (SC) that provides a forum for an open, consensus discussion regarding approaches and issues related to conformance and interoperability testing as part of the OGC Standardization process.
The content of this ER will inform OGC Standards Working Groups (SWGs) about how to structure and write compliance tests for the most recent OGC API Standards. The ER also documents the pros and cons of using a possible alternative testing environment. It will facilitate enhancement of interoperability by providing the infrastructure to test and improve more implementations that are seeking compliance certification towards OGC standards.
As at 2021, several OGC SWGs are developing API standards that enable easier interaction of modern clients with servers. The OGC API — Processes standard is designed to enable a client to explore and run processes available over the web. The work done in Testbed 17 provides both the TestNG scripts and an alternative environment to write the tests to check if implementations are compliant with the OGC API — Processes.
The OGC Validator is currently implemented using a Java-based application called TEAM Engine to perform testing of software that claim compliance with one or more OGC standards. TEAM Engine executes one or more tests written in either the Compliance Test Language (CTL) or implemented using the TestNG Framework. The Testbed-17 participants explored the challenges of using this testing framework for the most recent OGC APIs.
The work in this thread responded to the following research questions:
What does a TEAM Engine test for OGC API — Processes looks like?
What alternative test environment(s) should be used in the future and why?
How do tests look like for this new test environment?
Is it possible to automatically generate tests from the latest generation of OGC specifications? If it is possible, then what level of automatization is possible? Does a high level of automatization require a change to the format that the OGC standards are currently encoded?
An overview of findings and recommendations is as follows:
Creating compliance tests for the new OGC API Standards is possible.
Two environments were tested, following TestNG and a new environment based on the ETF test framework. The ETF framework is used in the European Union’s INSPIRE Validator and uses NeoTL. Note that the INSPIRE Validator also uses OGC’s TEAM Engine instance for some tests. The work in the CITE thread of Testbed-17 demonstrated that OGC compliance testing can be performed using this environment. However, more work is necessary to make this approach part of the OGC Testing tools, including improving performance.
Java stubs can be generated automatically from a Standards Abstract Test Suite (ATS) in ASCII doc. This speeds up the process of developing the new tests.
For tests that require inspection of the results (e.g. a process), providing a scenario where the request and responses are known is important.
The current TEAM Engine needs further enhancements such as supporting content type “application/problem+json” and providing better feedback to the tester (e.g. header content being sent).
III. Keywords
The following are keywords to be used by search engines and document catalogues.
ogcdoc, OGC document, CITE, API, compliance
IV. Preface
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The Open Geospatial Consortium shall not be held responsible for identifying any or all such patent rights.
Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.
V. Security considerations
No security considerations have been made for this document.
VI. Submitting Organizations
The following organizations submitted this Document to the Open Geospatial Consortium (OGC):
- GeoSolutions
VII. Submitters
All questions regarding this document should be directed to the editor or the contributors:
Name | Organization | Role |
---|---|---|
Luis Bermudez | GeoSolutions | Editor |
Peter Vretanos | CubeWerx | Contributor |
Benjamin Pross | 52°North | Contributor |
Gérald Feony | Geolabs | Contributor |
Jon, Herrmann | interactive instruments GmbH | Contributor |
OGC Testbed 17: CITE Engineering Report
1. Normative references
The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
OGC 18-062r2, OGC API — Processes — Part 1: Core, Open Geospatial Consortium (2021)
2. Terms and definitions
This document uses the terms defined in OGC Policy Directive 49, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this document and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.
This document also uses terms defined in the OGC Standard for Modular specifications (OGC 08-131r3), also known as the ‘ModSpec’. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.
For the purposes of this document, the following additional terms and definitions apply.
2.1. Abstract Test Suite (ATS)
A set of testable assertions about the functionality of a standard, which an implementation must support in order to achieve compliance to the standard. ATS are based on the conformance clauses defined in the standard.
2.2. Compliance
A state of a specific software product, which implements an OGC Standard and has passed the Compliance Testing Evaluation.
2.3. Executable Test Suite (ETS)
A set of code (e.g. Java and CTL) that provides runtime tests for the assertions defined by the ATS. Test data required to do the tests are part of the ETS.
2.4. Process
A process p is a function that for each input returns a corresponding output
where denotes the domain of arguments and denotes the co-domain of values y. Within this specification, process arguments are referred to as process inputs and result values are referred to as process outputs. Processes that have no process inputs represent value generators that deliver constant or random process outputs.
The term process is one of the most used terms both in the information and geosciences domain. If not stated otherwise, this specification uses the term process as an umbrella term for any algorithm, calculation or model that either generates new data or transforms some input data into output data as defined in section 4.1 of the WPS 2.0 standard.
3. Introduction
The Compliance Program provides the resources, procedures, and policies to certify products for compliance with one or more OGC standards. Amongst the resources provided by the program are executable test suites that enable developers to test whether their products implement OGC Standards correctly. This Engineering Report (ER) provides the following major sections:
Considerations for implementing an Executable Test Suite for OGC API — Processes
New test environment and comparison with the current TEAM Engine
Description of an ETS for OGC API — Processes
Future work
Conclusions
4. Executable Test Suite
This section provides information about the development of the Executable Test Suite (ETS) for OGC API — Processes. The executable test suite was developed as a module for deployment into TEAM Engine software. The following standards development organizations are known to offer compliance testing using TEAM Engine:
Open Geospatial Consortium (OGC)
US Geospatial Intelligence Standards Working Group (GWG), with responsibility for standards of the US National System for Geospatial Intelligence (NSG)
Defence Geospatial Information Working Group (DGIWG)
The European Union’s INSPIRE Validator is also known to use the OGC’s TEAM Engine instance for some INSPIRE validation tests.
4.1. TestNG Test
4.1.1. Overview
The executable test for OGC API — Processes 1.0 is available at the OGC GitHub repository:
https://github.com/opengeospatial/ets-ogcapi-processes10
The test has been developed in TestNG[https://testng.org/doc/], the current test framework used by the OGC Compliance Program.
The following standards have been used:
OGC API — Processes — Part 1: Core (OGC 18-062r2)
Each conformance class is represented as a TestNG Java class within its own package. The package structure is shown in the following:
|
|_ org.opengis.cite.ogcapiprocesses10
|_ org.opengis.cite.ogcapiprocesses10.conformance
|_ org.opengis.cite.ogcapiprocesses10.general
|_ org.opengis.cite.ogcapiprocesses10.jobs
|_ org.opengis.cite.ogcapiprocesses10.landingpage
|_ org.opengis.cite.ogcapiprocesses10.openapi3
|_ org.opengis.cite.ogcapiprocesses10.process
|_ org.opengis.cite.ogcapiprocesses10.processlist
|_ org.opengis.cite.ogcapiprocesses10.util
Figure 1
The following conformance classes were implemented:
Landing Page /
API Definition /api
Conformance Path /conformance
HTTP 1.1
Processes /processes
Jobs /jobs
The following conformance classes were not implemented:
Joblist
Dismiss
Callback
The method stubs and code comments (JavaDoc) for the Java classes were created out of the abstract test suite using an automated script.
A demonstration instance of the test suite is available here:
https://17.testbed.dev.52north.org/teamengine/
For the validation of the JSON requests/responses the OpenAPI4J library was used.
The following image shows the start screen of the user interface. The user can specify the endpoint of the landing page of the OGC API — Processes implementation, as well as the identifier of a testable process.
Figure 2 — Start screen of the TEAM Engine tests for the OGC API - Processes - Part 1 standard
Figure 3 — Result screen of the TEAM Engine tests for the OGC API - Processes - Part 1 standard
During the testbed, 30 tests of the OGC API — Processes standard were implemented. An unresolved issue with the validation of the schema for results prevents the completion of a number of tests. The following table shows the test results using the OGC API — Processes instance running at: http://tb17.geolabs.fr:8101/ogc-api using the process published by the server that has the identifier “echo”:
Table 1
Test | Result | Reason |
---|---|---|
test Job Results Sync | Skipped | Did not find Link with value rel=monitor, skipping test. |
test Job Results Async Document | Passed | - = |
test Job Creation Input Inline Binary | Failed | Not implemented yet. |
test Job Creation Sync Raw Mixed Multi | Failed | Not implemented yet. |
test Job Results No Such Job | Passed | - |
test Job Results Exception Results Not Ready | Failed | Not implemented yet. |
validate Conformance Operation And Response | Passed | - |
test Job Creation Input Inline | Passed | - |
test Job Creation Sync Raw Value One | Failed | Got unexpected status code: 500 |
test Job Exception No Such Job | Passed | - |
test Job Creation Inputs | Passed | - |
test Job Creation Input Ref | Skipped | No input with href detected. |
test Job Creation Request | Passed | - |
test Process Success | Passed | - |
test Job Op | Passed | - |
test Process Exception No Such Process | Passed | - |
test Job Results | Failed | body: Type expected ‘string’, found ‘object’. (code: 1027) (…) |
test Job Results Failed | Failed | body: Field ‘type’ is required. (code: 1026) From: body.<required> |
test Job Success | Passed | - |
test Process List Success | Passed | - |
landing Page Validation | Passed | - |
test Process | Passed | - |
test Job Creation Success Async | Passed | - |
test Job Creation Input Array | Failed | Not implemented yet. |
test Pl Links | Passed | - |
test Job Creation Input Inline Mixed | Failed | Not implemented yet. |
test Job Creation Auto Execution Mode | Passed | - |
test Job Creation Input Validation | Failed | expected <br>[400] but found <br>[200] |
test Job Creation Default Outputs | Passed | - |
test Pl Limit Response | Passed | - |
test Job Creation Sync Document | Passed | - |
test Job Results Async Raw Ref | Passed | - |
test Job Creation Input Inline Bbox | Passed | - |
test Job Creation Input Inline Object | Passed | - |
test Process List | Passed | - |
test Job Results Async Raw Value One | Failed | Java exception |
test Job Results Async Raw Mixed Multi | Failed | Not implemented yet. |
test Job Creation Sync Raw Value Multi | Failed | Not implemented yet. |
test Job Results Async Raw Value Multi | Failed | Not implemented yet. |
test Pl Limit Definition | Passed | - |
landing Page Retrieval | Passed | - |
test Job Creation Sync Raw Ref | Failed | Not implemented yet. |
test Job Creation Default Execution Mode | Passed | - |
test Job Creation Op | Passed | - |
4.1.2. Recommendations
The TestNG framework works well with the executable test suite for the OGC API — Processes — Part 1: Core. Except for the validation issue for the result schema no critical issues were detected. The OpenAPI4J library reliably validates the JSON requests/responses.
OGC API — Processes — Part 1: Core consists of several conformance classes with currently 44 tests. The tests are listed directly beneath each other. This way, it can be hard to get an overview of the passing/failing tests. Thus, a possibility for better structuring of the tests is recommended.
The creation of new tests requires to execute the test repeatedly. Currently, single tests cannot be run, only the complete test suite, which can take a considerable amount of time. It is therefore recommended to investigate how single tests can be run.
A large number of execute requests are sent to the implementation under test to evaluate various combinations of parameters. It is recommended to investigate whether responses to execute requests can be reused to cover different test cases.
A number of the tests that fail seem to be a cascaded effect of the fact that the TestNG-based ETS does not recognize the specification relation types. For example, the test “landing Page Validation” fails because the ETS is looking for a link with relation “processes” but the correct link relation according to the specification is “http://www.opengis.net/def/rel/ogc/1.0/processes”. The ETS should be modified to address this. The problem has been reported in the GitHub Issues log.
The TestNG-based ETS does not seem to recognize the content type application/problem+json as a valid content type for an exception response. The OGC API — Processes specification, however, cites RFC 7807 where it specifies this as the correct MIME type for error report. A GitHub issue has been recorded for implementing support for the MIME type specified in RFC 7807.
Improve feedback to the users. Good feedback enables a pseudo-interactive engagement with the OGC Validator supporting incremental refinement of the server being tested. The feedback should include the headers passed to the server, the URL that was accessed, and the content of the body sent to the server under test, if applicable. It is recommended to include this level of feedback on the TestNG-based ETS.
5. Alternative Test Environment
An alternative test environment based on the ETF test framework was used to validate implementations towards OGC standards, in particular focusing on the new OGC API standards. The standard selected was OGC API — Process.
5.1. ETF test framework
The ETF test framework is an open-source application framework that can be used by the tester to execute tests through a web interface. The ETF uses a modular software-architecture and is designed to deliver user-friendly, self-explanatory test reports.
It is successfully used as a basis for the European INSPIRE Validator and in several projects for German mapping agencies.
5.2. NeoTL DSL
For web service testing, ETF has leveraged SoapUI[https://www.soapui.org/], but for various reasons a new solution was evaluated in 2020. A new ETF test driver for geoservice and Web API testing was implemented in a prototype based on a new domain specific language (DSL). The DSL was named NeoTL.
The goal was to simplify the definition of tests with the DSL as much as possible and thus make it maintainable and accessible to subject matter experts without knowledge of a specific programming language. Language concepts were adapted for Testbed 17 and the special requirements for creating OGC API Processes tests.
To lower the entry barrier cloud-based tool support was leveraged. The test cases were developed in the browser, a local installation was not required.
Another goal was to simplify the communication between the various experts; the SWG members, test authors and implementers by using a DSL.
5.3. Comparison with CTL
Prior to 2014, executable test suites in the OGC Validator used the OGC Compliance Test Language (CTL). Due to limitations of CTL, since 2014 all new executable test suites developed for the OGC Validator are built using the TestNG framework instead of CTL. This section presents a comparison between CTL and NeoTL, however, it should be noted that CTL is a legacy technology that is no longer used to develop new executable test suites in the OGC Compliance Program.
Domain Specific Languages are distinguished between internal and external DSLs.
Examples of internal DSL include domain-specific UML profiles, domain-specific XML Schema, the Gradle DSL of the Gradle build tool and also the CTL.
Internal DSL essentially use the language concepts of their host language. With Gradle these language concepts are based on Groovy[https://groovy-lang.org/], with CTL the concepts are based on XML elements and various XML schema. This means that the grammar is restricted to the syntax of the host language and it adopts all the nice but also the less pleasant syntactic features, as the following CTL test illustrates:
<test name="wfs:wfs-1.1.0-Basic-GetCapabilities-tc1">
<param name="wfs.GetCapabilities.get.url"/>
<assertion>The GET method request must be supported (using HTTP GET).</assertion>
<comment>GetCapabilities by GET. Pass if all of the following conditions are true:
(1) the response is schema valid;
(2) the root document is an wfs:WFS_Capabilities document.
</comment>
<link title="wfs-1.1.0-Basic-GetCapabilities-tc1">http://cite.opengeospatial.org/te2/about/wfs/1.1.0/site/ats-wfs11-basic-cc/GetCapabilities/GET/BasicGetCapabilities-GET-tc1.html</link>
<link>OGC 04-094, 13.1, p.79</link>
<code>
<xsl:variable name="request1">
<request>
<url>
<xsl:value-of select="$wfs.GetCapabilities.get.url"/>
</url>
<method>get</method>
<param name="service">WFS</param>
<param name="version">1.1.0</param>
<param name="request">GetCapabilities</param>
<p:XMLValidatingParser.GMLSF1/>
</request>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($request1/*)">
<ctl:message>FAILURE: Missing or invalid response entity.</ctl:message>
<ctl:fail/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="expression">//wfs:WFS_Capabilities</xsl:variable>
<ctl:call-test name="ctl:assert-xpath">
<ctl:with-param name="expr" select="$expression"/>
<ctl:with-param name="doc" select="$request1"/>
</ctl:call-test>
</xsl:otherwise>
</xsl:choose>
</code>
</test>
Figure 4 — CTL test case example
An external DSL is a language that’s parsed independently of the host general purpose language. For example, regular expressions and CSS. The concrete syntax and the semantics are freely defined. This means that external DSLs can be more flexible and expressive. The CTL example would look something like this in NeoTL (the Request definition is externalized and referenced):
TestCase "The GET method request must be supported (using HTTP GET)" {
id: wfs.1.1.0.Basic-GetCapabilities-tc1
description: "GetCapabilities by GET. Pass if all of the following
conditions are true:
(1) the response is schema valid;
(2) the root document is an wfs:WFS_Capabilities document."
references:
- "Abstract Test Case wfs-1.1.0-Basic-GetCapabilities-atc3, p.79"
"https://portal.ogc.org/files/?artifact_id=8339"
AbstractTestCase
ValidationStep "GetCapabilities with GET method" {
id: step
description: "GetCapabilities with GET method and validate response against
GMLSF1 schema"
given:
- Service is "WFS 1.1.0"
when: Request requests.wfs1.GetCapabilities executed
then:
- Assert XPath {
/wfs:WFS_Capabilities/* exists
}
- Assert XmlSchema {
schema "http://schemas.opengis.net/wfs/1.1.3/wfs.xsd"
validates
}
}
}
GetRequest "GetCapabilities" {
id: requests.wfs1.GetCapabilities
query:
- "service" = "WFS"
- "version" = "1.1.0"
- "request" = "GetCapabilities"
}
Figure 5 — NeoTL test case example
Furthermore, it is possible to tailor the IDE closely to the language. Thus, it is possible to perform semantic checks in addition to syntactic checks, syntax highlighting and to simplify the implementation of tests for the test developer with several other IDE services. Figure 6 shows the editor with some IDE services like the Outline and the Problem views as well as the syntactically highlighted test definition for an OGC API — Processes test case.