5 RealizationTop4.4 Development Guidelines in OpenLayers4.5 Test Methods



4.5 Test Methods

4.5.1 Component Tests

Component tests support the development process of the planned extension. For this purpose, the Test.AnotherWay framework used by OpenLayers will be applied (see Section 3.4.3). The purpose of the unit tests is to verify the soundness of all functions and classes, and to serve as part of the quality assurance process. The intention is a test first development, with the component tests created alongside the actual source text.

During the compilation of unit tests for the animated zooming feature the special nature of the automatic zoom animation needs to be taken into account: in order to achieve automatic animation, a time-dependent component which directs this process is required in the API source code. The JavaScript function window.setInterval ensures a constantly recurring infinite cyclical execution of a particular function along with interconnected breaks. This function can be interrupted with window.clearInterval. To test these asynchronous function commands in the source code with component tests, Test.AnotherWay offers the method delay_call which supports two arguments: the waiting period between function commands in seconds, and the executable function. If a time is not indicated, a time delay of .2 seconds applies. For a successful testing procedure, the sample test function of Listing 3.4.3 has to be modified for the zoom animation as follows:

Listing: Sample test function taking into account asynchronous function commands

            t.delay_call(1, function() 
            t.eq( map.getZoom(), 5, "map.zoom is correct after calling zoomTo" );

4.5.2 Integration Tests

After the component tests are complete, as a quality assurance measure integration tests are used to check the interaction of numerous (tested) unit components. A test plan describes the action of selected test cases, which are carried out after the implementation has been completed. The plan is divided into different test suites to achieve a logical division of the functions to be tested. Each test suite can be carried out separately. It is divided into different working steps (test cases) and expected results, which are checked during the implementation of the test cases. If a result deviates from an expected performance, the test suite will fail.

A test plan for the animated zooming extension is developed on the basis of the requirements analysis (see Section 3.3). A complete listing of all possible scenarios which could apply for the use of the feature would be too extensive for the purposes of this thesis. Accordingly, the test plan focuses on the typical and extreme cases of zoom performance. Application functionalities which are independent of the implemented feature are not considered in the test plan. They are verified as part of the component tests and ideally should not be impaired by the implementation. To ensure comparability of the tests, they are carried out with the OpenLayers demo controls.html. For each test the tester documents the date, operating system, browser, name of tester, test duration and applicable comments.

The complete test plan for the animated zooming and panning extensions can be found in Appendix 6.3 . The animated panning was included in the tesplan because at the time of conceptualization and implementation the review process by the OpenLayers developers had not yet been completed. For this reason, a separate quality assurance process was carried out to verify the correctness of the extension.

Note: Once the implemention was complete, the plan was updated in view of actually implemented criteria, which led to an expanded version of the test plan. A more detailed discussion of the implementation and the associated updates to the test plan follows in the next chapter.

© June 1, 2007 | Emanuel Schütze | some rights reserved.
This work is licensed under the Creative Commons License Attribution-ShareAlike 2.0 Germany.

5 RealizationTop4.4 Development Guidelines in OpenLayers4.5 Test MethodsContentsGerman