CN110413506A - Test case recommended method, device, equipment and storage medium - Google Patents

Test case recommended method, device, equipment and storage medium Download PDF

Info

Publication number
CN110413506A
CN110413506A CN201910541819.1A CN201910541819A CN110413506A CN 110413506 A CN110413506 A CN 110413506A CN 201910541819 A CN201910541819 A CN 201910541819A CN 110413506 A CN110413506 A CN 110413506A
Authority
CN
China
Prior art keywords
code
case
test case
target detection
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910541819.1A
Other languages
Chinese (zh)
Other versions
CN110413506B (en
Inventor
杨小彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910541819.1A priority Critical patent/CN110413506B/en
Publication of CN110413506A publication Critical patent/CN110413506A/en
Application granted granted Critical
Publication of CN110413506B publication Critical patent/CN110413506B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to software tests, a kind of test case recommended method, device, equipment and storage medium are disclosed, this method includes reading the corresponding current version code of application program to be measured and last revision code, compares the change code between tool two edition codes of acquisition by version;Performance objective test case and the operation information for obtaining current version code in use-case implementation procedure;Target detection use-case is read from operation information to the code coverage information of change code, and judge target detection use-case whether as recommendation test case, due to being first determining change code, then code coverage detection is carried out to change code by the corresponding target detection use-case of last revision code, determine whether target detection use-case can be by as recommendation test case further according to testing result, so as to after system source code changes, accurately judge whether currently used test case meets actual test demand, reduce the workload of exploitation tester.

Description

Test case recommended method, device, equipment and storage medium
Technical field
The present invention relates to software testing technology field more particularly to a kind of test case recommended method, device, equipment and deposit Storage media.
Background technique
With the rapid development that computer software technology is tested, software test referent is more and more, corresponding survey Example on probation and testing tool are also more and more abundant.Under normal conditions, developer can be according to actual business demand to tested The source code of system carries out additions and deletions and the updates operation such as changes (such as adding line in function, modify row or delete and go, or in class Increase function or delete function), when code variations are smaller, previously used test case tends to continue to use;But the present age When code changes excessive, if testing still through currently used test case updated system, survey may result in Test result inaccuracy.
It is after then being executed according to use-case by the corresponding test case of the entire source code of execution mostly for above situation Code coverage situation determine that can currently used test case continue to use, due to test process itself workload compared with Greatly, so executing the corresponding test case of entire source code will lead to testing efficiency reduction, and existing this mode lacks Specific aim cannot accurately know currently used test case to the coverage condition of change code.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of test case recommended method, device, equipment and storage medium, purports It is solving in the prior art after system source code changes, is being unable to judge accurately whether currently used test case meets The technical issues of actual test demand.
To achieve the above object, it the present invention provides a kind of test case recommended method, the described method comprises the following steps:
The corresponding current version code of application program to be measured and last revision code are read, work is compared by preset version Tool obtains the change code between the current version code and the last revision code;
Performance objective test case, and obtain the fortune of current version code described in the target detection use-case implementation procedure Row information;
The target detection use-case is read from the operation information to the code coverage information of the change code, and root Judge the target detection use-case whether as recommendation test case according to the code coverage information.
Preferably,
It is described to obtain the corresponding start context of the last revision code, target detection is obtained according to the start context and is used The step of example, comprising:
The corresponding start context of the last revision code is obtained, the start context includes first kind number and second Type number;
The first kind is searched in the mapping relations constructed in advance and numbers corresponding test use cases, and according to described Second Type number filters out target detection use-case from test case concentration.
Preferably, it is described read from the operation information target detection use-case to it is described change code code cover Lid information judges the step of whether the target detection use-case is as test case is recommended, packet according to the code coverage information It includes:
Read from the operation information target detection use-case to it is described change code code coverage information, it is described Code coverage information includes code coverage;
Detect whether the code coverage is higher than preset threshold;
If being higher than, the target detection is used if being lower than using the target detection use-case as recommendation test case Example is used as non-recommended test case.
Preferably, described using the target detection use-case as after the step of non-recommended test case, the method is also Include:
The non-recommended test case is concentrated from the test case and is deleted, to obtain alternative test use cases;
The alternative test case that the alternative test use cases are included is executed, and obtains each alternative test case and is executing In the process to the code coverage of the change code;
Recommendation test case is filtered out from the alternative test case concentration according to the code coverage got.
Preferably, the code coverage that the basis is got filters out recommendation test from the alternative test case concentration The step of use-case, comprising:
The code coverage got is ranked up according to sequence from high to low, first will be sorted according to ranking results Code coverage as target coverage rate;
Using the corresponding alternative test case of the target coverage rate as recommendation test case.
Preferably, described to judge the target detection use-case whether as recommendation test use according to the code coverage information After the step of example, the method also includes:
The corresponding method of the change code is read from the operation information and executes link, and chain is executed according to the method Road determines the corresponding association code of the change code;
According to searching the corresponding pass of the association code in the relationship maps between the code and test case constructed in advance Join test case;
It is surveyed using the association test case and the recommendation test case as the corresponding standard of the current version code Example on probation is recommended.
Preferably, the corresponding method of the change code that reads from the operation information executes link, according to institute It states method and executes the step of link determines the change code corresponding association code, comprising:
The corresponding method of the change code is read from the operation information executes link;
Link, which is executed, according to the method determines current ink node and the current chain belonging to the change code The upstream node and downstream node of circuit node;
The corresponding marking code of the upstream node and the corresponding marking code of the downstream node are obtained respectively;
Corresponding code file, and the code file that will be found are searched from database according to the marking code got As the corresponding association code of the change code.
In addition, to achieve the above object, the present invention also proposes a kind of test case recommendation apparatus, described device includes:
Code comparison module, for reading the corresponding current version code of application program to be measured and last revision code, Tool, which is compared, by preset version obtains the change code between the current version code and the last revision code;
Use-case execution module, for obtaining the corresponding start context of the last revision code, according to the start context Obtain target detection use-case, and execute the target detection use-case with obtain described in the target detection use-case implementation procedure when The operation information of preceding edition code;
Use-case recommending module, for reading the target detection use-case from the operation information to the change code Code coverage information, and judge the target detection use-case whether as recommendation test case according to the code coverage information.
In addition, to achieve the above object, the present invention also proposes a kind of test case recommendation apparatus, the equipment includes: to deposit Reservoir, processor and it is stored in the test case recommended program that can be run on the memory and on the processor, it is described Test case recommended program is arranged for carrying out the step of test case recommended method as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, test is stored on the storage medium Use-case recommended program, the test case recommended program realize test case recommendation side as described above when being executed by processor The step of method.
The present invention is by reading the corresponding current version code of application program to be measured and last revision code, by preset Version comparison tool obtains the change code between the current version code and last revision code;Obtain the last revision The corresponding start context of code obtains target detection use-case according to start context, and performance objective test case simultaneously obtains target survey The operation information of current version code in example implementation procedure on probation;Target detection use-case is read from operation information to change code Code coverage information, and according to code coverage information judge target detection use-case whether as recommend test case, due to being Tool is compared by version and first determines change code, then by the corresponding target detection use-case of last revision code to change generation Code carries out code coverage detection, determines whether target detection use-case can be used as recommendation test further according to testing result Example, so as to accurately judge whether currently used test case meets practical survey after system source code changes Examination demand reduces the workload of exploitation tester.
Detailed description of the invention
Fig. 1 is the structural representation of the test case recommendation apparatus for the hardware running environment that the embodiment of the present invention is related to Figure;
Fig. 2 is the flow diagram of test case recommended method first embodiment of the present invention;
Fig. 3 is the flow diagram of test case recommended method second embodiment of the present invention;
Fig. 4 is the flow diagram of test case recommended method 3rd embodiment of the present invention;
Fig. 5 is the structural block diagram of test case recommendation apparatus first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the test case recommendation apparatus structure for the hardware running environment that the embodiment of the present invention is related to Schematic diagram.
As shown in Figure 1, the test case recommendation apparatus may include: processor 1001, such as central processing unit (Central Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display Shield (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include that the wired of standard connects Mouth, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as Wireless Fidelity (WIreless-FIdelity, WI-FI) interface).Memory 1005 can be the random access memory (Random of high speed Access Memory, RAM) memory, be also possible to stable nonvolatile memory (Non-Volatile Memory, ), such as magnetic disk storage NVM.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 does not constitute the limit to test case recommendation apparatus It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, data storage mould in a kind of memory 1005 of storage medium Block, network communication module, Subscriber Interface Module SIM and test case recommended program.
In test case recommendation apparatus shown in Fig. 1, network interface 1004 is mainly used for being counted with network server According to communication;User interface 1003 is mainly used for carrying out data interaction with user;Processing in test case recommendation apparatus of the present invention Device 1001, memory 1005 can be set in test case recommendation apparatus, and the test case recommendation apparatus passes through processor The test case recommended program stored in 1001 calling memories 1005, and execute test case provided in an embodiment of the present invention and push away Recommend method.
The embodiment of the invention provides a kind of test case recommended methods, and referring to Fig. 2, Fig. 2 is that test case of the present invention pushes away Recommend the flow diagram of method first embodiment.
In the present embodiment, the test case recommended method the following steps are included:
Step S10: the corresponding current version code of application program to be measured and last revision code are read, preset version is passed through This comparison tool obtains the change code between the current version code and the last revision code;
It should be noted that the executing subject of the present embodiment method can be with data processing, program operation and net Network communication function, such as PC, laptop can be used in the calculating service equipment of software test and (hereinafter referred to as survey Try host).The preset version compares tool, i.e. git version comparison tool (a kind of distributed version control tool of open source), The code that the comparison tool of git version described in the present embodiment can carry out different editions compares, and carries out to the place having differences Label or mark, for example, git version comparison tool can provide the lines of code and specifying information that each additions and deletions change.
In the concrete realization, test host can obtain the corresponding current version code of application program to be measured and last revision Then code calls preset git version comparison tool that the current version code and last revision code is compared, thus That a part change code changed between the code of different editions is determined according to comparison result.
Step S20: obtaining the corresponding start context of the last revision code, obtains target according to the start context and surveys Example on probation, and execute the target detection use-case, with and obtain current version described in the target detection use-case implementation procedure The operation information of code;
It should be understood that the exploitation of project is often iterative development, and developer is frequently necessary in software project development Check the code of previous version.The code file of different editions is quickly identified for the ease of developer, it usually needs to difference The software code of version configures corresponding software version number.Under normal circumstances, software version number is made of four parts, first part For major version number, second part is secondary version number, and Part III is revision number, and Part IV is date version number plus Greece Alphabetical version number.By taking version number " 1.1.1.20180808_beta " as an example, " wherein, 1.1.1 " is respectively " key plate from left to right This number secondary version number revision number ", " 20180808 " are date version number, and " beta " is Greek alphabet version number.
It will be appreciated that the test of a software project usually possesses numerous test environment, each test environment is made Test case and the software version being directed to are different from.To guarantee that journey can be applied by be measured in testing efficiency the present embodiment The software version number of sequence is associated with corresponding test case, and to test, host is subsequent can quickly to obtain current code The corresponding target detection use-case of version.Specifically, can be by " the major version number secondary version number revision version in software version number Number " numbered as the first kind, then establish the mapping relations between first kind number and test use cases;It will " the date Version number and/or Greek alphabet version number " is as the key character for concentrating screening target detection use-case from test case, to realize Accurate acquisition to target detection use-case.
It should be noted that in order to detect code change after the corresponding test case of last revision code whether still be able to it is suitable (code coverage i.e. with higher) is tested to current version code in sharp ground, before executing this step, tests host Also will acquire the corresponding start context of the last revision code, (start context includes first kind number and Second Type Number), the first kind is then searched in the mapping relations constructed in advance and numbers corresponding test use cases, and according to institute It states Second Type number and filters out target detection use-case from test case concentration.
In the concrete realization, test host, can be according to described after getting the corresponding start context of last revision code Start context obtains target detection use-case, then executes the target detection use-case, and obtains the target detection use-case and execute The operation information of the current version code in the process.
Step S30: the target detection use-case is read from the operation information to the code coverage of the change code Information, and judge the target detection use-case whether as recommendation test case according to the code coverage information.
It should be noted that testing host in the present embodiment may call upon open source during performance objective test case Java code coverage rate tool " jacoco " mark the code situation of tested use-case covering in real time, and call jvm Monitoring tools are monitored and are recorded in real time come the operating condition to current version code, corresponding to obtain current version code Operation information.
In the concrete realization, the operation of host current version code in getting target detection use-case implementation procedure is tested After information, target detection use-case can be read from operation information to code coverage information (the mainly code coverage of change code Rate), and judge target detection use-case whether as recommendation test case according to code coverage information.Wherein, the recommendation test Can use-case, i.e., the described target detection use-case continue to be used as the corresponding use-case of current version code, if can if belong to and push away Recommend test case, if cannot if belong to non-recommended test case.
The present embodiment is by reading the corresponding current version code of application program to be measured and last revision code, by pre- It sets version comparison tool and obtains change code between the current version code and last revision code;Obtain described upper one edition The corresponding start context of this code obtains target detection use-case according to start context, and performance objective test case simultaneously obtains target The operation information of current version code in test case implementation procedure;Target detection use-case is read from operation information to change generation The code coverage information of code, and judge whether target detection use-case is used as according to code coverage information and recommend test case, due to It is to compare tool by version first to determine change code, then by the corresponding target detection use-case of last revision code to change Code carries out code coverage detection, determines whether target detection use-case can be used as recommendation test further according to testing result Example, so as to accurately judge whether currently used test case meets practical survey after system source code changes Examination demand reduces the workload of exploitation tester.
With reference to Fig. 3, Fig. 3 is the flow diagram of test case recommended method second embodiment of the present invention.
Based on above-mentioned first embodiment, in the present embodiment, the step S30 includes:
Step S301: the target detection use-case is read from the operation information to the code coverage of the change code Information, the code coverage information includes code coverage;
It should be noted that code coverage information described in the present embodiment mainly includes code coverage, so-called code covers Lid rate is also referred to as code coverage (Code coverage), it is one of software test measurement, and it is tested to describe source code in program The ratio and degree of examination.Code coverage is high, does not represent no risk;But if code coverage is low, show test Sufficient degree is inadequate, objectively there is greater risk, and code coverage is to be improved.
In the concrete realization, test host can read target after getting above-mentioned operation information from operation information Test case is to the code coverage information for changing code, so that it is determined that corresponding code coverage out.
Step S302: detect whether the code coverage is higher than preset threshold;
It in the concrete realization, is the accuracy for guaranteeing final test use-case recommendation results, developer can be according to practical feelings Condition sets one for detecting whether target detection use-case can be used as the judgment criteria of recommendation test case, such as setting one Preset threshold (generally takes 80%, numerical value is adjustable), then detects whether the code coverage is higher than the preset threshold.
Step S303:,, will be described if being lower than using the target detection use-case as test case is recommended if being higher than Target detection use-case is as non-recommended test case.
In the concrete realization, whether the detectable code coverage read of test host is higher than 80%, if being higher than, table Bright currently performed target detection use-case is higher to the level of coverage of the change code, can be used as recommendation test case;If It is lower than, then shows that currently performed target detection use-case is too low to the level of coverage of the change code, needs from test case It concentrates in addition to choose or supplement and writes new test case to improve code coverage.
Further, the present embodiment test host know the target detection use-case cannot function as recommend test case Afterwards, the non-recommended test case can also be concentrated from the test case and is deleted, to obtain alternative test use cases;Then it holds The alternative test case that the row alternative test use cases are included, and each alternative test case is obtained in the process of implementation to institute State the code coverage of change code;It filters out and pushes away from the alternative test case concentration further according to the code coverage got Recommend test case.
Further, it to guarantee the recommendation test case code coverage with higher that filters out, in the present embodiment, surveys Examination host will also be ranked up the code coverage got according to sequence from high to low, will sort the according to ranking results One code coverage is as target coverage rate;Then it is surveyed the corresponding alternative test case of the target coverage rate as recommendation Example on probation.
The present embodiment by from operation information read target detection use-case to change code code coverage information (including Code coverage), then detect whether code coverage is higher than preset threshold;If being higher than, using target detection use-case as pushing away Test case is recommended, if being lower than, using target detection use-case as non-recommended test case, to realize to target detection use-case The accurate judgement for whether meeting testing requirement, ensure that the reliability of test case recommendation results.
With reference to Fig. 4, Fig. 4 is the flow diagram of test case recommended method 3rd embodiment of the present invention.
Based on the various embodiments described above, in the present embodiment, after the step S30, the method also includes:
Step S40: the corresponding method of the change code is read from the operation information and executes link, according to the side Method executes link and determines the corresponding association code of the change code;
It should be noted that test host is being carried out by jvm monitoring tools come the operating condition to current version code When monitoring in real time and record, method when running to test case is also executed into link and is monitored, link analysis is carried out.
It should be understood that in practical applications, carrying out analysis it is known that code logic is real by executing link to method It is existing.The analysis of link described in the present embodiment refers to that analysis change code exists with which original code or newly-increased code and is associated with There is association so as to analyze in system, if a certain code changes, more than test case will be covered between which test case To the code of change, also need to cover the relevant code of link therewith, such as: the user in application program to be tested registers function Corresponding code changes, and executes link " logging in-registering-to integrate " i.e. by analysis method it can be inferred that integrating function is aobvious Show that corresponding code can also change, therefore not only to test function of registering at this time, also to verify integrating function associated therewith.
In the concrete realization, test host can read the corresponding method of the change code from the operation information and execute Link;Then link is executed according to the method and determines current ink node (such as " registering ") belonging to the change code, And the upstream node " login " and downstream node " integral " of the current ink node;Obtain the upstream node pair respectively again The marking code and the corresponding marking code of the downstream node answered;The marking code that last basis is got is from database Corresponding code file is searched, and using the code file found as the corresponding association code of the change code.
Step S50: the association code is searched according in the relationship maps between the code and test case constructed in advance Corresponding association test case;
It should be noted that before executing this step, developer can construct in advance a code and test case it Between relationship maps, which can be realized by way of key-value pair, such as " key=value ", wherein " key " can To be code (or the corresponding mark of code), " value " then can be test case (or the corresponding name identification of test case).
In the present embodiment, after finding association code corresponding with change code, test host can be according to preparatory structure The corresponding association test case of the association code is searched in relationship maps between the code built and test case, to obtain By the relevant test case of institute of the change code influences.
Step S60: the association test case and the recommendation test case is corresponding as the current version code Standard testing use-case recommended.
In the concrete realization, test host is being found after by the relevant test case of institute of the change code influences, It can be used using the association test case and the recommendation test case as the corresponding standard testing of the current version code Developer is recommended or be pushed to example.
The present embodiment executes link by reading the corresponding method of change code from operation information, executes chain according to method Road determines the corresponding association code of change code;It is searched according in the relationship maps between the code and test case constructed in advance The corresponding association test case of association code;Test case will be associated with and recommend test case corresponding as current version code Standard testing use-case is recommended, and so as to help tester's effective position regression test range, and helps developer Understand and search the influence point that change code is related to, and then reduces the generation of code vulnerabilities (bug).
In addition, the embodiment of the present invention also proposes a kind of storage medium, test case recommendation is stored on the storage medium Program, the test case recommended program realize the step of test case recommended method as described above when being executed by processor Suddenly.
It is the structural block diagram of test case recommendation apparatus first embodiment of the present invention referring to Fig. 5, Fig. 5.
As shown in figure 5, the test case recommendation apparatus that the embodiment of the present invention proposes includes:
Code comparison module 501, for reading the corresponding current version code of application program to be measured and last revision generation Code compares tool by preset version and obtains the change code between the current version code and the last revision code;
Use-case execution module 502 is compiled for obtaining the corresponding start context of the last revision code according to the version Number obtain target detection use-case, and execute the target detection use-case, with and obtain in the target detection use-case implementation procedure The operation information of the current version code;
Use-case recommending module 503, for reading the target detection use-case from the operation information to the change generation The code coverage information of code, and judge the target detection use-case whether as recommendation test use according to the code coverage information Example.
The present embodiment is by reading the corresponding current version code of application program to be measured and last revision code, by pre- It sets version comparison tool and obtains change code between the current version code and last revision code;Obtain described upper one edition The corresponding start context of this code obtains target detection use-case according to start context, and performance objective test case simultaneously obtains target The operation information of current version code in test case implementation procedure;Target detection use-case is read from operation information to change generation The code coverage information of code, and judge whether target detection use-case is used as according to code coverage information and recommend test case, due to It is to compare tool by version first to determine change code, then by the corresponding target detection use-case of last revision code to change Code carries out code coverage detection, determines whether target detection use-case can be used as recommendation test further according to testing result Example, so as to accurately judge whether currently used test case meets practical survey after system source code changes Examination demand reduces the workload of exploitation tester.
Based on the above-mentioned test case recommendation apparatus first embodiment of the present invention, test case recommendation apparatus of the present invention is proposed Second embodiment.
In the present embodiment, the use-case execution module 502 is also used to obtain the corresponding version of the last revision code Number, the start context include first kind number and Second Type number;Institute is searched in the mapping relations constructed in advance It states the first kind and numbers corresponding test use cases, and filtered out according to Second Type number from test case concentration Target detection use-case.
Further, the use-case recommending module 503 is also used to read the target detection from the operation information and uses For example to the code coverage information of the change code, the code coverage information includes code coverage;The code is detected to cover Whether lid rate is higher than preset threshold;It,, will if being lower than using the target detection use-case as test case is recommended if being higher than The target detection use-case is as non-recommended test case.
Further, the use-case recommending module 503 is also used to the non-recommended test case from the test case It concentrates and deletes, to obtain alternative test use cases;The alternative test case that the alternative test use cases are included is executed, and is obtained Take code coverage of each alternative test case in the process of implementation to the change code;According to the code coverage got Recommendation test case is filtered out from the alternative test case concentration.
Further, the use-case recommending module 503 is also used to the code coverage got according to from high to low Sequence be ranked up, according to ranking results using sort first code coverage as target coverage rate;By the target coverage The corresponding alternative test case of rate is as recommendation test case.
Further, the use-case recommending module 503 is also used to read the change code pair from the operation information The method answered executes link, executes link according to the method and determines the corresponding association code of the change code;According to preparatory The corresponding association test case of the association code is searched in relationship maps between the code and test case of building;It will be described Association test case and the recommendation test case are recommended as the corresponding standard testing use-case of the current version code.
Further, the use-case recommending module 503 is also used to read the change code pair from the operation information The method answered executes link;Link, which is executed, according to the method determines current ink node belonging to the change code, and The upstream node and downstream node of the current ink node;The corresponding marking code of the upstream node and institute are obtained respectively State the corresponding marking code of downstream node;Corresponding code file is searched from database according to the marking code got, and Using the code file found as the corresponding association code of the change code.
The other embodiments or specific implementation of test case recommendation apparatus of the present invention can refer to above-mentioned each method and implement Example, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as read-only memory/random access memory, magnetic disk, CD), including some instructions are used so that a terminal device (can To be mobile phone, computer, server, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of test case recommended method, which is characterized in that the described method includes:
The corresponding current version code of application program to be measured and last revision code are read, tool is compared by preset version and is obtained Take the change code between the current version code and the last revision code;
The corresponding start context of the last revision code is obtained, target detection use-case is obtained according to the start context, and hold The target detection use-case go to obtain the operation information of current version code described in the target detection use-case implementation procedure;
The target detection use-case is read from the operation information to the code coverage information of the change code, and according to institute Whether state code coverage information judges the target detection use-case as recommendation test case.
2. the method as described in claim 1, which is characterized in that the corresponding version of the last revision code that obtains is compiled Number, according to the start context obtain target detection use-case the step of, comprising:
The corresponding start context of the last revision code is obtained, the start context includes first kind number and Second Type Number;
The first kind is searched in the mapping relations constructed in advance and numbers corresponding test use cases, and according to described second Type number filters out target detection use-case from test case concentration.
3. method according to claim 2, which is characterized in that described to read the target detection use from the operation information Example judges whether the target detection use-case is made according to the code coverage information to the code coverage information of the change code For the step of recommending test case, comprising:
The target detection use-case is read from the operation information to the code coverage information of the change code, the code Coverage information includes code coverage;
Detect whether the code coverage is higher than preset threshold;
If being higher than, using the target detection use-case as test case is recommended, if being lower than, the target detection use-case is made For non-recommended test case.
4. method as claimed in claim 3, which is characterized in that described test the target detection use-case as non-recommended is used After the step of example, the method also includes:
The non-recommended test case is concentrated from the test case and is deleted, to obtain alternative test use cases;
The alternative test case that the alternative test use cases are included is executed, and obtains each alternative test case in implementation procedure In to it is described change code code coverage;
Recommendation test case is filtered out from the alternative test case concentration according to the code coverage got.
5. method as claimed in claim 4, which is characterized in that the code coverage that the basis is got is from the alternative survey Example concentration on probation filters out the step of recommending test case, comprising:
The code coverage got is ranked up according to sequence from high to low, according to ranking results by sort first generation Code coverage rate is as target coverage rate;
Using the corresponding alternative test case of the target coverage rate as recommendation test case.
6. such as method described in any one of claim 1 to 5, which is characterized in that described to be judged according to the code coverage information After the step of whether the target detection use-case is as recommendation test case, the method also includes:
The corresponding method of the change code is read from the operation information and executes link, and it is true to execute link according to the method Determine the corresponding association code of the change code;
It is surveyed according to the corresponding association of the association code is searched in the relationship maps between the code and test case constructed in advance Example on probation;
It is used using the association test case and the recommendation test case as the corresponding standard testing of the current version code Example is recommended.
7. method as claimed in claim 6, which is characterized in that described to read the change code pair from the operation information The method answered executes link, executes the step of link determines the change code corresponding association code according to the method, wraps It includes:
The corresponding method of the change code is read from the operation information executes link;
Link, which is executed, according to the method determines current ink node and the current ink section belonging to the change code The upstream node and downstream node of point;
The corresponding marking code of the upstream node and the corresponding marking code of the downstream node are obtained respectively;
Search corresponding code file from database according to the marking code got, and using the code file found as The corresponding association code of the change code.
8. a kind of test case recommendation apparatus, which is characterized in that described device includes:
Code comparison module passes through for reading the corresponding current version code of application program to be measured and last revision code Preset version comparison tool obtains the change code between the current version code and the last revision code;
Use-case execution module is obtained for obtaining the corresponding start context of the last revision code according to the start context Target detection use-case, and the target detection use-case is executed to obtain current version described in the target detection use-case implementation procedure The operation information of this code;
Use-case recommending module, for reading the target detection use-case from the operation information to the code of the change code Coverage information, and judge the target detection use-case whether as recommendation test case according to the code coverage information.
9. a kind of test case recommendation apparatus, which is characterized in that the equipment includes: memory, processor and is stored in described On memory and the test case recommended program that can run on the processor, the test case recommended program are configured to reality Now the step of test case recommended method as described in any one of claims 1 to 7.
10. a kind of storage medium, which is characterized in that be stored with test case recommended program, the test on the storage medium Use-case recommended program realizes the step of test case recommended method as described in any one of claim 1 to 7 when being executed by processor Suddenly.
CN201910541819.1A 2019-06-19 2019-06-19 Test case recommendation method, device, equipment and storage medium Active CN110413506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910541819.1A CN110413506B (en) 2019-06-19 2019-06-19 Test case recommendation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910541819.1A CN110413506B (en) 2019-06-19 2019-06-19 Test case recommendation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110413506A true CN110413506A (en) 2019-11-05
CN110413506B CN110413506B (en) 2023-02-03

Family

ID=68359588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910541819.1A Active CN110413506B (en) 2019-06-19 2019-06-19 Test case recommendation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110413506B (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427637A (en) * 2018-01-18 2018-08-21 平安科技(深圳)有限公司 Test cases recommends method, electronic device and readable storage medium storing program for executing
CN110928786A (en) * 2019-11-20 2020-03-27 中国工商银行股份有限公司 Testing method and device for financial program
CN111008151A (en) * 2019-12-20 2020-04-14 上海品顺信息科技有限公司 Program scanning method, terminal device, and computer-readable storage medium
CN111026665A (en) * 2019-12-09 2020-04-17 中国建设银行股份有限公司 Test range analysis method, device and equipment
CN111045944A (en) * 2019-12-11 2020-04-21 广州品唯软件有限公司 Regression testing method, device and system and computer readable storage medium
CN111400164A (en) * 2020-02-07 2020-07-10 浙江口碑网络技术有限公司 Software testing method and device
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN111782516A (en) * 2020-06-24 2020-10-16 Oppo广东移动通信有限公司 Code testing method and device and storage medium
CN111858301A (en) * 2020-06-05 2020-10-30 中国船舶重工集团公司第七0九研究所 Change history-based combined service test case set reduction method and device
CN112199276A (en) * 2020-09-24 2021-01-08 建信金融科技有限责任公司 Alteration detection method and device for microservice architecture, server and storage medium
CN112835779A (en) * 2019-11-25 2021-05-25 上海哔哩哔哩科技有限公司 Test case determination method and device and computer equipment
CN113127357A (en) * 2021-04-21 2021-07-16 北京百度网讯科技有限公司 Unit testing method, device, equipment, storage medium and program product
CN113190442A (en) * 2021-04-27 2021-07-30 上海安畅网络科技股份有限公司 Method and system for measuring test range and checking test coverage
US11119898B1 (en) 2020-05-07 2021-09-14 International Business Machines Corporation Automatic code coverage file recommendation
CN113590496A (en) * 2021-09-01 2021-11-02 建信金融科技有限责任公司 Automatic testing method and device
CN113704094A (en) * 2021-08-06 2021-11-26 北京城市网邻信息技术有限公司 Test case knowledge base construction method and device, electronic equipment and storage medium
CN113722234A (en) * 2021-09-14 2021-11-30 京东科技控股股份有限公司 Test case screening method and device, electronic equipment and storage medium
CN113760769A (en) * 2021-09-13 2021-12-07 北京百度网讯科技有限公司 Test case processing method and device, electronic equipment and storage medium
CN113778890A (en) * 2021-09-16 2021-12-10 平安银行股份有限公司 Code testing method and device, electronic equipment and storage medium
WO2022061779A1 (en) * 2020-09-25 2022-03-31 西门子股份公司 Change correlation analysis-based test case selection method and apparatus
CN114661906A (en) * 2022-03-15 2022-06-24 腾讯科技(深圳)有限公司 Entity mention classification method and device, electronic equipment and storage medium
CN115905031A (en) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 Test case recommendation method based on accurate quality assurance system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150007148A1 (en) * 2013-02-28 2015-01-01 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
US20150026664A1 (en) * 2013-07-17 2015-01-22 International Business Machines Corporation Method and system for automated test case selection
US20170132119A1 (en) * 2015-09-25 2017-05-11 EMC IP Holding Company LLC Method and device for retrieving test case based on code coverage
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN108491321A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 test case range determining method, device and storage medium
CN108829575A (en) * 2018-04-17 2018-11-16 平安科技(深圳)有限公司 Test cases recommended method, electronic device and readable storage medium storing program for executing
CN109144878A (en) * 2018-08-31 2019-01-04 重庆富民银行股份有限公司 Code test method based on path difference

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150007148A1 (en) * 2013-02-28 2015-01-01 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
US20150026664A1 (en) * 2013-07-17 2015-01-22 International Business Machines Corporation Method and system for automated test case selection
US20170132119A1 (en) * 2015-09-25 2017-05-11 EMC IP Holding Company LLC Method and device for retrieving test case based on code coverage
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN108491321A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 test case range determining method, device and storage medium
CN108829575A (en) * 2018-04-17 2018-11-16 平安科技(深圳)有限公司 Test cases recommended method, electronic device and readable storage medium storing program for executing
CN109144878A (en) * 2018-08-31 2019-01-04 重庆富民银行股份有限公司 Code test method based on path difference

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙小林: "TRILL技术测试方案的设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427637B (en) * 2018-01-18 2021-05-25 平安科技(深圳)有限公司 Test case recommendation method, electronic device and readable storage medium
CN108427637A (en) * 2018-01-18 2018-08-21 平安科技(深圳)有限公司 Test cases recommends method, electronic device and readable storage medium storing program for executing
CN110928786A (en) * 2019-11-20 2020-03-27 中国工商银行股份有限公司 Testing method and device for financial program
CN110928786B (en) * 2019-11-20 2024-04-02 中国工商银行股份有限公司 Testing method and device for financial program
CN112835779A (en) * 2019-11-25 2021-05-25 上海哔哩哔哩科技有限公司 Test case determination method and device and computer equipment
CN111026665A (en) * 2019-12-09 2020-04-17 中国建设银行股份有限公司 Test range analysis method, device and equipment
CN111045944A (en) * 2019-12-11 2020-04-21 广州品唯软件有限公司 Regression testing method, device and system and computer readable storage medium
CN111008151A (en) * 2019-12-20 2020-04-14 上海品顺信息科技有限公司 Program scanning method, terminal device, and computer-readable storage medium
CN111008151B (en) * 2019-12-20 2023-06-13 上海品顺信息科技有限公司 Program scanning method, terminal device and computer readable storage medium
CN111400164A (en) * 2020-02-07 2020-07-10 浙江口碑网络技术有限公司 Software testing method and device
CN111400164B (en) * 2020-02-07 2023-05-26 浙江口碑网络技术有限公司 Software testing method and device
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN111666206B (en) * 2020-04-30 2023-12-22 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
US11119898B1 (en) 2020-05-07 2021-09-14 International Business Machines Corporation Automatic code coverage file recommendation
CN111858301A (en) * 2020-06-05 2020-10-30 中国船舶重工集团公司第七0九研究所 Change history-based combined service test case set reduction method and device
CN111858301B (en) * 2020-06-05 2022-10-11 中国船舶重工集团公司第七0九研究所 Change history-based composite service test case set reduction method and device
CN111782516A (en) * 2020-06-24 2020-10-16 Oppo广东移动通信有限公司 Code testing method and device and storage medium
CN112199276B (en) * 2020-09-24 2023-05-30 建信金融科技有限责任公司 Method, device, server and storage medium for detecting change of micro-service architecture
CN112199276A (en) * 2020-09-24 2021-01-08 建信金融科技有限责任公司 Alteration detection method and device for microservice architecture, server and storage medium
WO2022061779A1 (en) * 2020-09-25 2022-03-31 西门子股份公司 Change correlation analysis-based test case selection method and apparatus
CN113127357A (en) * 2021-04-21 2021-07-16 北京百度网讯科技有限公司 Unit testing method, device, equipment, storage medium and program product
CN113127357B (en) * 2021-04-21 2023-10-03 北京百度网讯科技有限公司 Unit test method, apparatus, device, storage medium, and program product
CN113190442A (en) * 2021-04-27 2021-07-30 上海安畅网络科技股份有限公司 Method and system for measuring test range and checking test coverage
CN113704094A (en) * 2021-08-06 2021-11-26 北京城市网邻信息技术有限公司 Test case knowledge base construction method and device, electronic equipment and storage medium
CN113590496A (en) * 2021-09-01 2021-11-02 建信金融科技有限责任公司 Automatic testing method and device
CN113590496B (en) * 2021-09-01 2023-06-02 建信金融科技有限责任公司 Automatic test method and device
CN113760769A (en) * 2021-09-13 2021-12-07 北京百度网讯科技有限公司 Test case processing method and device, electronic equipment and storage medium
CN113760769B (en) * 2021-09-13 2023-11-07 北京百度网讯科技有限公司 Test case processing method and device, electronic equipment and storage medium
CN113722234A (en) * 2021-09-14 2021-11-30 京东科技控股股份有限公司 Test case screening method and device, electronic equipment and storage medium
CN113778890A (en) * 2021-09-16 2021-12-10 平安银行股份有限公司 Code testing method and device, electronic equipment and storage medium
CN113778890B (en) * 2021-09-16 2023-06-30 平安银行股份有限公司 Code testing method and device, electronic equipment and storage medium
CN114661906A (en) * 2022-03-15 2022-06-24 腾讯科技(深圳)有限公司 Entity mention classification method and device, electronic equipment and storage medium
CN115905031A (en) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 Test case recommendation method based on accurate quality assurance system

Also Published As

Publication number Publication date
CN110413506B (en) 2023-02-03

Similar Documents

Publication Publication Date Title
CN110413506A (en) Test case recommended method, device, equipment and storage medium
CN109871326B (en) Script recording method and device
CN108446221A (en) System detection method, device, computer equipment and storage medium
CN109726105A (en) Test data building method, device, equipment and storage medium
CN108549606A (en) interface test method and device
CN107622008B (en) Traversal method and device for application page
KR101588027B1 (en) Method and apparatus for generating test case to support localization of software
CN113342685A (en) Precise test method and device, computer equipment and storage medium
CN111026647B (en) Method and device for acquiring code coverage rate, computer equipment and storage medium
CN109828750B (en) Method and device for automatically configuring data embedded points, electronic equipment and storage medium
CN105653946A (en) Android malicious behavior detection system based on combined event behavior triggering and detection method of Android malicious behavior detection system
CN105183658A (en) Software code testing method and device
CN117009243A (en) Chip performance automatic test method, device, computer equipment and storage medium
CN105468508A (en) Code testing method and apparatus
CN110515755A (en) Interface function verification method, device, equipment and computer readable storage medium
CN105577472A (en) Data acquisition test method and device
CN110377742A (en) Text classification evaluating method, device, readable storage medium storing program for executing and computer equipment
CN113448834A (en) Buried point testing method and device, electronic equipment and storage medium
CN103365772B (en) Software test automatic evaluation device and method
CN108734393A (en) Matching process, user equipment, storage medium and the device of information of real estate
CN108829575A (en) Test cases recommended method, electronic device and readable storage medium storing program for executing
CN108733707A (en) A kind of determining function of search stability and device
CN107402883B (en) A kind of data test treating method and apparatus
CN102789417B (en) Program detecting system and method based on directional symbol execution on mobile intelligent terminal
CN113656318A (en) Software version testing method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant