技术领域technical field
本发明涉及计算机技术领域和铁路技术领域,尤其涉及一种软件回归测试方法及装置。The invention relates to the fields of computer technology and railway technology, in particular to a software regression testing method and device.
背景技术Background technique
列控联锁一体化软件,是集成了列控中心、计算机联锁、地面电子单元等多个既有产品功能的综合软件。The integrated train control and interlocking software is a comprehensive software that integrates multiple existing product functions such as train control center, computer interlocking, and ground electronic unit.
在列控联锁一体化软件被更改后,需要对更改后的软件进行测试,以确认对软件系统进行修改是否引出了新的错误,即为软件的回归测试。After the train control interlocking integration software is changed, it is necessary to test the changed software to confirm whether the modification of the software system leads to new errors, which is the regression test of the software.
传统的对列控联锁一体化软件进行回归测试的方法是对所有变更的部分都确定测试用例,根据测试用例进行测试,这样一来,在变更多的情况下,测试用例就多,因此测试工作量大,效率低下。The traditional method of regression testing the train control interlocking integration software is to determine the test cases for all the changed parts, and test according to the test cases. In this way, there will be more test cases when there are more changes, so The testing workload is heavy and the efficiency is low.
发明内容Contents of the invention
鉴于上述问题,本发明提供一种软件回归测试方法及装置,主要目的是为了减小列控联锁一体化软件回归测试量,提升测试效率。In view of the above problems, the present invention provides a software regression testing method and device, the main purpose of which is to reduce the amount of software regression testing for train control and interlocking integration and improve testing efficiency.
为解决上述技术问题,本发明提出以下方案:In order to solve the problems of the technologies described above, the present invention proposes the following solutions:
第一方面,本发明提供了一种软件回归测试方法,所述方法包括:In a first aspect, the present invention provides a software regression testing method, the method comprising:
获取指定软件中的多个变更模块,所述变更模块包括变更代码模块和变更需求模块;Obtain multiple change modules in the specified software, where the change modules include a change code module and a change requirement module;
基于预设对应表确定所述多个变更模块对应的多个测试用例;determining a plurality of test cases corresponding to the plurality of change modules based on a preset correspondence table;
基于预设计算方法在所述多个测试用例中确定出多个目标测试用例;determining a plurality of target test cases in the plurality of test cases based on a preset calculation method;
基于所述多个目标测试用例对所述指定软件进行回归测试。Regression testing is performed on the specified software based on the plurality of target test cases.
第二方面,本发明提供了一种软件回归测试装置,所述装置包括:In a second aspect, the present invention provides a software regression testing device, the device comprising:
获取单元,用于获取指定软件中的多个变更模块,所述变更模块包括变更代码模块和变更需求模块;an acquisition unit, configured to acquire multiple change modules in the specified software, where the change modules include a change code module and a change requirement module;
第一确定单元,用于基于预设对应表确定所述获取单元获取的多个变更模块对应的多个测试用例;A first determination unit, configured to determine a plurality of test cases corresponding to the plurality of change modules acquired by the acquisition unit based on a preset correspondence table;
第二确定单元,用于基于预设计算方法在所述第一确定单元确定的多个测试用例中确定出多个目标测试用例;The second determination unit is configured to determine a plurality of target test cases among the plurality of test cases determined by the first determination unit based on a preset calculation method;
测试单元,用于基于所述第二确定单元确定的多个目标测试用例对所述指定软件进行回归测试。A testing unit, configured to perform a regression test on the designated software based on the plurality of target test cases determined by the second determining unit.
为了实现上述目的,根据本发明的第三方面,提供了一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行上述第一方面的软件回归测试方法。In order to achieve the above object, according to the third aspect of the present invention, a storage medium is provided, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned first aspect. Software regression testing methods.
为了实现上述目的,根据本发明的第四方面,提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述第一方面的软件回归测试方法。In order to achieve the above object, according to a fourth aspect of the present invention, a processor is provided, the processor is used to run a program, wherein, when the program is running, the software regression testing method of the above first aspect is executed.
借由上述技术方案,本发明提供的一种软件回归测试方法及装置,可以先获取到指定软件中的变更部分,再根据预设对应表确定出变更部分所对应的多个测试用例,之后根据预设计算方法在多个测试用例中筛选出目标测试用例,这样一来,可以只根据目标测试用例来对指定软件进行回归测试,而无需使用变更部分对应的全部测试用例来进行回归测试,测试量小,可以提升测试效率,且目标测试用例是从多个测试用例中筛选出来的,为对回归测试最有效的测试用例,这样一来,在测试量小的情况下还可以提升对回归测试的精确度。By virtue of the above technical solution, a software regression testing method and device provided by the present invention can first obtain the changed part in the specified software, and then determine a plurality of test cases corresponding to the changed part according to the preset correspondence table, and then according to The preset calculation method screens out the target test cases from multiple test cases, so that the specified software can be regression tested only according to the target test cases, without using all the test cases corresponding to the changed part for regression testing, testing Small amount can improve test efficiency, and the target test cases are selected from multiple test cases, which are the most effective test cases for regression testing. In this way, regression testing can also be improved when the test volume is small the accuracy.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
图1示出了本发明实施例提供的一种软件回归测试方法流程图;Fig. 1 shows a flow chart of a software regression testing method provided by an embodiment of the present invention;
图2示出了本发明实施例提供的另一种软件回归测试方法流程图;Fig. 2 shows another kind of software regression testing method flowchart that the embodiment of the present invention provides;
图3示出了本发明实施例提供的一种软件回归测试装置的组成框图;FIG. 3 shows a block diagram of a software regression testing device provided by an embodiment of the present invention;
图4示出了本发明实施例提供的另一种软件回归测试装置的组成框图。FIG. 4 shows a block diagram of another software regression testing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
列控联锁一体化软件,是集成了列控中心、计算机联锁、地面电子单元等多个既有产品功能的综合软件。在列控联锁一体化软件被更改后,需要对更改后的软件进行测试,以确认对软件系统进行修改是否引出了新的错误,即为软件的回归测试。传统的对列控联锁一体化软件进行回归测试的方法是对所有变更的部分都确定测试用例,根据测试用例进行测试,这样一来,在变更多的情况下,测试用例就多,因此测试工作量大,效率低下。为此,本发明提供了一种软件回归测试方法,可以减小测试量,提升测试效率。其具体执行步骤如图1所示,包括:The integrated train control and interlocking software is a comprehensive software that integrates multiple existing product functions such as train control center, computer interlocking, and ground electronic unit. After the train control interlocking integration software is changed, it is necessary to test the changed software to confirm whether the modification of the software system leads to new errors, which is the regression test of the software. The traditional method of regression testing the train control interlocking integration software is to determine the test cases for all the changed parts, and test according to the test cases. In this way, there will be more test cases when there are more changes, so The testing workload is heavy and the efficiency is low. Therefore, the present invention provides a software regression testing method, which can reduce the testing amount and improve the testing efficiency. The specific implementation steps are shown in Figure 1, including:
101、获取指定软件中的多个变更模块。101. Obtain multiple change modules in the specified software.
102、基于预设对应表确定多个变更模块对应的多个测试用例。102. Determine multiple test cases corresponding to multiple change modules based on a preset correspondence table.
在对软件进行更改后,通常需要对软件进行回归测试,以确认是否引入了新的错误,因此,在对指定软件进行更改后,在步骤101中可以获取到指定软件中被更改的多个变更模块。其中,指定软件可以为列控联锁一体化软件。After making changes to the software, it is usually necessary to perform a regression test on the software to confirm whether new errors are introduced. Therefore, after making changes to the specified software, multiple changes that have been changed in the specified software can be obtained in step 101 module. Among them, the specified software can be integrated train control and interlocking software.
具体的,获取到指定软件中被更改的多个变更模块可以是先获取到更新后的指定软件的代码以及更新前的原有代码,然后将原有代码和更新后的代码进行对比,以确定出指定软件的多个变更代码模块;同时,可以获取到指定软件的更新后的需求文档和原有的需求文档,然后将更新后的需求文档和原有需求文档进行对比,以确定指定软件的变更需求模块。Specifically, obtaining multiple changed modules in the specified software may be obtained by first obtaining the updated code of the specified software and the original code before the update, and then comparing the original code with the updated code to determine multiple changed code modules of the specified software; at the same time, the updated requirements document and the original requirements document of the specified software can be obtained, and then the updated requirements document is compared with the original requirements document to determine the requirements of the specified software. Change the requirements module.
进一步的,在对指定软件进行回归测试前,需要建立变更部分对应的测试用例,为了使变更部分和对应的测试用例之间的关系更清晰,可以预先建立变更部分和对应的测试用例之间的关系对应表(即预设对应表),在后续需要进行测试时,可以直接在预设对应表中确定出多个变更模块对应的多个测试用例。Furthermore, before regression testing the specified software, it is necessary to establish the test cases corresponding to the changed parts. In order to make the relationship between the changed parts and the corresponding test cases clearer, the relationship between the changed parts and the corresponding test cases can be established in advance. The relationship correspondence table (that is, the default correspondence table), when subsequent testing is required, multiple test cases corresponding to multiple change modules can be directly determined in the preset correspondence table.
其中,多个变更模块可能对应同一测试用例。Among them, multiple change modules may correspond to the same test case.
103、基于预设计算方法在多个测试用例中确定出多个目标测试用例。103. Determine a plurality of target test cases among the plurality of test cases based on a preset calculation method.
104、基于多个目标测试用例对指定软件进行回归测试。104. Perform a regression test on the specified software based on multiple target test cases.
在步骤102确定出多个测试用例之后,由于测试所需的资源有限,且测试用例多,若全部执行可能较耗费资源和时间,因此,可以在步骤103中基于预设计算方法在多个测试用例中确定出多个目标测试用例,然后在步骤104中根据多个目标测试用例对指定软件进行回归测试。进行回归测试的流程可以是根据测试用例验证变更部分的代码或需求,然后看结果与预期结果是否符合。After multiple test cases are determined in step 102, since the resources required for testing are limited and there are many test cases, it may consume resources and time to execute all of them. Therefore, in step 103, multiple test A plurality of target test cases are determined in the use case, and then in step 104, a regression test is performed on the specified software according to the plurality of target test cases. The process of regression testing can be to verify the code or requirements of the changed part according to the test cases, and then check whether the results meet the expected results.
具体的,在多个测试用例中确定出多个目标测试用例时,可以是利用预设计算方法计算多个测试用例中,每个测试用例的影响度,可以理解为哪个测试用例对指定软件的影响最大,再筛选出影响度较大的几个测试用例,将影响度较大的几个测试用例确定为目标测试用例。Specifically, when multiple target test cases are determined in multiple test cases, the preset calculation method can be used to calculate the degree of influence of each test case in multiple test cases, which can be understood as which test case affects the specified software. The most influential, and then screen out several test cases with greater influence, and determine the test cases with greater influence as the target test cases.
另外,还可以确定变更部分,具体哪个变更部分所对应到的功能对指定软件最重要,以此来确定优先级,从而将优先级较高的几个变更部分所对应的测试用例确定为目标测试用例。In addition, it is also possible to determine the changed part, which function corresponding to the specific changed part is the most important to the specified software, so as to determine the priority, so that the test cases corresponding to several changed parts with higher priority are determined as the target test Example.
基于上述图1的实现方式可以看出,本发明提供的一种软件回归测试方法,可以先获取到指定软件中的变更部分,再根据预设对应表确定出变更部分所对应的多个测试用例,之后根据预设计算方法在多个测试用例中筛选出目标测试用例,这样一来,可以只根据目标测试用例来对指定软件进行回归测试,而无需使用变更部分对应的全部测试用例来进行回归测试,这样一来,测试量小,可以提升测试效率,且目标测试用例是从多个测试用例中筛选出来的,为对回归测试最有效的测试用例,这样一来,在测试量小的情况下还可以提升对回归测试的精确度。Based on the implementation in Figure 1 above, it can be seen that a software regression testing method provided by the present invention can first obtain the changed part in the specified software, and then determine a plurality of test cases corresponding to the changed part according to the preset correspondence table , and then select the target test cases from multiple test cases according to the preset calculation method, so that the regression test of the specified software can be performed only according to the target test cases, without using all the test cases corresponding to the changed part for regression Test, in this way, the test volume is small, which can improve the test efficiency, and the target test case is selected from multiple test cases, which is the most effective test case for regression testing. In this way, when the test volume is small It can also improve the accuracy of regression testing.
进一步的,作为对图1所示实施例的细化及扩展,本发明实施例还提供了另一种软件回归测试方法,如图2所示,其具体步骤如下:Further, as a refinement and extension of the embodiment shown in Figure 1, the embodiment of the present invention also provides another software regression testing method, as shown in Figure 2, the specific steps are as follows:
201、获取指定软件中的多个变更模块。201. Obtain multiple change modules in the specified software.
其中,步骤201的实施方式与步骤101相同,并且可以达到相同的技术效果,解决相同的技术问题,在此不做重复赘述。Wherein, the implementation manner of step 201 is the same as that of step 101, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
202、基于预设对应表确定多个变更模块对应的多个测试用例。202. Determine multiple test cases corresponding to multiple change modules based on a preset correspondence table.
其中,步骤202提出了一种区别于步骤102的更优实施方式。Wherein, step 202 proposes a better implementation manner different from step 102 .
在步骤202中,由于变更模块包括变更代码模块和变更需求模块,其中,代码有对应的调用接口,因此,可以搜索变更代码模块对应的接口模块,接口模块的数量可以是一个变更代码模块对应一个接口模块,还可以是一个变更代码模块对应两个接口模块,并无具体限定。In step 202, since the change module includes a change code module and a change requirement module, where the code has a corresponding calling interface, the interface module corresponding to the change code module can be searched, and the number of interface modules can be one change code module corresponding to one The interface module may also be one change code module corresponding to two interface modules, which is not specifically limited.
之后,由于接口和代码都会影响到软件的需求,因此在本发明中预先设定有接口、需求和代码之间的对应表,在确定出变更的代码模块及变更代码模块所对应的接口模块后,就可以根据预设的需求代码对应表,来确定出变更代码模块影响到的第一关联需求、变更代码模块对应的接口模块所影响到的第二关联需求。Afterwards, since both the interface and the code will affect the requirements of the software, a correspondence table between the interface, the requirements and the code is preset in the present invention. After determining the changed code module and the interface module corresponding to the changed code module , the first associated requirement affected by the change of the code module and the second associated requirement affected by the change of the interface module corresponding to the code module can be determined according to the preset requirement code correspondence table.
由于在本发明中,还预先设定了需求与用例的对应表,因此在确定出第一关联需求,第二关联需求后,就可以在预设需求用例对应表中确定出第一关联需求和第二关联需求所对应的用例,另外,还包括变更需求模块,因此,还可以在预设需求用例对应表中确定出变更需求模块对应的用例。也就是说预设对应表包括预设需求代码对应表和预设需求用例对应表。Since in the present invention, the corresponding table of requirements and use cases is also preset, so after determining the first associated requirement and the second associated requirement, the first associated requirement and the In addition, the use case corresponding to the second associated requirement also includes a change requirement module, therefore, the use case corresponding to the change requirement module can also be determined in the default requirement use case correspondence table. That is to say, the preset correspondence table includes a preset requirement code correspondence table and a preset requirement use case correspondence table.
其中,变更需求模块对应的用例、第一关联需求对应的用例和第二关联需求对应的用例可能会是同一个。Wherein, the use case corresponding to the change requirement module, the use case corresponding to the first associated requirement, and the use case corresponding to the second associated requirement may be the same.
203、设定第一关联需求及变更需求模块对应的第一系数值、第二关联需求对应的第二系数值。203. Set the first coefficient value corresponding to the first association requirement and the modification requirement module, and the second coefficient value corresponding to the second association requirement.
204、基于第一系数值及第二系数值在多个测试用例中确定出多个目标测试用例。204. Determine a plurality of target test cases among the plurality of test cases based on the first coefficient value and the second coefficient value.
在该步骤中,由于代码变更直接影响到的需求可以认为是比较重要的,因此,可以定义为直接需求,另外,需求文档变更所涉及到的变更需求模块也可以定义为直接需求。由于接口不会直接影响到需求,因此,可以将接口所影响的需求定义为间接需求。In this step, since the requirements directly affected by the code change can be regarded as relatively important, they can be defined as direct requirements. In addition, the change requirement modules involved in the change of requirements documents can also be defined as direct requirements. Since the interface does not directly affect the requirements, the requirements affected by the interface can be defined as indirect requirements.
在定义好直接需求和间接需求后,可以根据直接需求和间接需求设定第一关联需求、变更需求模块和第二关联需求对应的系数值。在设定系数值时,需要结合直接需求和间接需求的重要性。After the direct requirement and the indirect requirement are defined, coefficient values corresponding to the first associated requirement, the change requirement module and the second associated requirement can be set according to the direct requirement and the indirect requirement. When setting coefficient values, it is necessary to combine the importance of direct demand and indirect demand.
示例性的,由于代码变更影响到的需求为直接需求,也就是说变更代码模块对应的第一关联需求为直接需求,直接需求对软件来说可能更重要,因此可以将第一关联需求的系数值设置为2,将变更需求模块对应的系数值也设置为2。接口模块影响到的需求为间接需求,也就是说接口模块对应的第二关联需求为间接需求,间接需求对软件来说影响较小,因此,可以将第二关联需求的系数值设置为1。Exemplarily, since the requirement affected by the code change is a direct requirement, that is to say, the first associated requirement corresponding to the changed code module is a direct requirement, and the direct requirement may be more important to the software, so the coefficient of the first associated requirement can be Set the value to 2, and set the coefficient value corresponding to the change requirement module to 2 as well. The requirement affected by the interface module is an indirect requirement, that is to say, the second associated requirement corresponding to the interface module is an indirect requirement, and the indirect requirement has little influence on the software. Therefore, the coefficient value of the second associated requirement can be set to 1.
在设定出系数值之后,可以根据系数值在多个测试用例中确定出多个目标测试用例。具体的,由于多个需求可能对应同一个测试用例,也就是说,同一个测试用例可能对应多个需求,可能包括第一关联需求,也能包括第二关联需求和变更需求模块对应的需求。After the coefficient values are set, a plurality of target test cases may be determined among the plurality of test cases according to the coefficient values. Specifically, since multiple requirements may correspond to the same test case, that is to say, the same test case may correspond to multiple requirements, which may include the first associated requirement, and may also include the second associated requirement and the requirements corresponding to the change requirement module.
因此,可以先根据预设的需求和用例对应表来具体的确定出,每一个测试用例分别对应的第一关联需求数量、第二关联需求数量及变更需求模块数量。示例性的,可以是用例1对应一个第一关联需求,两个第二关联需求;用例2对应一个第一关联需求;用例3对应一个变更需求。Therefore, the number of first associated requirements, the number of second associated requirements and the number of changed requirement modules corresponding to each test case can be specifically determined according to the preset requirement and use case correspondence table. Exemplarily, use case 1 may correspond to a first association requirement and two second association requirements; use case 2 may correspond to a first association requirement; use case 3 may correspond to a change requirement.
之后,可以根据每个测试用例分别对应的第一关联需求数量、第二关联需求数量及变更需求模块数量及以及设定的第一关联需求、变更需求模块和第二关联需求对应的系数值来计算每个测试用例对应的影响度值,然后根据影响度值来在多个测试用例中确定出目标测试用例。Afterwards, according to the number of first associated requirements, the number of second associated requirements, and the number of changed requirement modules corresponding to each test case and the coefficient values corresponding to the set first associated requirements, changed requirement modules, and second associated requirements Calculate the influence value corresponding to each test case, and then determine the target test case among the multiple test cases according to the influence value.
下面,通过具体的示例来说明影响度值的算法:Below, a specific example is used to illustrate the algorithm of influence value:
若测试用例1对应1个第一关联需求、2个第二关联需求,也就是说测试用例1对应的第一关联需求数量为1、第二关联需求数量为2、变更需求数量为0,又由于设定的第一关联需求和变更需求的系数值为2、第二关联需求的系数值为1,因此,测试用例1的影响度值可以为:1×2+2×1+0×2=4,也就是说,影响度值的计算为该用例对应的需求数量乘该需求对应的系数值,若该用例对应多个需求,可以将多个需求的数量和其对应的系数值的乘积相加。If test case 1 corresponds to one first associated requirement and two second associated requirements, that is to say, the number of first associated requirements corresponding to test case 1 is 1, the number of second associated requirements is 2, and the number of changed requirements is 0, and Since the set coefficient value of the first association requirement and change requirement is 2, and the coefficient value of the second association requirement is 1, the influence value of test case 1 can be: 1×2+2×1+0×2 =4, that is to say, the influence value is calculated as the demand quantity corresponding to the use case multiplied by the coefficient value corresponding to the demand. If the use case corresponds to multiple demands, the product of the quantity of multiple demands and the corresponding coefficient value can be add up.
在计算出每个测试用例的影响度值之后,可以按照每个测试用例的影响度值,对多个测试用例之间进行排序,具体的,可以是影响度值从大到小的顺序,之后,可以将顺序中,影响度值较小的测试用例去掉,留下的即为目标测试用例。具体的,为了保证回归测试的精度,可以限定留下的目标测试用例的数量。这样一来,筛选出影响度较高的测试用例作为目标测试用例,不仅可以保证测试精度,还可以减少测试数量,提升测试效率。且在本发明中,将代码和需求进行了整合,也就是将变更代码模块所对应的测试用例和需求文档变化所对应的需求的测试用例进行了整和,从而筛选出的目标测试用例,可以使得测试更全面。After the influence value of each test case is calculated, multiple test cases can be sorted according to the influence value of each test case. Specifically, it can be the order of the influence value from large to small, and then , you can remove the test cases with smaller influence values in the sequence, and the remaining ones are the target test cases. Specifically, in order to ensure the accuracy of the regression test, the number of remaining target test cases may be limited. In this way, screening test cases with high impact as target test cases can not only ensure test accuracy, but also reduce the number of tests and improve test efficiency. And in the present invention, the code and the requirements are integrated, that is, the test cases corresponding to the changed code modules and the test cases corresponding to the requirements document changes are integrated, so that the target test cases screened out can be Make the test more comprehensive.
205、基于多个目标测试用例对指定软件进行回归测试。205. Perform a regression test on the specified software based on multiple target test cases.
其中,步骤205的实施方式与步骤104相同,并且可以达到相同的技术效果,解决相同的技术问题,在此不做重复赘述。Wherein, the implementation manner of step 205 is the same as that of step 104, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
进一步的,作为对上述图1所示方法的实现,本发明实施例还提供了一种软件回归测试装置,用于对上述图1所示的方法进行实现。该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。如图3所示,该装置包括:Further, as an implementation of the method shown in FIG. 1 above, an embodiment of the present invention also provides a software regression testing device for implementing the method shown in FIG. 1 above. This device embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this device embodiment does not repeat the details in the foregoing method embodiment one by one, but it should be clear that the device in this embodiment can correspond to the foregoing method implementation. Everything in the example. As shown in Figure 3, the device includes:
获取单元301,用于获取指定软件中的多个变更模块,所述变更模块包括变更代码模块和变更需求模块;An acquisition unit 301, configured to acquire multiple change modules in the specified software, where the change modules include a change code module and a change requirement module;
第一确定单元302,用于基于预设对应表确定所述获取单元获取的多个变更模块对应的多个测试用例;The first determination unit 302 is configured to determine a plurality of test cases corresponding to the plurality of change modules obtained by the acquisition unit based on a preset correspondence table;
第二确定单元303,用于基于预设计算方法在所述第一确定单元302确定的多个测试用例中确定出多个目标测试用例;The second determination unit 303 is configured to determine a plurality of target test cases among the plurality of test cases determined by the first determination unit 302 based on a preset calculation method;
测试单元304,用于基于所述第二确定单元303确定的多个目标测试用例对所述指定软件进行回归测试。A testing unit 304, configured to perform a regression test on the specified software based on the multiple target test cases determined by the second determining unit 303.
进一步的,作为对上述图2所示方法的实现,本发明实施例还提供了另一种软件回归测试装置,用于对上述图2所示的方法进行实现。该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。如图4所示,该装置包括:Further, as an implementation of the method shown in FIG. 2 above, the embodiment of the present invention also provides another software regression testing device, which is used to implement the method shown in FIG. 2 above. This device embodiment corresponds to the foregoing method embodiment. For the convenience of reading, this device embodiment does not repeat the details in the foregoing method embodiment one by one, but it should be clear that the device in this embodiment can correspond to the foregoing method implementation. Everything in the example. As shown in Figure 4, the device includes:
获取单元301,用于获取指定软件中的多个变更模块,所述变更模块包括变更代码模块和变更需求模块;An acquisition unit 301, configured to acquire multiple change modules in the specified software, where the change modules include a change code module and a change requirement module;
第一确定单元302,用于基于预设对应表确定所述获取单元获取的多个变更模块对应的多个测试用例;The first determination unit 302 is configured to determine a plurality of test cases corresponding to the plurality of change modules obtained by the acquisition unit based on a preset correspondence table;
第二确定单元303,用于基于预设计算方法在所述第一确定单元302确定的多个测试用例中确定出多个目标测试用例;The second determination unit 303 is configured to determine a plurality of target test cases among the plurality of test cases determined by the first determination unit 302 based on a preset calculation method;
测试单元304,用于基于所述第二确定单元303确定的多个目标测试用例对所述指定软件进行回归测试。A testing unit 304, configured to perform a regression test on the specified software based on the multiple target test cases determined by the second determining unit 303.
一种可选的实施方式中,所述获取单元301包括:In an optional implementation manner, the acquiring unit 301 includes:
第一获取模块3011,用于基于所述指定软件的历史代码及更新代码获取所述指定软件的多个变更代码模块;The first acquisition module 3011 is used to acquire multiple change code modules of the specified software based on the historical code and update code of the specified software;
第二获取模块3012,用于基于所述指定软件的历史需求文档及更新需求文档获取所述指定软件的变更需求模块。The second acquiring module 3012 is configured to acquire the change requirement module of the specified software based on the historical requirement document and update requirement document of the specified software.
一种可选的实施方式中,所述第一确定单元302包括:In an optional implementation manner, the first determining unit 302 includes:
接口确定模块3021,用于确定多个变更代码模块对应的多个接口模块;An interface determination module 3021, configured to determine a plurality of interface modules corresponding to a plurality of changed code modules;
需求确定模块3022,用于基于预设需求代码对应表确定所述多个变更代码模块对应的第一关联需求及所述接口确定模块3021确定的多个接口模块对应的第二关联需求;A requirement determining module 3022, configured to determine the first associated requirements corresponding to the plurality of changed code modules and the second associated requirements corresponding to the plurality of interface modules determined by the interface determining module 3021 based on the preset requirement code correspondence table;
第一用例确定模块3023,用于基于预设需求用例对应表确定所述需求确定模块3022确定的所述第一关联需求、所述第二关联需求及所述变更需求模块对应的多个测试用例。The first use case determination module 3023 is configured to determine a plurality of test cases corresponding to the first associated requirement, the second associated requirement and the changed requirement module determined by the requirement determination module 3022 based on the preset requirement use case correspondence table .
一种可选的实施方式中,所述第二确定单元303包括:In an optional implementation manner, the second determining unit 303 includes:
系数值确定模块3031,用于设定所述第一关联需求及所述变更需求模块对应的第一系数值、所述第二关联需求对应的第二系数值;A coefficient value determination module 3031, configured to set the first coefficient value corresponding to the first association requirement and the modification requirement module, and the second coefficient value corresponding to the second association requirement;
第二用例确定模块3032,用于基于所述系数值确定模块3031设定的所述第一系数值及所述第二系数值在所述多个测试用例中确定出多个目标测试用例。The second use case determination module 3032 is configured to determine a plurality of target test cases among the plurality of test cases based on the first coefficient value and the second coefficient value set by the coefficient value determination module 3031 .
一种可选的实施方式中,第二用例确定模块3032包括:In an optional implementation manner, the second use case determination module 3032 includes:
数量确定子模块30321,用于基于预设需求用例对应表确定每个测试用例分别对应的第一关联需求数量、第二关联需求数量及变更需求模块数量;Quantity determination sub-module 30321, configured to determine the first associated requirement quantity, the second associated requirement quantity and the changed requirement module quantity corresponding to each test case based on the preset requirement use case correspondence table;
第二用例确定子模块30322,用于基于所述数量确定子模块30321确定的所述每个测试用例分别对应的第一关联需求数量、第二关联需求数量、变更需求模块数量及所述第一系数值和所述第二系数值,在所述多个测试用例中确定出多个目标测试用例。The second use case determination sub-module 30322 is configured to determine the first associated requirement quantity, the second associated requirement quantity, the changed requirement module quantity and the first associated requirement quantity respectively corresponding to each test case determined by the quantity determining submodule 30321. The coefficient value and the second coefficient value determine a plurality of target test cases in the plurality of test cases.
一种可选的实施方式中,所述第二用例确定子模块30322具体用于:In an optional implementation manner, the second use case determination submodule 30322 is specifically configured to:
基于所述每个测试用例分别对应的第一关联需求数量、第二关联需求数量、变更需求模块数量及所述第一系数值和所述第二系数值,确定所述每个测试用例对应的影响度值;Based on the first associated requirement quantity, the second associated requirement quantity, the changed requirement module quantity and the first coefficient value and the second coefficient value respectively corresponding to each test case, determine the corresponding Influence value;
基于所述每个测试用例对应的影响度值,在所述多个测试用例中确定出多个目标测试用例。Based on the influence value corresponding to each test case, a plurality of target test cases are determined among the plurality of test cases.
一种可选的实施方式中,所述第二用例确定子模块30322在基于每个测试用例对应的影响度值,在所述多个测试用例中确定出多个目标测试用例时,具体用于:In an optional implementation manner, when the second use case determination submodule 30322 determines multiple target test cases among the multiple test cases based on the influence value corresponding to each test case, it is specifically used to :
按照所述每个测试用例对应的影响度值,对所述多个测试用例进行排序,得到测试用例顺序;According to the degree of influence value corresponding to each test case, sort the plurality of test cases to obtain the order of the test cases;
基于所述测试用例顺序在所述多个测试用例中确定出多个目标测试用例。A plurality of target test cases are determined among the plurality of test cases based on the order of the test cases.
进一步的,本发明实施例还提供一种存储介质,所述存储介质用于存储计算机程序,其中,所述计算机程序运行时控制所述存储介质所在设备执行上述图1-2中所述的软件回归测试方法。Furthermore, an embodiment of the present invention also provides a storage medium, the storage medium is used to store a computer program, wherein, when the computer program runs, the device where the storage medium is located is controlled to execute the software described in the above-mentioned Figures 1-2 Regression testing method.
进一步的,本发明实施例还提供一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述图1-2中所述的软件回归测试方法。Further, an embodiment of the present invention also provides a processor, the processor is used to run a program, wherein, when the program is running, the software regression testing method described in the foregoing FIGS. 1-2 is executed.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
可以理解的是,上述方法及装置中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。It can be understood that related features in the above methods and devices can refer to each other. In addition, "first", "second" and so on in the above embodiments are used to distinguish each embodiment, and do not represent the advantages and disadvantages of each embodiment.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the contents of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
此外,存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。In addition, memory may include non-permanent memory on computer-readable media, in the form of random access memory (RAM) and/or nonvolatile memory, such as read-only memory (ROM) or flash RAM, memory including at least one memory chip.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a Means for realizing the functions specified in one or more steps of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory capable of directing a computer or other programmable data processing equipment to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means that implement the functions specified in one or more flows of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart flow or flows and/or block diagram block or blocks.
在一个典型的配置中,计算设备包括一个或多个处理器 (CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. The memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存 (PRAM)、静态随机存取存储器 (SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器 (RAM)、只读存储器 (ROM)、电可擦除可编程只读存储器 (EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘 (DVD) 或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310787869.4ACN116501653B (en) | 2023-06-30 | 2023-06-30 | Software regression testing method and device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310787869.4ACN116501653B (en) | 2023-06-30 | 2023-06-30 | Software regression testing method and device |
| Publication Number | Publication Date |
|---|---|
| CN116501653Atrue CN116501653A (en) | 2023-07-28 |
| CN116501653B CN116501653B (en) | 2023-10-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310787869.4AActiveCN116501653B (en) | 2023-06-30 | 2023-06-30 | Software regression testing method and device |
| Country | Link |
|---|---|
| CN (1) | CN116501653B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107515826A (en)* | 2017-08-28 | 2017-12-26 | 广州阿里巴巴文学信息技术有限公司 | Test case accurate recommendation method, device, system, equipment and storage medium |
| CN108920353A (en)* | 2018-04-03 | 2018-11-30 | 郑州云海信息技术有限公司 | A kind of test method, device and electronic equipment |
| CN109783382A (en)* | 2019-01-07 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of test method and system based on accurate test platform |
| US10318412B1 (en)* | 2018-06-29 | 2019-06-11 | The Travelers Indemnity Company | Systems, methods, and apparatus for dynamic software generation and testing |
| CN111209206A (en)* | 2020-01-13 | 2020-05-29 | 卡斯柯信号(北京)有限公司 | A method and system for automatic testing of software products |
| CN111611154A (en)* | 2019-02-26 | 2020-09-01 | 北京新能源汽车股份有限公司 | Regression testing method, device and equipment |
| CN116257422A (en)* | 2021-12-09 | 2023-06-13 | 北京字跳网络技术有限公司 | Self-test use case generation method, device and electronic equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107515826A (en)* | 2017-08-28 | 2017-12-26 | 广州阿里巴巴文学信息技术有限公司 | Test case accurate recommendation method, device, system, equipment and storage medium |
| CN108920353A (en)* | 2018-04-03 | 2018-11-30 | 郑州云海信息技术有限公司 | A kind of test method, device and electronic equipment |
| US10318412B1 (en)* | 2018-06-29 | 2019-06-11 | The Travelers Indemnity Company | Systems, methods, and apparatus for dynamic software generation and testing |
| CN109783382A (en)* | 2019-01-07 | 2019-05-21 | 郑州云海信息技术有限公司 | A kind of test method and system based on accurate test platform |
| CN111611154A (en)* | 2019-02-26 | 2020-09-01 | 北京新能源汽车股份有限公司 | Regression testing method, device and equipment |
| CN111209206A (en)* | 2020-01-13 | 2020-05-29 | 卡斯柯信号(北京)有限公司 | A method and system for automatic testing of software products |
| CN116257422A (en)* | 2021-12-09 | 2023-06-13 | 北京字跳网络技术有限公司 | Self-test use case generation method, device and electronic equipment |
| Title |
|---|
| 朱婷婷;: "基于需求矩阵的软件回归测试方法研究及应用", 软件产业与工程, no. 02* |
| Publication number | Publication date |
|---|---|
| CN116501653B (en) | 2023-10-03 |
| Publication | Publication Date | Title |
|---|---|---|
| US20200136804A1 (en) | Data processing method and apparatus | |
| CN109598407B (en) | Method and device for executing business process | |
| CN111241073A (en) | Data quality inspection method and device | |
| CN108512715B (en) | Load pressure test method of service link and related device | |
| CN109145981B (en) | Deep learning automatic model training method and equipment | |
| CN113095832A (en) | Multi-party account checking method, device, storage medium and computer equipment | |
| CN113886162A (en) | Computing equipment performance test method, computing equipment and storage medium | |
| CN114817209A (en) | Processing method and device, processor and electronic device for monitoring rules | |
| CN107832446A (en) | A kind of searching method and computing device of configuration item information | |
| CN108833592A (en) | Cloud host schedules device optimization method, device, equipment and storage medium | |
| US10229005B2 (en) | Pattern based configuration method for minimizing the impact of component failures | |
| CN111459474B (en) | Templated data processing method and device | |
| CN116501653A (en) | A software regression testing method and device | |
| CN113641592A (en) | Test sequence generation method and device | |
| CN118446744A (en) | Equity data conversion method and system based on artificial intelligence | |
| CN117687920A (en) | Interface testing method and device, storage medium and electronic equipment | |
| US8359456B2 (en) | Generating random addresses for verification of distributed computerized devices | |
| CN112651199B (en) | Quality Verification Platform and Quality Verification Method | |
| CN116909526A (en) | Method and device for processing dependent package, electronic equipment and readable storage medium | |
| CN108121733A (en) | The querying method and device of a kind of data | |
| CN111367461B (en) | A storage space management method and device | |
| CN111352845A (en) | Test sequence scene generation method and device | |
| CN114817859B (en) | Histogram processing method, device and computer readable storage medium | |
| CN117827644B (en) | Automated testing method and automated testing device | |
| JP2015036839A (en) | Processor test instruction sequence generation method, processor test instruction sequence generation program, and processor test instruction sequence generation device |
| 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 |