Research on Irregular Field Area Measurements Metamorphosis Testing Method

Aiming at the problem that it difficult to judge the correctness of the testing output during the area measurement testing, this paper purposes applying metamorphosis testing to terrain measurement software which shows its good effect. Taking the metamorphosis testing for irregular field area in terrain measurement software as application background, an improved area measurement is proposed. On the basis of this algorithm, the relation of metamorphosis and the criterion of judgment are constructed, and the experimental verification is carried out by metamorphosis relation for area division. Keywords-programming teaching methods; SPOC; mixed learning I. BACKGROUND Area measurement is one of the important functions of terrain measurement. Its function is to calculate the area of the selected area on the map. Usually, the area to be calculated is an irregular figure and it’s hard for tester to find an existing math formula to get an expected output. If the formula used by the algorithm is applied, the computational workload will increase dramatically, and there are limited use cases can be examined so that the testing adequacy is difficult to guarantee. Area measurement is used to implement the terrain quantification analyzing function which is hard for manually implementation. This kind of program is belong to the category described as Programs which were written to determine the answer. If the correct answer were known, there would have been no need to write the program by Weyuker[1]. Obviously, area measurement program belongs to non-testable programs described by Weyuker, which exist testing decision problem. II. METAMORPHOSIS TESTING In order to solve the testing decision problem, Chan has proposed a software metamorphosis testing method based on metamorphosis relation[2]. By reusing the test cases, the method verifies whether or not the outputs of multiple use cases satisfies the relational attribute that the software program must satisfy, and this type of relation attribute is called metamorphosis relation. Based on the raw data, the testing method take pre-extracted metamorphosis relation as judgement criterion. When the input satisfies certain requirements, the checking module will check whether or not the output satisfy the metamorphosis relation. If it doesn’t satisfy the relation, it is said there are some flaws in the software. Definition: Metamorphosis Relation(MR) refers to the relation satisfied by different inputs and corresponding outputs with different testing programs. That is to say, the attributes that a program must satisfy is called a metamorphosis relation. Metamorphosis relation is the core of execution result of metamorphosis testing, and its quality directly affects the validity of the testing. The relation can be of any necessary one, including but not restricted to identical relation, neither limited to single execution. Sometimes metamorphosis relation may relate to the relationship between multiple execution results. Assume that the program P is used to implement the function , , , . , (n>1) are different input variables of f, the corresponding outputs are ( ), ( ), . , ( ). If the inputs , , . , satisfy the relation r and the outputs ( ), ( ), . , ( ) can be deduced to satisfy the relation rf, that is: ( , , . , ) ⇒ ( ( ), ( ), . , ( )) (1) ( , )is called the metamorphosis relation of P. As a result, if program P is correct it must satisfy the derivation (2-2): ( , , . , ) ⇒ ( ( ), ( ), . , ( )) (2) If the designed test case does not run up to the upper model, the assumption is incorrect and the program is wrong. The metamorphosis relation is the core of the execution of the metamorphosis test, and its quality directly affects the validity of the testing. For different software tested, the software metamorphosis relation is usually more than one should be satisfy with. If = ( , ) is the i-th metamorphosis relation of program P, then = ( , , . , ) is metamorphosis relation set of P. The main process of software metamorphosis testing is shown in Fig. 1. 2nd International Conference on Automation, Mechanical and Electrical Engineering (AMEE 2017) Copyright © 2017, the Authors. Published by Atlantis Press. This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/). Advances in Engineering, volume 87