[go: up one dir, main page]

CN109783358B - A regression test-driven software version management method, system and storage medium - Google Patents

A regression test-driven software version management method, system and storage medium Download PDF

Info

Publication number
CN109783358B
CN109783358B CN201811535329.2A CN201811535329A CN109783358B CN 109783358 B CN109783358 B CN 109783358B CN 201811535329 A CN201811535329 A CN 201811535329A CN 109783358 B CN109783358 B CN 109783358B
Authority
CN
China
Prior art keywords
test
software
version
source program
program
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.)
Active
Application number
CN201811535329.2A
Other languages
Chinese (zh)
Other versions
CN109783358A (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.)
State Grid Jiangsu Electric Power Co Ltd
NARI Group Corp
NARI Information and Communication Technology Co
State Grid Corp of China SGCC
Original Assignee
State Grid Jiangsu Electric Power Co Ltd
NARI Group Corp
NARI Information and Communication Technology Co
State Grid Corp of China SGCC
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 State Grid Jiangsu Electric Power Co Ltd, NARI Group Corp, NARI Information and Communication Technology Co, State Grid Corp of China SGCC filed Critical State Grid Jiangsu Electric Power Co Ltd
Priority to CN201811535329.2A priority Critical patent/CN109783358B/en
Publication of CN109783358A publication Critical patent/CN109783358A/en
Application granted granted Critical
Publication of CN109783358B publication Critical patent/CN109783358B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种回归测试驱动的软件版本管理方法、系统及存储介质,所述方法:采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;计算测试程序的校验文件和版本号,结合新提交源程序的校验文件和版本号生成新版本软件。本发明能够有效解决当前SVM工具难以有效支持测试代码的管理、回归测试信息无法充分利用的难题,进而帮助研发人员提高软件版本管理质量,提高软件产品研发效率。

Figure 201811535329

The invention discloses a regression test-driven software version management method, system and storage medium. The method includes the use of available test cases in the test program corresponding to the previous version of the software source program to perform a first-stage verification on a newly submitted source program , to obtain the first coverage result; according to the first coverage result, automatically generate test cases for the newly submitted source program; use the generated test cases to perform the second-stage verification of the newly submitted source program, and obtain the second coverage result; According to the results of the second coverage, write new test cases and generate the test program of the newly submitted source program; calculate the verification file and version number of the test program, and combine the verification file and version number of the newly submitted source program to generate a new version of the software. The present invention can effectively solve the problems that the current SVM tool cannot effectively support the management of test codes and the regression test information cannot be fully utilized, thereby helping the research and development personnel to improve the quality of software version management and improve the research and development efficiency of software products.

Figure 201811535329

Description

一种回归测试驱动的软件版本管理方法、系统及存储介质A regression test-driven software version management method, system and storage medium

技术领域technical field

本发明涉及一种回归测试驱动的软件版本管理方法、系统及存储介质,属于软件演化分析技术领域。The invention relates to a regression test-driven software version management method, system and storage medium, and belongs to the technical field of software evolution analysis.

背景技术Background technique

传统软件开发过程规定了软件开发的固定模式,如瀑布模型将软件开发过程划分为计划制定、需求分析、软件设计、程序编写、软件测试、运行维护等六个基本阶段,研发人员按序依次完成。然而,随着软件行业的快速发展,软件规模越来越大、复杂程序越来越高,软件开发周期、开发成本失控的问题日益严重。此时,强调迭代式开发、增量交付、持续集成、反馈推动的敏捷开发模型应运而生,并凭借其快速研发、快速交付、快速响应能力得到了业界的广泛认可。在敏捷开发过程中,一个大项目可能会被分解为多个相互联系、可独立运行的子项目分别开发,在开发时遇到需求改变会要求研发人员主动拥抱变化,由此会产生多个不同形式的软件版本。此时,需要应用软件版本管理工具SVM(Software VersionManagement,软件版本管理)进行记录和管理,来帮助研发人员更好地了解软件在不同时期的功能和性能。The traditional software development process stipulates a fixed mode of software development. For example, the waterfall model divides the software development process into six basic stages, including plan formulation, requirements analysis, software design, program writing, software testing, and operation and maintenance. . However, with the rapid development of the software industry, the scale of software is getting larger and the complexity of the program is getting higher and higher, and the problem of software development cycle and development cost out of control is becoming more and more serious. At this time, the agile development model, which emphasizes iterative development, incremental delivery, continuous integration, and feedback-driven development, came into being, and has been widely recognized by the industry for its rapid R&D, rapid delivery, and rapid response capabilities. In the process of agile development, a large project may be decomposed into multiple sub-projects that are interconnected and can run independently. During development, when requirements change, developers will be required to actively embrace the changes, which will result in many different form of the software version. At this time, it is necessary to apply the software version management tool SVM (Software Version Management, software version management) to record and manage, to help the R&D personnel to better understand the functions and performance of the software in different periods.

目前,软件版本管理已经成为当前软件研发过程中的重要组成部分,学术界和工业界也相继提出了多种软件版本管理方法,并研发了多种成熟的SVM工具(如CVS、SVN、Git等)。通过SVM工具,研发人员可以存储目录和文件的修改历史、支持软件的配置管理活动、追踪多个版本的开发和维护活动、发布软件的相关信息,这些功能对提高软件产品的研发效率起到了至关重要的作用。然而,虽然当前SVM工具已对软件源程序的管理提供了很好的支持,但对软件所包含测试代码的管理还未提供有效的支持。传统SVM工具大多将测试代码看作为软件源程序的一部分,研发人员需要自己维护每个软件版本的测试代码;此外在新版本提交时,由于功能更改、错误修正、格式调整等原因,前一版本的测试用例可能存在不可用、不充足等情况,需要人工对其进行修正和补充、耗时费力。At present, software version management has become an important part of the current software development process. Academia and industry have also proposed a variety of software version management methods, and developed a variety of mature SVM tools (such as CVS, SVN, Git, etc. ). Through the SVM tool, developers can store the modification history of directories and files, support software configuration management activities, track the development and maintenance activities of multiple versions, and release software-related information. These functions play an important role in improving the development efficiency of software products. important role. However, although the current SVM tools have provided good support for the management of software source programs, they have not yet provided effective support for the management of the test codes contained in the software. Most of the traditional SVM tools regard the test code as part of the software source program, and developers need to maintain the test code of each software version; The test cases of the test cases may be unavailable, insufficient, etc., which need to be corrected and supplemented manually, which is time-consuming and labor-intensive.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有技术中的不足,提供一种回归测试驱动的软件版本管理方法、系统及存储介质,能够有效解决当前SVM工具难以有效支持测试代码的管理、回归测试信息无法充分利用的难题,进而帮助研发人员提高软件版本管理质量,提高软件产品研发效率。The purpose of the present invention is to overcome the deficiencies in the prior art, and to provide a regression test-driven software version management method, system and storage medium, which can effectively solve the problem that current SVM tools cannot effectively support the management of test codes, and regression test information cannot be fully utilized. It can help R&D personnel to improve the quality of software version management and improve the efficiency of software product development.

为达到上述目的,本发明是采用下述技术方案实现的:To achieve the above object, the present invention adopts the following technical solutions to realize:

第一方面,本发明提供了一种回归测试驱动的软件版本管理方法,所述方法包括如下步骤:In a first aspect, the present invention provides a regression test-driven software version management method, the method comprising the following steps:

采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;Use the available test cases in the test program corresponding to the previous version of the software source program to perform the first-stage verification of the newly submitted source program, and obtain the first coverage result;

根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;According to the first coverage results, automatically generate test cases for the newly submitted source program;

采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;Use the generated test case to perform the second-stage verification on the newly submitted source program, and obtain the second coverage result;

根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;According to the second coverage results, write new test cases and generate test programs for newly submitted source programs;

计算测试程序的校验文件和版本号,结合新提交源程序的校验文件和版本号生成新版本软件。Calculate the verification file and version number of the test program, and generate a new version of the software in combination with the verification file and version number of the newly submitted source program.

结合第一方面,进一步的,所述可用测试用例的获取方法包括:With reference to the first aspect, further, the method for obtaining the available test cases includes:

根据给定的软件仓库和当前软件版本的源程序,查找前一软件版本的测试用例;Find the test case of the previous software version according to the given software repository and the source program of the current software version;

对前一软件版本的测试用例进行可用性分析,将分析获取的可用测试用例作为新版本软件源程序的可用测试用例。The usability analysis is performed on the test cases of the previous software version, and the available test cases obtained by the analysis are used as the available test cases for the source program of the new version software.

结合第一方面,进一步的,所述第二阶段验证的方法包括:In conjunction with the first aspect, further, the method for the second stage verification includes:

以给定的当前软件版本的源程序、第一次覆盖结果和最大窗口宽度,该宽度用于限定测试自动生成结果的最大数目,以第一次覆盖结果以外的语句作为测试目标,生成基于随机策略的异常错误测试用例;Given the source program of the current software version, the first coverage result and the maximum window width, the width is used to limit the maximum number of results automatically generated by the test, and the statement other than the first coverage result is used as the test target. Exception error test cases for strategies;

采用所述异常错误测试用例检测新提交源程序所包含的异常错误。The abnormal error test case is used to detect the abnormal error contained in the newly submitted source program.

结合第一方面,进一步的,若所述新提交源程序未能通过第一阶段验证或第二阶段验证,则返回修改所述新版本软件源程序。With reference to the first aspect, further, if the newly submitted source program fails to pass the first-stage verification or the second-stage verification, return to modify the new version of the software source program.

结合第一方面,进一步的,生成所述新版本软件的方法包括:In conjunction with the first aspect, further, the method for generating the new version software includes:

采用Checksum算法分别计算测试程序二进制版本的总校验和、新版本软件源程序二进制版本的总校验和,并由此生成测试程序的校验文件、新版本软件源程序的校验文件;The Checksum algorithm is used to calculate the total checksum of the binary version of the test program and the total checksum of the binary version of the new version of the software source program, and thereby generate the checksum file of the test program and the checksum file of the new version of the software source program;

根据测试程序的校验文件、新版本软件源程序的校验文件生成新版本软件校验文件;Generate the new version software verification file according to the verification file of the test program and the verification file of the new version software source program;

采用GNU或Windows或.Net Framework风格制订测试程序的版本号、新版本软件源程序的版本号;Use GNU or Windows or .Net Framework style to formulate the version number of the test program and the version number of the new version software source program;

将测试程序的版本号、新版本软件源程序的版本号相结合生成新版本软件版本号;Combine the version number of the test program and the version number of the new version software source program to generate the new version software version number;

根据新版本软件校验文件、新版本软件版本号生成新版本软件。Generate a new version of the software according to the new version of the software verification file and the new version of the software version number.

结合第一方面,进一步的,所述校验文件中包括奇偶校验码、异或校验码、CRC校验码、LRC校验码、格雷码校验码、MD5校验码。With reference to the first aspect, further, the check file includes parity check code, XOR check code, CRC check code, LRC check code, Gray code check code, and MD5 check code.

第二方面,本发明实施例提供了一种回归测试驱动的软件版本管理系统,其特征在于,所述系统包括:In a second aspect, an embodiment of the present invention provides a regression test-driven software version management system, wherein the system includes:

第一验证模块:用于采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;The first verification module is used to perform the first-stage verification on the newly submitted source program by using the available test cases in the test program corresponding to the software source program of the previous version, and obtain the first coverage result;

测试用例生成模块:用于根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;Test case generation module: It is used to automatically generate test cases for newly submitted source programs according to the first coverage results;

第二验证模块:用于采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;The second verification module: used to use the generated test case to perform the second-stage verification on the newly submitted source program, and obtain the second coverage result;

编写模块:用于根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;Writing module: It is used to write new test cases and generate test programs for newly submitted source programs according to the results of the second coverage;

计算模块:用于计算测试程序的校验文件和版本号;Calculation module: used to calculate the verification file and version number of the test program;

新版本软件生成模块:用于根据测试程序的校验文件和版本号、新提交源程序的校验文件和版本号生成新版本软件。New version software generation module: used to generate new version software according to the verification file and version number of the test program, and the verification file and version number of the newly submitted source program.

第三方面,本发明实施例还提供了一种回归测试驱动的软件版本管理系统,包括处理器及存储介质;In a third aspect, an embodiment of the present invention further provides a regression test-driven software version management system, including a processor and a storage medium;

所述存储介质用于存储指令;the storage medium is used for storing instructions;

所述处理器用于根据所述指令进行操作以执行根据前述方法的步骤。The processor is adapted to operate in accordance with the instructions to perform steps in accordance with the aforementioned method.

第四方面,本发明实施例提供了计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现前述方法的步骤。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the foregoing method are implemented.

综上,本发明实施例提供的回归测试驱动的软件版本管理方法、系统及存储介质,能够有效解决当前SVM工具难以有效支持测试代码的管理、回归测试信息无法充分利用的难题,进而帮助研发人员提高软件版本管理质量,提高软件产品研发效率。To sum up, the regression test-driven software version management method, system, and storage medium provided by the embodiments of the present invention can effectively solve the problems that current SVM tools cannot effectively support the management of test codes and regression test information cannot be fully utilized, thereby helping R&D personnel Improve the quality of software version management and improve the efficiency of software product development.

附图说明Description of drawings

图1是本发明实施提供的一种回归测试驱动的软件版本管理方法的流程图;1 is a flowchart of a regression test-driven software version management method provided by the implementation of the present invention;

图2是图1中软件版本自动验证方法的流程图;Fig. 2 is the flow chart of software version automatic verification method among Fig. 1;

图3是图1中测试用例自动生成方法的流程图;Fig. 3 is the flow chart of the test case automatic generation method in Fig. 1;

图4是图1中测试版本自动管理方法的流程图;Fig. 4 is the flow chart of test version automatic management method among Fig. 1;

图5是图1中软件版本自动管理方法的流程图。FIG. 5 is a flowchart of the method for automatic management of software versions in FIG. 1 .

具体实施方式Detailed ways

下面结合附图对本发明作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。The present invention will be further described below in conjunction with the accompanying drawings. The following examples are only used to illustrate the technical solutions of the present invention more clearly, and cannot be used to limit the protection scope of the present invention.

图1为本发明实施提供的一种回归测试驱动的软件版本管理方法的流程图,包括如下步骤:1 is a flowchart of a regression test-driven software version management method provided by the implementation of the present invention, comprising the following steps:

Step1软件版本自动验证:针对用户新提交的源程序版本,分析该版本前一版本源程序所对应测试程序中的可用测试用例,并用其检测新提交源程序中的缺陷:若存在缺陷,则表明源程序存在问题,需要修改后重新提交;否则表明源程序通过第一阶段验证,此时输出可用测试用例及其覆盖信息,用以指导下一阶段测试自动生成。Step1 Automatic verification of software version: For the source program version newly submitted by the user, analyze the available test cases in the test program corresponding to the source program of the previous version of this version, and use it to detect the defects in the newly submitted source program: if there is a defect, it indicates that If there is a problem with the source program, it needs to be modified and resubmitted; otherwise, it means that the source program has passed the first-stage verification, and the available test cases and their coverage information are output at this time to guide the automatic generation of the next-stage test.

Step2测试用例自动生成:以上一步未覆盖语句为测试目标针对新提交源程序开展测试自动生成,在生成的同时不断执行新生成的测试用例,用以观察新提交源程序是否发生异常错误:若发生异常,则表明源程序存在问题,需要修改后重新提交;否则表明源程序通过第二阶段验证,此时输出新生成的测试用例及覆盖信息,用以指导下一阶段测试用例编写。在测试自动生成过程中,以前一阶段未覆盖结果的满足情况构建停止准则。Step2 Automatic generation of test cases: The non-covered statement in the previous step is the test target to automatically generate tests for the newly submitted source program, and continuously execute the newly generated test cases while generating to observe whether an abnormal error occurs in the newly submitted source program: if it occurs If it is abnormal, it indicates that there is a problem with the source program and needs to be modified and resubmitted; otherwise, it indicates that the source program has passed the second-stage verification, and the newly generated test case and coverage information are output to guide the next stage of test case writing. During automatic test generation, the satisfaction of results not covered by the previous stage builds stopping criteria.

Step3测试版本自动管理:以前两步未覆盖语句作为测试目标针对新提交源程序进行测试用例编写,在编写的同时不断执行新生成的测试用例,用以检测新提交源程序中的缺陷:若存在缺陷,则表明源程序存在问题,需要修改后重新提交;否则表明源程序通过第三阶段验证,此时基于前两步生成测试用例生成新的测试程序,并计算测试程序的校验码,输出测试程序的校验文件。Step3: Automatic management of test versions: The non-covered statements in the previous two steps are used as test targets to write test cases for the newly submitted source program, and the newly generated test cases are continuously executed while writing to detect defects in the newly submitted source program: if there is any Defects, it indicates that there is a problem with the source program and needs to be modified and resubmitted; otherwise, it indicates that the source program has passed the third-stage verification. At this time, a new test program is generated based on the test cases generated in the first two steps, and the check code of the test program is calculated and output. Checkout file for the test program.

Step4软件版本自动管理:计算生成新提交源程序的版本号,并协同测试程序版本号生成软件的版本号;分析生成新提交源程序的校验文件,并协同测试程序的校验文件生成软件的校验文件;软件版本号、校验文件生成后,连同新提交源程序及其对应的测试程序保存至软件仓库中,完成软件新版本的生成和注册。Step4 Automatic management of software version: Calculate and generate the version number of the newly submitted source program, and cooperate with the test program version number to generate the software version number; analyze and generate the verification file of the newly submitted source program, and cooperate with the verification file of the test program to generate the software version number. Verification file: After the software version number and verification file are generated, they are saved in the software warehouse together with the newly submitted source program and its corresponding test program to complete the generation and registration of the new version of the software.

图2为软件版本自动验证的流程图。针对新提交的源程序版本,通过分析前一版本对应的测试程序识别新提交源程序可用的测试用例,对其进行执行来自动验证新提交的源程序,同时生成覆盖信息为测试自动生成提供指导。具体步骤如下:Fig. 2 is a flow chart of automatic verification of software version. For the newly submitted source program version, identify the test cases available for the newly submitted source program by analyzing the test program corresponding to the previous version, execute them to automatically verify the newly submitted source program, and generate coverage information to provide guidance for automatic test generation. . Specific steps are as follows:

步骤1:起始状态;Step 1: initial state;

步骤2:输入软件仓库SR、源程序的当前版本Pi;Step 2: Enter the software repository SR and the current version Pi of the source program;

步骤3:判断Pi是否为初始版本P0,若是则执行步骤4,否则执行步骤6;Step 3: determine whether Pi is the initial version P0, if so, go to step 4, otherwise go to step 6;

步骤4:初始化测试用例集Toldi为空NULL;Step 4: Initialize the test case set Toldi as NULL;

步骤5:初始化Toldi的覆盖信息cov(Toldi)为空NULL,执行步骤10;Step 5: Initialize the coverage information cov(Toldi) of Toldi to NULL, and execute Step 10;

步骤6:从SR中取出Pi前一版本所在软件版本Vi-1=<IDVi-1,Pi-1,Ti-1,CC_FILE_Vi-1>,IDVi-1、Pi-1、Ti-1、CC_FILE_Vi-1分别表示Vi-1的版本号、源程序、测试程序和校验文件;Step 6: Take out the software version Vi-1 of the previous version of Pi from the SR = <IDVi-1, Pi-1, Ti-1, CC_FILE_Vi-1>, IDVi-1, Pi-1, Ti-1, CC_FILE_Vi- 1 represents the version number, source program, test program and verification file of Vi-1 respectively;

步骤7:在Ti-1中识别所有Pi可用的测试用例构成Toldi;Step 7: Identify all Pi available test cases in Ti-1 to form Toldi;

步骤8:应用Pi执行Toldi,根据执行结果将Toldi进一步划分为成功测试用例集Told_passedi和失败测试用例集Told_failedi,并记录Toldi的覆盖信息;Step 8: Apply Pi to execute Toldi, further divide Toldi into successful test case set Told_passedi and failed test case set Told_failedi according to the execution result, and record the coverage information of Toldi;

步骤9:判断Told_failedi中内容是否为空NULL,若是则执行步骤10,否则执行步骤11;Step 9: Determine whether the content in Told_failedi is NULL, if so, go to Step 10, otherwise go to Step 11;

步骤10:Pi通过第1阶段验证,输出Toldi和cov(Toldi),执行步骤12;Step 10: Pi passes the first stage verification, outputs Toldi and cov(Toldi), and executes Step 12;

步骤11:Pi未通过第1阶段验证,输出Told_failedi;Step 11: Pi fails Phase 1 verification, output Told_failedi;

步骤12:结束状态。Step 12: End state.

图3为测试用例自动生成的流程图。以前一版本测试程序未能覆盖的代码区域作为测试目标开展测试自动生成,并在同时利用新生成程序开展新版本源程序的异常错误检测,记录自动生成测试用例的覆盖信息。在测试生成时以代码覆盖情况构建停止准则。具体步骤如下:Figure 3 is a flow chart of automatic generation of test cases. The code area not covered by the previous version of the test program is used as the test target to carry out automatic test generation, and at the same time, the new generation program is used to carry out abnormal error detection of the source program of the new version, and the coverage information of the automatically generated test case is recorded. Build stopping criteria with code coverage at test generation time. Specific steps are as follows:

步骤1:起始状态;Step 1: initial state;

步骤2:输入源程序的当前版本Pi、Pi在Toldi上的覆盖信息cov(Toldi)和窗口宽度window;Step 2: Input the current version Pi of the source program, the coverage information cov(Toldi) of Pi on Toldi and the window width window;

步骤3:计算Pi中未覆盖的代码区域uncov(Toldi);Step 3: Calculate the uncovered code area uncov(Toldi) in Pi;

步骤4:初始化测试用例集Tnew_autoi为空NULL,初始化覆盖序列listcov=<cov1,cov2,…,covwindow>中各个元素的值为空;Step 4: Initialize the test case set Tnew_autoi to be NULL, and initialize the value of each element in the coverage sequence listcov=<cov1,cov2,...,covwindow> to be empty;

步骤5:针对Pi随机生成一个测试用例t;Step 5: Randomly generate a test case t for Pi;

步骤6:执行t并计算覆盖信息cov(t);Step 6: Execute t and calculate the coverage information cov(t);

步骤7:判断执行t时是否发生异常,若是则执行步骤14,否则执行步骤8;Step 7: judge whether an abnormality occurs when executing t, if so, go to step 14, otherwise go to step 8;

步骤8:添加t到Tnew_autoi中,即:Tnew_autoi=Tnew_autoi∪{t};Step 8: Add t to Tnew_autoi, namely: Tnew_autoi=Tnew_autoi∪{t};

步骤9:更新覆盖序列listcov;Step 9: Update coverage sequence listcov;

步骤10:判断cov(Tnew_autoi)是否包含了uncov(Toldi)中所有语句,若是则执行步骤13,否则执行步骤11;Step 10: Determine whether cov(Tnew_autoi) contains all the statements in uncov(Toldi), if so, go to step 13, otherwise go to step 11;

步骤11:判断Tnew_autoi中测试用例的数量是否大于window,若是则执行步骤12,否则执行步骤5;Step 11: Determine whether the number of test cases in Tnew_autoi is greater than window, if so, go to Step 12, otherwise go to Step 5;

步骤12:判断listcov中各个元素的值是否相同,若是则执行步骤13,否则执行步骤5;Step 12: Determine whether the values of each element in the listcov are the same, if so, go to step 13, otherwise go to step 5;

步骤13:Pi通过第2阶段验证,输出Tnew_autoi和cov(Tnew_autoi),执行步骤15;Step 13: Pi passes the second stage verification, outputs Tnew_autoi and cov(Tnew_autoi), and executes Step 15;

步骤14:Pi未通过第2阶段验证,输出引发Pi异常的测试用例t;步骤15:结束状态。Step 14: Pi fails the phase 2 verification, output the test case t that causes Pi exception; Step 15: End state.

图4为测试版本自动管理的流程图。以前一版本测试程序和自动生成测试用例未能覆盖的代码区域作为测试目标进行测试用例编写,并用此检测新提交源程序中的缺陷。源程序验证通过后,组合生成新提交源程序对应的测试程序及其版本号和校验文件。具体步骤如下:Figure 4 is a flow chart of automatic management of test versions. The code areas not covered by the previous version of the test program and automatically generated test cases are used as test targets to write test cases, and use this to detect defects in the newly submitted source program. After the verification of the source program is passed, the test program corresponding to the newly submitted source program, its version number and the verification file are generated in combination. Specific steps are as follows:

步骤1:起始状态;Step 1: initial state;

步骤2:输入源程序的当前版本Pi、前一版本可用的测试用例Toldi及覆盖信息cov(Toldi)和自动生成的测试用例Tnew_autoi及覆盖信息cov(Tnew_autoi);Step 2: Input the current version Pi of the source program, the test case Toldi available in the previous version, the coverage information cov (Toldi), and the automatically generated test case Tnew_autoi and the coverage information cov (Tnew_autoi);

步骤3:计算Pi中未覆盖的代码区域uncov(Toldi∪Tnew_autoi);Step 3: Calculate the uncovered code area uncov(Toldi∪Tnew_autoi) in Pi;

步骤4:以uncov(Toldi∪Tnew_autoi)作为测试目标针对Pi编写新的测试用例Tnew_manuali;Step 4: Write a new test case Tnew_manuali for Pi with uncov(Toldi∪Tnew_autoi) as the test target;

步骤5:应用Pi执行Tnew_manuali,根据执行结果将Tnew_manuali进一步分为成功测试用例集Tnew_manual_passedi和失败测试用例集Tnew_manual_failedi;Step 5: Apply Pi to execute Tnew_manuali, and further divide Tnew_manuali into a successful test case set Tnew_manual_passedi and a failed test case set Tnew_manual_failedi according to the execution result;

步骤6:判断Tnew_manual_failedi是否为空NULL,若是则执行步骤7,否则执行步骤12;Step 6: Determine whether Tnew_manual_failedi is NULL, if so, go to Step 7, otherwise go to Step 12;

步骤7:将Toldi、Tnew_autoi和Tnew_manuali合并生成Pi对应的测试程序Ti;Step 7: Combine Toldi, Tnew_autoi and Tnew_manuali to generate the test program Ti corresponding to Pi;

步骤8:采用GNU、Windows、.Net Framework等风格制订测试程序Ti的版本号IDTi;Step 8: Use GNU, Windows, .Net Framework and other styles to formulate the version number IDTi of the test program Ti;

步骤9:采用奇偶校验、异或校验、CRC校验、LRC校验、格雷码校验、MD5校验等方式生成Toldi、Tnew_autoi、Tnew_manuali等文件的校验码;Step 9: Generate check codes of files such as Toldi, Tnew_autoi, Tnew_manuali, etc. by means of parity check, XOR check, CRC check, LRC check, Gray code check, MD5 check, etc.;

步骤10:采用Checksum算法计算Ti二进制版本的总校验和,并由此生成Ti的校验文件CC_FILE_Ti,其内容包括Toldi、Tnew_autoi、Tnew_manuali、Ti等文件的校验码;Step 10: adopt the Checksum algorithm to calculate the total checksum of the binary version of Ti, and thus generate a check file CC_FILE_Ti of Ti, the content of which includes the check codes of files such as Toldi, Tnew_autoi, Tnew_manuali, and Ti;

步骤11:Pi通过第3阶段验证,输出Ti、IDTi和CC_FILE_Ti,执行步骤13;Step 11: Pi passes the third stage verification, outputs Ti, IDTi and CC_FILE_Ti, and executes step 13;

步骤12:Pi未通过第3阶段验证,输出Tnew_manual_failedi;步骤13:结束状态。Step 12: Pi fails the third stage verification, output Tnew_manual_failedi; Step 13: End state.

图5为软件版本自动管理的流程图。分析生成新提交源程序的版本号,并协同测试程序的版本号生成新版本软件的版本号;分析生成新提交源程序的校验文件,并协同测试程序的校验文件生成新版本软件的校验文件;添加新版本至软件仓库中,完成软件新版本的注册和发布。具体步骤如下:FIG. 5 is a flowchart of automatic management of software versions. Analyze and generate the version number of the newly submitted source program, and cooperate with the version number of the test program to generate the version number of the new version software; analyze and generate the verification file of the newly submitted source program, and cooperate with the verification file of the test program to generate the verification file of the new version software. Verify files; add new versions to the software repository, and complete the registration and release of new software versions. Specific steps are as follows:

步骤1:起始状态;Step 1: initial state;

步骤2:输入源程序的当前版本Pi及对应测试程序Ti、测试程序版本号IDTi和校验文件CC_FILE_Ti;Step 2: Input the current version Pi of the source program and the corresponding test program Ti, the test program version number IDTi and the verification file CC_FILE_Ti;

步骤3:采用GNU、Windows、.Net Framework等风格制订源程序的版本号IDPi;Step 3: Use GNU, Windows, .Net Framework and other styles to formulate the version number IDPi of the source program;

步骤4:将源程序版本号和测试程序版本号组合生成软件版本号IDVi=<IDPi,IDTi>;Step 4: combine the source program version number and the test program version number to generate the software version number IDVi=<IDPi, IDTi>;

步骤5:采用Checksum算法计算Pi二进制版本的总校验和,并由此生成Pi的校验文件CC_FILE_Pi,其内容包括CC_FILE_Pi等文件的校验码;Step 5: adopt the Checksum algorithm to calculate the total checksum of the Pi binary version, and thereby generate the check file CC_FILE_Pi of the Pi, and its content includes the check codes of files such as CC_FILE_Pi;

步骤6:将CC_FILE_Pi和CC_FILE_Ti中内容组合生成软件版本Vi的校验文件CC_FILE_Vi,其内容包括Pi、Toldi、Tnew_autoi、Tnew_manuali、Ti等文件的校验码;Step 6: Combine the contents in CC_FILE_Pi and CC_FILE_Ti to generate the verification file CC_FILE_Vi of the software version Vi, and its contents include the verification codes of Pi, Toldi, Tnew_autoi, Tnew_manuali, Ti and other files;

步骤7:将软件版本Vi=<IDPi、Pi、Ti、CC_FILE_Vi>添加到软件仓库SR中;Step 7: Add the software version Vi=<IDPi, Pi, Ti, CC_FILE_Vi> to the software repository SR;

步骤8:输出当前软件仓库SR和软件版本Vi;Step 8: Output the current software repository SR and software version Vi;

步骤9:结束状态。Step 9: End state.

综上所述,本发明解决了当前SVM工具难以有效支持测试代码的管理、回归测试信息未充分利用的难题,从而能增强SVM工具软件产品功能,帮助研发人员提升软件版本管理质量,最终起到了提高软件产品研发效率和保障软件产品质量的目的。To sum up, the present invention solves the problems that the current SVM tool cannot effectively support the management of test codes and the regression test information is not fully utilized, thereby enhancing the function of the SVM tool software product, helping the R&D personnel to improve the quality of software version management, and finally playing the role of The purpose of improving the research and development efficiency of software products and ensuring the quality of software products.

本发明实施例还提供了一种回归测试驱动的软件版本管理系统,所述系统能够用于执行前述的回归测试驱动的软件版本管理方法,包括:An embodiment of the present invention further provides a regression test-driven software version management system, the system can be used to execute the foregoing regression test-driven software version management method, including:

第一验证模块:用于采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;The first verification module is used to perform the first-stage verification on the newly submitted source program by using the available test cases in the test program corresponding to the software source program of the previous version, and obtain the first coverage result;

测试用例生成模块:用于根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;Test case generation module: It is used to automatically generate test cases for newly submitted source programs according to the first coverage results;

第二验证模块:用于采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;The second verification module: used to use the generated test case to perform the second-stage verification on the newly submitted source program, and obtain the second coverage result;

编写模块:用于根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;Writing module: It is used to write new test cases and generate test programs for newly submitted source programs according to the results of the second coverage;

计算模块:用于计算测试程序的校验文件和版本号;Calculation module: used to calculate the verification file and version number of the test program;

新版本软件生成模块:用于根据测试程序的校验文件和版本号、新提交源程序的校验文件和版本号生成新版本软件。New version software generation module: used to generate new version software according to the verification file and version number of the test program, and the verification file and version number of the newly submitted source program.

本发明实施例还提供了一种回归测试驱动的软件版本管理系统,也能够用于执行前述的回归测试驱动的软件版本管理方法,包括处理器及存储介质;The embodiment of the present invention also provides a regression test-driven software version management system, which can also be used to execute the foregoing regression test-driven software version management method, including a processor and a storage medium;

所述存储介质用于存储指令;the storage medium is used for storing instructions;

所述处理器用于根据所述指令进行操作以执行根据前述方法的步骤。The processor is adapted to operate in accordance with the instructions to perform steps in accordance with the aforementioned method.

本发明实施例还提供了计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前述方法的步骤。Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, implements the steps of the foregoing method.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变形,这些改进和变形也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the technical principle of the present invention, several improvements and modifications can be made. These improvements and modifications It should also be regarded as the protection scope of the present invention.

Claims (8)

1.一种回归测试驱动的软件版本管理方法,其特征在于,所述方法包括如下步骤:1. a software version management method driven by regression test, is characterized in that, described method comprises the steps: 采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;Use the available test cases in the test program corresponding to the previous version of the software source program to perform the first-stage verification of the newly submitted source program, and obtain the first coverage result; 根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;According to the first coverage results, automatically generate test cases for the newly submitted source program; 采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;Use the generated test case to perform the second-stage verification on the newly submitted source program, and obtain the second coverage result; 根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;According to the second coverage results, write new test cases and generate test programs for newly submitted source programs; 计算测试程序的校验文件和版本号,结合新提交源程序的校验文件和版本号生成新版本软件;Calculate the verification file and version number of the test program, and generate a new version of the software in combination with the verification file and version number of the newly submitted source program; 所述第二阶段验证的方法包括:The method for the second stage verification includes: 以给定的当前软件版本的源程序、第一次覆盖结果和最大窗口宽度,该宽度用于限定测试自动生成结果的最大数目,以第一次覆盖结果以外的语句作为测试目标,生成基于随机策略的异常错误测试用例;Given the source program of the current software version, the first coverage result and the maximum window width, the width is used to limit the maximum number of automatically generated results for the test, and the statement other than the first coverage result is used as the test target. Exception error test cases for strategies; 采用所述异常错误测试用例检测新提交源程序所包含的异常错误。The abnormal error test case is used to detect the abnormal error contained in the newly submitted source program. 2.根据权利要求1所述的回归测试驱动的软件版本管理方法,其特征在于,所述可用测试用例的获取方法包括:2. The regression test-driven software version management method according to claim 1, wherein the method for obtaining the available test case comprises: 根据给定的软件仓库和当前软件版本的源程序,查找前一软件版本的测试用例;Find the test case of the previous software version according to the given software repository and the source program of the current software version; 对前一软件版本的测试用例进行可用性分析,将分析获取的可用测试用例作为新版本软件源程序的可用测试用例。The usability analysis is performed on the test cases of the previous software version, and the available test cases obtained by the analysis are used as the available test cases of the new version software source program. 3.根据权利要求1所述的回归测试驱动的软件版本管理方法,其特征在于,若所述新提交源程序未能通过第一阶段验证或第二阶段验证,则返回修改所述新版本软件源程序。3. The software version management method driven by regression testing according to claim 1, characterized in that, if the new submitted source program fails to pass the first stage verification or the second stage verification, then return to modify the new version software source program. 4.根据权利要求1所述的回归测试驱动的软件版本管理方法,其特征在于,生成所述新版本软件的方法包括:4. The software version management method driven by regression testing according to claim 1, wherein the method for generating the new version software comprises: 采用Checksum算法分别计算测试程序二进制版本的总校验和、新版本软件源程序二进制版本的总校验和,并由此生成测试程序的校验文件、新版本软件源程序的校验文件;The Checksum algorithm is used to calculate the total checksum of the binary version of the test program and the total checksum of the binary version of the new version of the software source program, and thereby generate the checksum file of the test program and the checksum file of the new version of the software source program; 根据测试程序的校验文件、新版本软件源程序的校验文件生成新版本软件校验文件;Generate the new version software verification file according to the verification file of the test program and the verification file of the new version software source program; 采用GNU或Windows或.Net Framework风格制订测试程序的版本号、新版本软件源程序的版本号;Use GNU or Windows or .Net Framework style to formulate the version number of the test program and the version number of the new version software source program; 将测试程序的版本号、新版本软件源程序的版本号相结合生成新版本软件版本号;Combine the version number of the test program and the version number of the new version software source program to generate the new version software version number; 根据新版本软件校验文件、新版本软件版本号生成新版本软件。Generate a new version of the software according to the new version of the software verification file and the new version of the software version number. 5.根据权利要求4所述的回归测试驱动的软件版本管理方法,其特征在于,所述校验文件中包括奇偶校验码、异或校验码、CRC校验码、LRC校验码、格雷码校验码、MD5校验码。5. the software version management method driven by regression test according to claim 4, is characterized in that, in described check file, comprises parity check code, XOR check code, CRC check code, LRC check code, Gray code check code, MD5 check code. 6.一种回归测试驱动的软件版本管理系统,其特征在于,所述系统包括:6. A software version management system driven by regression testing, wherein the system comprises: 第一验证模块:用于采用前一版本软件源程序所对应测试程序中的可用测试用例对新提交源程序进行第一阶段验证,获取第一次覆盖结果;The first verification module is used to perform the first-stage verification on the newly submitted source program by using the available test cases in the test program corresponding to the software source program of the previous version, and obtain the first coverage result; 测试用例生成模块:用于根据第一次覆盖结果,对新提交源程序开展测试用例自动生成;Test case generation module: It is used to automatically generate test cases for newly submitted source programs according to the first coverage results; 第二验证模块:用于采用所生成的测试用例对新提交源程序进行第二阶段验证,获取第二次覆盖结果;The second verification module: used to use the generated test case to perform the second-stage verification on the newly submitted source program, and obtain the second coverage result; 编写模块:用于根据第二次覆盖结果,编写新测试用例,生成新提交源程序的测试程序;Writing module: It is used to write new test cases and generate test programs for newly submitted source programs according to the results of the second coverage; 计算模块:用于计算测试程序的校验文件和版本号;Calculation module: used to calculate the verification file and version number of the test program; 新版本软件生成模块:用于根据测试程序的校验文件和版本号、新提交源程序的校验文件和版本号生成新版本软件;New version software generation module: used to generate new version software according to the verification file and version number of the test program, and the verification file and version number of the newly submitted source program; 所述第二阶段验证的方法包括:The method for the second stage verification includes: 以给定的当前软件版本的源程序、第一次覆盖结果和最大窗口宽度,该宽度用于限定测试自动生成结果的最大数目,以第一次覆盖结果以外的语句作为测试目标,生成基于随机策略的异常错误测试用例;Given the source program of the current software version, the first coverage result and the maximum window width, the width is used to limit the maximum number of automatically generated results for the test, and the statement other than the first coverage result is used as the test target. Exception error test cases for strategies; 采用所述异常错误测试用例检测新提交源程序所包含的异常错误。The abnormal error test case is used to detect the abnormal error contained in the newly submitted source program. 7.一种回归测试驱动的软件版本管理系统,其特征在于,包括处理器及存储介质;7. A software version management system driven by regression testing, comprising a processor and a storage medium; 所述存储介质用于存储指令;the storage medium is used for storing instructions; 所述处理器用于根据所述指令进行操作以执行根据权利要求1~5任一项所述方法的步骤。The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1-5. 8.计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1~5任一项所述方法的步骤。8. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
CN201811535329.2A 2018-12-14 2018-12-14 A regression test-driven software version management method, system and storage medium Active CN109783358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811535329.2A CN109783358B (en) 2018-12-14 2018-12-14 A regression test-driven software version management method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811535329.2A CN109783358B (en) 2018-12-14 2018-12-14 A regression test-driven software version management method, system and storage medium

Publications (2)

Publication Number Publication Date
CN109783358A CN109783358A (en) 2019-05-21
CN109783358B true CN109783358B (en) 2022-05-27

Family

ID=66496967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811535329.2A Active CN109783358B (en) 2018-12-14 2018-12-14 A regression test-driven software version management method, system and storage medium

Country Status (1)

Country Link
CN (1) CN109783358B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613894B (en) * 2020-12-31 2024-04-16 中国农业银行股份有限公司 Method and device for associating source code with product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831060A (en) * 2012-08-24 2012-12-19 东南大学 Modification influence analysis based regression test case updating method of part software
CN103123607A (en) * 2013-03-08 2013-05-29 扬州大学 Software regression testing method based on formal conceptual analysis
CN103699385A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Continuous code integration method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9411710B2 (en) * 2014-08-01 2016-08-09 Unisys Corporation Automated regression test case selector and black box test coverage tool for product testing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831060A (en) * 2012-08-24 2012-12-19 东南大学 Modification influence analysis based regression test case updating method of part software
CN103123607A (en) * 2013-03-08 2013-05-29 扬州大学 Software regression testing method based on formal conceptual analysis
CN103699385A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Continuous code integration method

Also Published As

Publication number Publication date
CN109783358A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
Fabijan et al. Chapter 12 The Evolution of Continuous Experimentation in Software Product Development: From Data to a Data-Driven Organization at Scale
US8589882B2 (en) Analyzing computer code development actions and process
US9720971B2 (en) Discovering transformations applied to a source table to generate a target table
Sharma Quantitative analysis of automation and manual testing
CN103279418B (en) A kind of method of testing of configuration control information and device
US9760073B2 (en) Technique and tool for efficient testing of controllers in development
US20150370685A1 (en) Defect localization in software integration tests
CN105930257B (en) A kind of method and device of determining target detection use-case
Rathod et al. Test orchestration a framework for continuous integration and continuous deployment
CN113672506B (en) Dynamic proportion test case sorting and selecting method and system based on machine learning
US7181729B2 (en) Methods and systems for an interactive theorem-proving tool with reflective capabilities
CN107656734A (en) Update method, system, computer-readable recording medium and the storage control of code release information
US9621679B2 (en) Operation task managing apparatus and method
Vishnyakov et al. Sydr-Fuzz: Continuous hybrid fuzzing and dynamic analysis for security development lifecycle
Model Waterfall model
CN109783358B (en) A regression test-driven software version management method, system and storage medium
JP7190246B2 (en) Software failure prediction device
US10019245B2 (en) Resolving an initialization order of static objects
Umudova Analysis of software maintenance phases
CN109814924B (en) A software complexity calculation method
CN113643128B (en) Automatic testing method and device for bank products
CN103593179A (en) Method for developing software in a parallel computing environment
Hewson et al. Performance regression testing on the java virtual machine using statistical test oracles
US20240311282A1 (en) Method for automated analysis of software tests
KR102718865B1 (en) System and method for detecting input anomaly of greenhouse gas emission activity data using pattern-based accuracy enhancement technique, and recording medium recording a computer readable program for executing the method

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