Information systems test combination generation method based on coverage density
Technical Field The present invention relates to an information system test method for automatically generating for example, the method in the given input parameters and parameter values under the condition of, automatic generation of two combined and two covering all of the number of test cases as little as possible. The invention can be widely applied for embedded system test, distributed system test, webpage test, graphical interface test, protocol testing, and the configuration and compatibility test. Background Art Now the computer information system is becoming more and more large and complex, when the test personnel to test an information system, the system may have more input parameters (usually greater than 10), and each of the input parameter there may be a plurality of different value or equivalence partitioning (usually greater than 3). In the information system before put into the market, in order to ensure its quality, it is necessary to fully test it. Combination test technology is widely applied for embedded test, distributed system test, test Web, user interface test, protocol testing, and the fields of configuration and compatibility test. In the test information system the test personnel generally covered by designing the test case the combination of the input parameters, through the implementation of test case and comparing the output result is consistent with the expected results. The most adequate method is to design the covering of the input parameter between test case of all value combination. However, in the actual information system in the test, as the input parameters and an increase in the number of the parameter value, will result in the final test case is the exponential growth of the number. For example, a 10 plurality of input parameters, each input parameter to have 3 a value, if the full covering method, will ultimately produce 310 = 59,049 test case. It is clear that on the premise of the limited budget is generally not possible for the completion of the test task. The test personnel often divided by the equivalence class, boundary value analysis, technical attempt to reduce the number of test example. , For example, for a value or enum types of input parameters, it can be selected within the range of value of the minimum value, maximum value and an intermediate value as a representative. However, this kind of method for testing the extent of reduced example quantity remains limited. In order to solve the whole combination is covered with the amount of test cases in the input parameter number and the number of the parameter value of the exponential growth [...]. The test personnel often two combination coverage of the test generation method, that is, any two of the input parameter combination of each value in the test case must be at least one-time. Practice comparison shows that in the information system through the two in the test combination coverage can effectively find the defect in the of the system to be tested, test the adequacy of the system. For two traditional combination coverage lives the ingredient method is orthogonal experimental design method, need to select the appropriate orthogonal matrix. There are two limiting: its one each input value of the parameter to be equal to the number of; the number and value of the number of specific parameters, appropriate orthogonal matrix does not exist, the need to increase the number of parameter and value. These two restrictions on the number of test for example the increase of the necessary. Content of the invention The invention aims to solve the technical problem that the whole combination coverage test method test example quantity index growth, in the given input parameters and parameter values under the condition of the combination of the basis of the coverage density generating method, the possible test cases covering all of the two combined. To achieve the above object, the present invention provides the coverage density-based information systems test combination generating method comprises the following steps: first of all through the XML file description of the information system to be measured input parameters and parameter value, then the designated test case must occur and must not be the two two combined test case, the two two combined that is, any two of the input parameter combination of each value in the test case must be at least one-time, last-used based on coverage density combined method of generating test case, the format of the XML document to said and the output of the final test case. Based on the coverage density combined method of generating test cases for the process of: reading the XML document through the first input parameters and parameter values is obtained, and then the test case suite TS initialized to the air, according to the parameter table initialization all required to be covered is formed of the combination of two test cases combinations of two Q, must be designated to the user of the test case, the test case is added to the test cases in TS, and from the combination of two test cases of the test case is removed in the Q has been covered by the combination of two; for the user-specified the combination of a certain will not appear, will be directly from the combination of two test case is removed in the Q; if after two combined test cases that have not yet still exist in the Q of the two combined, are based on coverage density algorithm to each of the input parameters of the selected priority value, so as to define a test case, and the test case is added to the test cases in TS, and from the two combined test cases of the test case is removed in the Q of the two combination; and then repeating the previous steps until the two combined test case suite Q is empty. In the above-mentioned process the test case is added one by one, wherein a single test case generation process is as follows :, first in accordance with the parameter table in the order parameter, parameter and its value is read one by one. Successively calculating the value of the input parameter and the coverage density different from the density in the largest value is selected, if there are a plurality of density corresponding to the largest value, a value chosen from, the existing test case in the less the number of times, when all the input parameter value are selected, will ultimately produce a test case. Coverage density is determined using the following steps: a section i k to the parameter value, to calculate first the parameter i all value has not yet been covered by the combination of two the number of testing example totalPairs; taking into account parameters in paragraph i k totalPairs a value capable of covering for testing of the combinations of two uncoveredPairs example quantity ; the calculation process: initialization uncoveredPairs to 0, for a parameter table of the parameters of the each non-i, if the value of the parameter has already been selected, and parameter k i section of a value of the parameter value of a selected two of the two combined is not covered, the add uncoveredPairs 1 ; if the value of the parameter is not selected, to the parameter for each possible value, and the parameter i a clause k with the value of the parameter value combinations of two is not covered by the test case, the add uncoveredPairs 1 ; consider end all non-i parameter, the final calculation parameter i value of the coverage density k δik = uncoveredPairs/totalPairs. The invention to be tested in a given input parameters and information system in the case of the parameter value, can automatically generate all in accordance with the conditions of combinations of two test cases, as little as possible and the number thereof, thereby greatly improving the testing information the efficiency of the system. The invention can be widely applied for embedded system test, distributed system test, webpage test, graphical interface test, protocol testing, and the configuration and compatibility test. The invention has a good augmentability, easy to expand to just cover, covering the bottle, and even mixed-covered case; additional parameters is the constraints and considerations must be covered of the parameter combination; easy to consider parameters of the order of priority between the; combination coverage density calculation method is simple, in order to facilitate a relatively low cost of implementation time and space, and the validity by examples prove that can achieve satisfactory test adequacy. Description of drawings Figure 1 is a combined method work flow chart, Figure 2 is flow chart of combined method program based on coverage density, Figure 3 is program flow chart of determining a single test case, Figure 4 is program flow chart of combined coverage density is calculated, Fig. 5 covers the density calculation example Figure, Figure 6 is a system configuration chart of e-commerce application, Mode of execution The invention can be used in a given input parameters and parameter values under the condition of, the possible covering all of the test cases of the test case combinations of two. Its working procedure as shown in Figure 1: first described by XML documents input parameters and parameter value (or equivalence partition). Then designated test case must occur and must not be the two two combined. Last-used based on coverage density combined method of generating test case, the format of the XML document to said and output. By testing personnel information to be measured for analysis of the specification of the system, can be measured input parameters and parameter of the system may be of value. For example, in an e-commerce application in the simplified version of the system, comprises a client browser, Web server, router, the payment component such as server and a database server, its configuration as shown in Figure 6. As a result of these components can be provided by different manufacturers, therefore, must be configured and compatibility test, in order to confirm the selection of the types of assembly structure information system can obtain higher stability, robustness and reliability. From the configuration angle analysis the system has 5 input parameter: client browser parameter, router parameters, parameters of the payment server, database server Web server parameters and parameter. Wherein the client browser parameters corresponding to 4 possible value: Explorer, Netscape, and Firefox Opera; router parameter can correspond to 4 a value: Cisco, Huawei, ZTE and alfas; payment server parameter can correspond to 3 a value: MasterCard, visa cards and Visa card. Corresponding to the server can Web 4 a value: Apache, JBoss, Weblogic and Websphere. The database server can correspond to 4 a value: Oracle, Sybase, DB/2 and SqlServer. Through the Patent XML documents describe these input parameters and parameter value. The invention may be designated the test cases must occur and must not be the two two combined test case. Traditional combined test the test example generated between the assumed that the parameters often are independent of each other, this in the actual information system test often is not realistic. For example, one of the input parameter may lead to a certain value of the other associated with it a number of value input parameter has no meaning, in fig. 6 in the example shown, the server may be a certain Web does not support some type of database. Therefore, the combined test should be avoided in the test case comprising these combined. The Patent described by additional XML documents will not be the two two combined test case. Furthermore, the test must be designated in advance in the information in the test case, there are important practical significance, the test personnel can be experienced through the product design specification book they are obtained in advance that the test cases is more important, and that in the test of the priority implement these test case time. The XML documents can be described by the additional of the test cases these must appear, and ensure that the test cases are then generated no longer cover the designated test case of the combination of the two. The invention is based on the coverage density by invoking the combining algorithm to generate the test case. The implementation of the algorithm with reproducibility, that is, the input parameters and parameter values under the condition of constant, the final test case is the same, the test personnel can help better management of expected test example and an output result of the test case. The invention generates test case of the algorithm program flow as shown in Figure 2. XML document by reading the first input parameters and parameter value. TS test cases is then initialized to the air, according to the parameter table initialization all required to be covered into two groups of lowering two of the combinations of two Q cases for testing. If the user designated the test case must occur, these tests will be added to the test example in dedicated TS, and in Q removed from these test case has been covered by the combination of two. If the user designated the combination does not occur, then these combined removed directly from the Q. If Q has not yet been covered still exist in the two combined, are based on coverage density algorithm to each of the input parameters of the selected priority value, thereby forming a test case, the test example and the Q in TS removed from the test case covering the two combined. If Q is empty, XML file format to output the final test case suite TS. In the algorithm of the test case is added one by one, determining a single test case of program flowcharts as shown in Figure 3. In accordance with the parameter table in the order parameter, parameter and its value is read one by one. Successively calculating the value of the input parameter and the coverage density different from the density in the largest value is selected. If there are a plurality of density corresponding to the largest value, from a value is selected, the existing test cases at least the number of times of occurrence. When all input parameters are selected after value, will ultimately produce a test case. Algorithm calculating coverage density as the select the current standard of the parameter value. For the current parameter, in the selection of the parameter value with the already selected value taking into account the parameters of the two between the two combined, also consider the non-selected value between two of the parameters of the two combined, thus ensuring that each selection of the test cases as much as possible when the cover of the can has not yet been covered by the combination of two. As shown in Figure 4 the computational process coverage density: the current calculation parameters of a paragraph i k coverage density value; to calculate first the parameters have not yet been covered i of two combined (in other words Q contains parameter i two combined) the number of, stored in variable totalPairs; uncoveredPairs the value of the initialization of variables at the same time 0, a parameter section i k that the value has not yet been covered to be covered of two combined number; of each parameter of the parameter table (not including parameter i), if the value of the parameter has already been selected, section i k and a parameter value of the parameter value with the two combined is not covered over, the add uncoveredPairs 1 ; if the value of the parameter is not selected, to the parameter for each possible value, if a clause i k parameter with the value of the parameter value combinations of two of the is not covered, the add uncoveredPairs 1. The final return of the coverage density δik = uncoveredPairs/totalPairs. Algorithmic process the prior examples. With reference to Figure 5 and table 1, table 2 of example, table 1 is the Figure 5 the input parameters and the corresponding description of its value, table 2 is the current test case has been generated. The current in the computing section 5 the stage of test case, the two input parameters before f1 and f2 have been selected the value of. Needed to next select the next parameter f3 value. First calculation parameter f3 not yet covered the number of combinations of the two: 4 × 3 × 4-4 × 4=32. Against f3 of each value: If the parameter * f3 value v31, its combination coverage density is : (0 + 1 + 2 + 2)/ 32=5/32; If the parameter * f3 value v32, its combination coverage density is : (1 + 0 + 3 + 3)/ 32=7/32; If the parameter * f3 value v33, its combination coverage density is : (1 + 1 + 3 + 3)/ 32=8/32. According to fig. 3 the algorithm described in, parameter f3 selected value for v33. This invention adopts the combination of the actual test of the test method, according to the requirements of the work can be easily extended to higher levels of combined combination coverage 'Sansan' , for example, combination coverage such as bottle. Table 1: input parameter and its value description Table 2: the already determined test cases The tool of this invention is Java language based on XML technology, and, Figure 6 is the combination of the use of the patented process tool interface test generation. With platform-independent Java language, the portability is strong, and the like, through the mounting of the corresponding Java virtual machine, can ensure that the algorithm running on the various types of system platform. XML technology has extensibility, flexibility, and self-descriptive, and the like. By defining the XML document type description (DTD), users can provide consistent with the requirements of the Patent the data description of the method. By using this Patent, the tester can be combined with an output of the described testing example, directly applied to the development of the information system to be tested and the testing SCRIPT code. The present invention discloses a composite generation method based on information system testing for coverage density, which adopts a framework (as shown) that: (1) input parameters and parameter values of information system to be tested are described through XML files according to the specification of the tested system; (2) the testing use cases needed to appear and the testing use cases which cannot appear through combination in pairs are assigned; (3) the values of all the input parameters are combined one by one on the basis of coverage density so as to generate a testing use case; (4) the testing use case finally generated is expressed and output in the format of the XML files. The composite generation method can be widely applied to embedded system testing, distributed system testing, web page testing, graphical interface testing, protocol testing, configuration and compatibility testing, etc., is easy to append constraints among the parameters and consider the parameter combinations needed to be covered, is easy to consider the priority among the parameters, is simple and effective in the calculation method of coverage density, and has good expansibility. 1, based on coverage density of a method for generating information system test combination, which is characterized by comprising the following steps: first of all through the XML file description of the information system to be measured input parameters and parameter value, then the designated test case must occur and must not be the two two combined test case, the two two combined that is, any two of the input parameter combination of each value in the test case must be at least one-time, last-used based on coverage density combined method of generating test case, the format of the XML document to said and the output of the final test case. 2, based on coverage density method for generating information system test combination according to Claim 1, characterized in that the combined method based on coverage density of the process of generating a test case is: first XML document by reading the above-mentioned input parameters and parameter value, the test cases is then initialized to empty (TS), according to the parameter table initialization all required to be covered the two are combined to form two of the combinations of two cases for testing (Q), must be designated to the user of the test case, the test case is added to the test cases in (TS), and from combinations of two cases for testing (Q) have been removed in these test cases covering two combined; for the user-specified the combination of a certain will not appear, will be directly from the combination of two test case (Q) that is removed in the; if after two combined test case suite (Q) has not yet been covered still exist in the two combined, are based on coverage density algorithm to each of the input parameters of the selected priority value, so as to define a test case, and the test case is added to the test cases in (TS), and from the two combined test case suite (Q) in the test case the removal of the two combination; and then repeating the previous steps until the two combined test case suite (Q) is empty. 3, based on coverage density method for generating information system test combination according to Claim 2, is characterized in that a single test case generation process is as follows :, first in accordance with the parameter table in the order parameter, parameter and its value is read one by one. Successively calculating the value of the input parameter and the coverage density different from the density in the largest value is selected, if there are a plurality of density corresponding to the largest value, a value chosen from, the existing test case in the less the number of times, when all the input parameter value are selected, will ultimately produce a test case. 4, based on coverage density method for generating information system test combination according to Claim 3, characterized in that the coverage density is determined using the following steps: a section i k to the parameter value, to calculate first the parameter i all value has not yet been covered by the number of combinations of two totalPairs; taking into account parameters in paragraph i k totalPairs a value capable of covering uncoveredPairs of the number of combinations of two, the calculation process: initialization uncovere dPairs to 0, for a parameter table of the parameters of the each non-i, if the value of the parameter has already been selected, a paragraph i k and parameter with the parameter value a selected value of the two combined is not covered, the add uncoveredPairs 1 ; if the value of the parameter is not selected, to the parameter for each possible value, and the parameter i a clause k with the value of the parameter value combinations of two is not covered by the test case, the add uncoveredPairs 1 ; consider end all non-i parameter, the final calculation parameter i value of the coverage density k δtk = uncoveredPairs/totalPairs. v11 (Explorer) v21 (Cisco) v31 (MasterCard) v41 (Apache) v51 (Oracle) v12 (Netscape) v22 (Huawei) v32 (visa cards) v42 (JBoss) v52 (Sybase) v13 (Firefox) v23 (Chunghsing) v33 (Visa card) v43 (WebLogic) v53 (DB/2) v14 (Opera) v24 (alfas) v44 (WebSphere) v54 (SqlServer) 1 v11 v21 v31 v41 v51 2 v12 v22 v32 v42 v52 3 v13 v23 v33 v43 v53 4 v14 v24 v30 v44 v54 5 v11 v22 --- --- ---