Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of maintaining method and device of test macro, the write method that is intended to solve existing test case is difficult to accurately to find needs to upgrade or the problem of the test case of modification in huge test case library in follow-up maintenance.
The embodiment of the invention is achieved in that a kind of maintaining method of test macro, and described method comprises the steps:
Each functional module of test macro is divided into one or more universal test points according to function point respectively, again described universal test point is split as respectively one or more general refinement items, and sets up the mapping relations between described functional module, universal test point and general refinement item;
Write test case according to described general refinement item, and in every test case, mark out the general refinement item that forms this test case;
When test macro receives the Data Update bag, when definite universal test point that need upgrade or general refinement item, also upgrade to the functional module of correspondence according to the mapping relationship searching between described functional module, universal test point and general refinement item, or find corresponding test case and renewal according to the general refinement item that described each test case marks.
Further, before described each functional module with test macro is divided into a plurality of universal test points according to function point, also comprise step:
Test macro is divided into a plurality of functional modules.
Further, mapping relations between described functional module, universal test point and general refinement item comprise: the corresponding one or more universal test points of functional module, a universal test is put corresponding one or more functional module, the corresponding universal test point of general refinement item.
Further, described functional module, universal test point and general refinement item are named according to default naming method.
Another purpose of the embodiment of the invention is to provide a kind of attending device of test macro, and described device comprises:
Function refinement module is used for each functional module of test macro is divided into one or more universal test points according to function point respectively, more described universal test point is split as respectively one or more general refinement items;
Module is set up in mapping, is used for setting up the mapping relations between described functional module, universal test point and general refinement item;
Test case is write module, is used for writing test case according to described general refinement item, and marks out the general refinement item that forms this test case in every test case;
The demand update module, be used for receiving the Data Update bag when test macro, when definite universal test point that need upgrade or general refinement item, also upgrade to the functional module of correspondence according to the mapping relationship searching between described functional module, universal test point and general refinement item, or find corresponding test case and renewal according to the general refinement item that described each test case marks.
Further, the attending device of described test macro also comprises:
Function is divided module, is used for test macro is divided into a plurality of functional modules.
Further, mapping relations between described functional module, universal test point and general refinement item comprise: the corresponding one or more universal test points of functional module, a universal test is put corresponding one or more functional module, the corresponding universal test point of general refinement item.
Further, described functional module, universal test point and general refinement item are named according to default naming method.
In embodiments of the present invention, owing to make an explanation alternative by definition universal test point functional module, universal test point inside obtains general refinement item by fractionation again, and to the composite design of general refinement item, the complete test case of having got back, so that the functional module on upper strata, and the test case of lower floor has all comprised the information of universal test point and general refinement item, therefore by the retrieval to universal test point and general refinement item, just can carry out indirect control to functional module and test case.In addition, in the renewal and maintenance of follow-up test system version, just can directly find test case to be updated by general refinement item, make refresh test use-case storehouse become simpler, more efficient.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
For technical solutions according to the invention are described, describe below by specific embodiment.
Embodiment one:
Be illustrated in figure 1 as the process flow diagram of the maintaining method of the test macro that first embodiment of the invention provides, for convenience of explanation, only show the part relevant with the embodiment of the invention.
In step S101, test macro is divided into a plurality of functional modules.
In embodiments of the present invention, the test macro that at first will need to test rationally carries out the function division, is divided into a plurality of functional modules.For the ease of differentiating and the locating function module, after finishing, division is each functional module name according to default naming method.Wherein, the default naming method of functional module comprises multiple, as: can describe and the numbering name according to the title of functional module, can be according to title description, marker character and the numbering name etc. of functional module.Then be title description, the marker character according to functional module and number name such as following two template name: module_0013_net and module_0024_playback, wherein " module " is the marker character of functional module, next the 4-digit number after first underscore is the numbering of this functional module, and the title behind second underscore then is that the title of this functional module is described.
In step S102, each functional module of test macro is divided into one or more universal test points according to function point respectively, more described universal test point is split as respectively one or more general refinement items.
In embodiments of the present invention, by analyzing each functional module, determine the inner every function point with relatively independent function of functional module, each functional module is divided into one or more universal test points according to function point.Wherein, universal test point is for having the module of simplifying most of relatively independent function in the test macro.Same, after dividing complete universal test point, for each universal test point is named according to default naming method, the default naming method of the universal test point at this place also comprises multiple, yet in order to keep the consistance of test macro, universal test point adopts same default naming method name with functional module, in step S101, illustrate functional module according to title description, marker character and the numbering name of functional module, then universal test point is also named according to title description, marker character and the numbering of universal test point herein.As: point_0166_ip, point_0263_sata, point_0296_vga etc., wherein " point " is the marker character of universal test point, next the 4-digit number after first underscore is the numbering of this universal test point, and the title behind second underscore then is the title description of this universal test point.
In embodiments of the present invention, after universal test point is finished in division and name, each universal test point is carried out inside split, be divided into respectively one or more general refinement items.Wherein, the component parts of the universal test point under the general refinement Xiang Weiqi, but it can't segment on the aspect of function division again, is equal to every attribute of class in Object-Oriented Programming Language.Subsequently, again each general refinement item is named according to default naming method, the default naming method of general refinement item also comprises multiple, in order to keep the consistance of test macro, general refinement item and universal test point and functional module all adopt same default naming method name, still take the naming method in step S101 as example, then general refinement item is also named according to title description, marker character and the numbering of general refinement item herein.As: item_0011_ip, item_0033_ip, item_0026_sata etc., wherein " item " is the marker character of general refinement item, next the 4-digit number after first underscore be this general refinement item in the inner numbering of affiliated universal test point, the title after second underscore then is the title description of the universal test point under this general refinement item.
In embodiments of the present invention, the naming method of functional module, universal test point and general refinement item is multiple in addition, not with the above-mentioned limit that is exemplified as.
In step S103, set up the mapping relations between functional module, universal test point and general refinement item.
In embodiments of the present invention, after functional module, universal test point and the division of general refinement item are complete, fractionation situation according to universal test point in each functional module and general refinement item, set up the mapping relations between functional module, universal test point and general refinement item, and set up mapping table according to the mapping relations between functional module, universal test point and general refinement item.
In embodiments of the present invention, because a functional module is divided into one or more universal test points according to function point, so the corresponding one or more universal test points of functional module; And universal test point is for having the module of simplifying most of relatively independent function in the test macro, thereby a universal test point may belong to different functional modules, and a universal test is put corresponding one or more functional module; To be again that each universal test point is inner split out general refinement item, thereby a general refinement item only can belong to a universal test point, then the corresponding universal test point of general refinement item.
In step S104, write test case according to general refinement item, and in every test case, mark out the general refinement item that forms this test case.
In embodiments of the present invention, all general refinement items are come composite design according to the use-case general design method, write test case.Wherein, the use-case general design method comprises multiple, such as use-case methods for designing such as equivalence class partitioning, boundary values, cause-and-effect diagram method, error guessings, can adopt any means to come to write test case according to general refinement item behind the general refinement item of composite design herein.And according to the combined situation of general refinement item, for every test case item is write test case, and in every test case, mark out the general refinement item that forms this test case.
In embodiments of the present invention, the execution sequence of step S103 and step S104 is not limit, both can first execution in step S103 execution in step S104 again, also can first execution in step S104 execution in step S103 again.
In step S105, when test macro receives the Data Update bag, need to determine universal test point or the general refinement item of renewal, also upgrade to the functional module of correspondence according to the mapping relationship searching between functional module, universal test point and general refinement item, or find corresponding test case and renewal according to the general refinement item that each test case marks.
In embodiments of the present invention, when test macro need to upgrade, test macro received the Data Update bag, according to the content (such as the code of data update package) of this Data Update bag just need to determine the universal test point or the general refinement item that upgrade.At this moment, then also upgrade to corresponding functional module according to the mapping relationship searching between functional module, universal test point and the general refinement item set up, the general refinement item that perhaps marks according to each test case finds corresponding test case and upgrades.
Be specially, the Data Update bag that receives when test macro is when needing renewal or newly-increased universal test point,, upgrade or newly-increased universal test point in the functional module of correspondence to corresponding functional module according to the mapping relationship searching between functional module, universal test point and general refinement item; The Data Update bag that receives when test macro is that the general refinement item that marks by each test case finds corresponding test case when needing renewal or newly-increased general refinement item, upgrades in the test case of correspondence or newly-increased general refinement item.
For example, the Data Update bag that receives when test macro is when increasing universal test point newly, according to the functional module of the mapping relationship searching between functional module, universal test point and general refinement item to correspondence, newly-increased universal test point in the functional module of correspondence, and after naming according to default naming method for this universal test point, this universal test point is carried out inside splits, be divided into respectively one or more general refinement items, and again to each general refinement item according to the described processing of step S104; The Data Update bag that receives when test macro is when increasing general refinement item newly in universal test point, then according to the naming method of universal test point, the title that need is increased newly the universal test point of general refinement item is described as all the universal test points in the keyword search test case library, find corresponding universal test point and increase therein general refinement item newly, and find corresponding test case according to the general refinement item that each test case marks, carry out the increase of test case; The Data Update bag that receives when test macro is when revising general refinement item in universal test point, then according to the naming method of universal test point, the title of the general refinement item that need are revised is described as all the general refinement items in the keyword search test case library, finding out corresponding general refinement item makes amendment, the general refinement item that marks according to each test case again finds corresponding test case, revises this test case.
In embodiments of the present invention, the test case that the test case of writing according to general refinement item both can have been upgraded or revise according to the described method of step S105 also can be carried out testing authentication to these test cases.
In embodiments of the present invention, owing to make an explanation alternative by definition universal test point functional module, universal test point inside obtains general refinement item by fractionation again, and to the composite design of general refinement item, the complete test case of having got back, so that the functional module on upper strata, and the test case of lower floor has all comprised the information of universal test point and general refinement item, therefore by the retrieval to universal test point and general refinement item, just can carry out indirect control to functional module and test case.In addition, in the renewal and maintenance of follow-up test system version, just can directly find test case to be updated by general refinement item, make refresh test use-case storehouse become simpler, more efficient.
Embodiment two:
The attending device structural representation of the test macro that Fig. 2 provides for the embodiment of the invention for convenience of explanation, only shows the part relevant with the embodiment of the invention.This device can be to be built in the unit that software unit, hardware cell or software and hardware in the equipment such as mobile phone, televisor combine, and perhaps is integrated in the application system of these equipment or equipment as suspension member independently.Wherein:
Function is divided module 21, is used for test macro is divided into a plurality of functional modules.
Function refinement module 22 is used for each functional module of test macro is divided into one or more universal test points according to function point respectively, more described universal test point is split as respectively one or more general refinement items.
In embodiments of the present invention, functional module, universal test point and general refinement item are named according to default naming method, and concrete naming method is described at above-mentioned instructions, repeats no more.
Module 23 is set up in mapping, is used for setting up the mapping relations between functional module, universal test point and general refinement item.
In embodiments of the present invention, because a functional module is divided into one or more universal test points according to function point, so the corresponding one or more universal test points of functional module; And universal test point is for having the module of simplifying most of relatively independent function in the test macro, thereby a universal test point may belong to different functional modules, and a universal test is put corresponding one or more functional module; To be again that each universal test point is inner split out general refinement item, thereby a general refinement item only can belong to a universal test point, then the corresponding universal test point of general refinement item.
Test case is write module 24, is used for writing test case according to general refinement item, and marks out the general refinement item that forms this test case in every test case.
Demand update module 25, be used for receiving the Data Update bag when test macro, when definite universal test point that need upgrade or general refinement item, also upgrade to the functional module of correspondence according to the mapping relationship searching between functional module, universal test point and general refinement item, or find corresponding test case and renewal according to the general refinement item that each test case marks.
In embodiments of the present invention, owing to make an explanation alternative by definition universal test point functional module, universal test point inside obtains general refinement item by fractionation again, and to the composite design of general refinement item, the complete test case of having got back, so that the functional module on upper strata, and the test case of lower floor has all comprised the information of universal test point and general refinement item, therefore by the retrieval to universal test point and general refinement item, just can carry out indirect control to functional module and test case.In addition, in the renewal and maintenance of follow-up test system version, just can directly find test case to be updated by general refinement item, make refresh test use-case storehouse become simpler, more efficient.
One of ordinary skill in the art will appreciate that, realize that all or part of step in above-described embodiment method is to come the relevant hardware of instruction to finish by program, described program can be in being stored in a computer read/write memory medium, and described storage medium can be ROM/RAM, disk, CD etc.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.