WO2018120965A1 - Automatic test method and device, and computer-readable storage medium - Google Patents

Automatic test method and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2018120965A1
WO2018120965A1 PCT/CN2017/105011 CN2017105011W WO2018120965A1 WO 2018120965 A1 WO2018120965 A1 WO 2018120965A1 CN 2017105011 W CN2017105011 W CN 2017105011W WO 2018120965 A1 WO2018120965 A1 WO 2018120965A1
Authority
WO
WIPO (PCT)
Prior art keywords
software
modified
code
test execution
automated test
Prior art date
Application number
PCT/CN2017/105011
Other languages
French (fr)
Chinese (zh)
Inventor
孙锦程
Original Assignee
上海壹账通金融科技有限公司
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 上海壹账通金融科技有限公司 filed Critical 上海壹账通金融科技有限公司
Publication of WO2018120965A1 publication Critical patent/WO2018120965A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to an automated test method, a computer readable storage medium, and an apparatus.
  • the main object of the present invention is to provide an automated test method, computer readable storage medium and device, which aim to improve the efficiency and cost of automated testing.
  • the present invention provides an automated test method, the method comprising the following steps:
  • test execution script If the software code of the software system is modified, the modified software code is found, and the automation associated with the found modified software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Test execution script;
  • the determined individual automated test execution scripts are run in the software system after the software code is modified, and a test report is generated.
  • the method further comprises:
  • the code is the software code that is invoked during the running of the automated test execution script
  • the determining each of the automatics is run in the software system after the software code is modified Before testing the execution script and generating the test report, it also includes:
  • a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
  • the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system comprises:
  • the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  • the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
  • the present invention also provides an automated testing device, the automated testing device comprising:
  • a first analysis module configured to analyze whether the software code of the software system is modified in real time or timing during the running of the software system
  • a determining module configured to: if the software code of the software system is modified, find the modified software code, and determine and modify the modified software according to the associated data of the pre-saved software code and the automated test execution script An automated test execution script associated with the code;
  • the test module is configured to run the determined individual automated test execution scripts in the software system after the software code is modified, and generate a test report.
  • the automated testing device further comprises:
  • a recording module configured to run each of the automated test execution scripts corresponding to the software system one by one, and analyze and record the software code associated with the automated test execution script during an automated test execution script running, the automated test execution
  • the software code associated with the script is the software code that is invoked during the running of the automated test execution script
  • a save module that holds the associated data of the software code and the automated test execution script.
  • the automated testing device further comprises:
  • a second analysis module configured to analyze whether an automated test execution script associated with the modified software code is determined
  • the reminder module is configured to generate a reminder message if there is no automated test execution script associated with the modified software code to remind the user to add a corresponding automated test execution script for the modified software code.
  • the first analysis module is further configured to:
  • the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  • the test report includes a list of automated test execution scripts in which a test error has occurred Information, and/or, error type information for testing errors.
  • the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the automated test method and apparatus described above.
  • the automated test method, the computer readable storage medium and the device provided by the invention determine the software to be modified through the associated data of the pre-stored software code and the automated test execution script when the software code of the software system is modified.
  • the code is associated with an automated test execution script and runs the determined automated test execution scripts in the software system after the software code is modified to generate a test report. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
  • FIG. 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
  • FIG. 2 is a schematic flow chart of a second embodiment of an automated test method according to the present invention.
  • FIG. 3 is a schematic flow chart of a third embodiment of an automated test method according to the present invention.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of an automated test apparatus according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a third embodiment of an automated test apparatus according to the present invention.
  • the present invention provides an automated test method.
  • FIG. 1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
  • the automated test method comprises:
  • Step S10 During the running of the software system, analyze whether the software code of the software system is modified in real time or periodically;
  • the system log information is retrieved in real time or periodically, and the software modification log of the software system is extracted from the system log information to analyze whether the software code of the software system is modified.
  • a software modification information collection module may be pre-configured on the software system, and the information acquisition module is modified by the software to detect and record detailed information of each software code modification in real time or periodically, such as modifying. Type, modification time, modification party identity information, etc., and use the detected software modification information for more detailed analysis to determine whether the software code of the software system should be identified as being modified. For example, it may be preset that after the set time period or the set high level developer modifies the software code of the software system, the software system is not required to be automatically tested, and then the information acquisition module is modified by the software. It also records that the software code of the software system has been modified by the high-level developer in the set time period or setting, and the software code identified as the software system is not modified, which is more flexible and practical.
  • Step S20 If the software code of the software system is modified, the modified software code is found, and the associated software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Connected automated test execution scripts;
  • the modified software code is also the software code of the software system.
  • the associated data of the software code and the automated test execution script may be an analysis of the software code of the software system and each of the automated test execution scripts in advance, and find an automated test execution script corresponding to each piece of software code of the software system, and Save the association.
  • the associated data of the software code and the automated test execution script may also be obtained from the cloud server, for example, the software code provided by the same software system as the software system may be directly obtained from the cloud server and the associated test data of the automated test execution script;
  • the cloud server obtains the associated data of the software code provided by the software system identical or similar to the software system and the automated test execution script, and compares and selects the data of the most accurate software code and the automated test execution script, which is not limited herein. .
  • Step S30 running the determined various automated test execution scripts in the software system after the software code is modified, and generating a test report.
  • the determined individual automated test execution scripts may be run in the software system after the software code is modified to modify the software code.
  • the system performs automated testing, that is, using the automated test execution script associated with the original software code before modification, to automatically test the software system whose code has been modified to test the modified software system and before the modification.
  • the original software code has the same or similar modified content in terms of content, function, function, etc., whether there is any incompatibility, mismatch, etc., and generates a test report.
  • the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error, including but not limited to an H5 page exception, a system crash, and the like.
  • the automated test execution script associated with the modified software code is determined by the pre-stored software code and the associated data of the automated test execution script, and the software code is The modified automated test execution scripts are run in the modified software system to generate test reports. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
  • the second embodiment of the present invention provides an automated test method. Based on the foregoing embodiment, before the step S10, the method further includes:
  • Step S40 running each of the automated test execution scripts corresponding to the software system one by one, and analyzing and recording the software code associated with the automated test execution script during an automated test execution script running process, wherein the automated test execution script is related to the automated test execution script
  • the associated software code is the software code that is invoked during the running of the automated test execution script
  • step S50 the associated data of the software code and the automated test execution script is saved.
  • each of the automated test execution scripts corresponding to the software system is run one by one, and during an automated test execution script running process, the software code associated with the automated test execution script is analyzed and recorded,
  • the software code associated with the automated test execution script refers to the software code that is invoked during the execution of the automated test execution script.
  • the third embodiment of the present invention provides an automated test method. Based on the foregoing embodiment, before the step S30, the method further includes:
  • Step S60 analyzing whether an automated test execution script associated with the modified software code is determined
  • step S70 is executed to generate reminder information to remind the user to add a corresponding automated test execution script for the modified software code.
  • the automated test execution script associated with the modified software code when the automated test execution script associated with the modified software code is determined, if the automated test execution script associated with the modified software code is not found, the modified software code is not previously associated with the relevant The automated test execution script or the modified software code is new code, there is no automated test execution script associated with it, and the developer is required to manually add automated test execution scripts. Then generating reminder information such as pop-up information on the interface, or sending reminder information to a predetermined terminal, such as a developer's mobile phone, to remind the developer to manually write a script for the modified software code or to retrieve an existing script. Add the corresponding automated test execution script to enable more comprehensive automated testing of the software system with the modified software code.
  • the invention further provides an automated test device.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
  • the automated test device comprises:
  • the first analysis module 01 is configured to analyze whether the software code of the software system is modified in real time or timing during the running of the software system;
  • the system log information is retrieved in real time or periodically, and the software modification log of the software system is extracted from the system log information to analyze whether the software code of the software system is modified.
  • a software modification information collection module may be pre-configured on the software system, and the information acquisition module is modified by the software to detect and record detailed information of each software code modification in real time or periodically, such as modifying. Type, modification time, modification party identity information, etc., and use the detected software modification information for more detailed analysis to determine whether the software code of the software system should be identified as being modified. For example, it may be preset that after the set time period or the set high level developer modifies the software code of the software system, the software system is not required to be automatically tested, and then the information acquisition module is modified by the software. It also records that the software code of the software system has been modified by the high-level developer in the set time period or setting, and the software code identified as the software system is not modified, which is more flexible and practical.
  • the determining module 02 is configured to: if the software code of the software system is modified, find the modified software code, and determine and modify the modified software according to the associated data of the pre-saved software code and the automated test execution script. An automated test execution script associated with the software code;
  • the modified software code is also the software code of the software system.
  • the associated data of the software code and the automated test execution script may be an analysis of the software code of the software system and each of the automated test execution scripts in advance, and find an automated test execution script corresponding to each piece of software code of the software system, and Save the association.
  • the associated data of the software code and the automated test execution script may also be obtained from the cloud server, for example, the software code provided by the same software system as the software system may be directly obtained from the cloud server and the associated test data of the automated test execution script;
  • the cloud server obtains the associated data of the software code provided by the software system identical or similar to the software system and the automated test execution script, and compares and selects the data of the most accurate software code and the automated test execution script, which is not limited herein. .
  • test module 03 configured to run the determined each in the software system after the software code is modified Automate test execution scripts and generate test reports.
  • the determined individual automated test execution scripts may be run in the software system after the software code is modified to modify the software code.
  • the system performs automated testing, that is, using the automated test execution script associated with the original software code before modification, to automatically test the software system whose code has been modified to test the modified software system and before the modification.
  • the original software code has the same or similar modified content in terms of content, function, function, etc., whether there is any incompatibility, mismatch, etc., and generates a test report.
  • the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error, including but not limited to an H5 page exception, a system crash, and the like.
  • the automated test execution script associated with the modified software code is determined by the pre-stored software code and the associated data of the automated test execution script, and the software code is The modified automated test execution scripts are run in the modified software system to generate test reports. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
  • the second embodiment of the present invention provides an automated testing device. Based on the foregoing embodiments, the method further includes:
  • the recording module 04 is configured to run each of the automated test execution scripts corresponding to the software system one by one, and analyze and record the software code associated with the automated test execution script during an automated test execution script operation, and the automated test
  • the software code associated with the execution script is the software code that is invoked during the running of the automated test execution script
  • the saving module 05 is used to save the associated data of the software code and the automated test execution script.
  • each of the automated test execution scripts corresponding to the software system is run one by one, and during an automated test execution script running process, the software code associated with the automated test execution script is analyzed and recorded,
  • the software code associated with the automated test execution script refers to the software code that is invoked during the execution of the automated test execution script.
  • the third embodiment of the present invention provides an automatic testing device. Based on the foregoing embodiments, the method further includes:
  • a second analysis module 06 configured to analyze whether an automated test execution script associated with the modified software code is determined
  • Reminder module 07 for automated test execution if not associated with the modified software code
  • the script generates a reminder message to remind the user to add a corresponding automated test execution script for the modified software code.
  • the automated test execution script associated with the modified software code when the automated test execution script associated with the modified software code is determined, if the automated test execution script associated with the modified software code is not found, the modified software code is not previously associated with the relevant The automated test execution script or the modified software code is new code, there is no automated test execution script associated with it, and the developer is required to manually add automated test execution scripts. Then generating reminder information such as pop-up information on the interface, or sending reminder information to a predetermined terminal, such as a developer's mobile phone, to remind the developer to manually write a script for the modified software code or to retrieve an existing script. Add the corresponding automated test execution script to enable more comprehensive automated testing of the software system with the modified software code.
  • the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the automated test method and apparatus of the various embodiments described above step.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Abstract

An automatic test method and device. The method comprises: during the operation of a software system, analyzing whether a software code of the software system is modified in real time or regularly (S10); if it is analyzed that the software code of the software system is modified, finding the modified software code, and determining an automatic test execution script associated with the found modified software code according to pre-stored associated data between the software code and the automatic test execution script (S20); and running each determined automatic test execution script in the software system with the modified software code, and generating a test report (S30). The above-mentioned method improves the test efficiency, makes it easier to find a test error and saves manpower and material resources.

Description

自动化测试方法、计算机可读存储介质及装置Automated test method, computer readable storage medium and device
本申请要求于2016年12月30日提交中国专利局、申请号为201611261210.1、发明名称为“自动化测试方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。The present application claims priority to Chinese Patent Application No. 20161126121, filed on Dec.
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种自动化测试方法、计算机可读存储介质及装置。The present invention relates to the field of computer technologies, and in particular, to an automated test method, a computer readable storage medium, and an apparatus.
背景技术Background technique
目前,在一个软件系统上线运行之后,若开发人员针对该软件系统的软件代码进行了修改,则开发人员需要针对修改代码后的软件系统进行大量操作场景下的所有自动化测试执行脚本的运行测试,尤其是针对一些大型的软件系统来说,需要自动执行的所有自动化测试执行脚本的数量通常会超过数万个,这些所有的自动化测试执行脚本全部跑完需要海量的时间,另外,还要花费海量的时间去分析出现测试错误的自动化测试执行脚本,浪费大量的人力物力,而且经常出错。At present, after a software system is online, if the developer has modified the software code of the software system, the developer needs to run the test of all the automated test execution scripts in a large number of operating scenarios for the software system after the code is modified. Especially for some large software systems, the number of automated test execution scripts that need to be executed automatically will usually exceed tens of thousands. All of these automated test execution scripts will take a lot of time to run, and it will cost a lot. Time to analyze automated test execution scripts with test errors, wasting a lot of manpower and resources, and often making mistakes.
发明内容Summary of the invention
本发明的主要目的在于提供一种自动化测试方法、计算机可读存储介质及装置,旨在提高自动化测试的效率及节约成本。The main object of the present invention is to provide an automated test method, computer readable storage medium and device, which aim to improve the efficiency and cost of automated testing.
为实现上述目的,本发明提供的一种自动化测试方法,所述方法包括以下步骤:To achieve the above object, the present invention provides an automated test method, the method comprising the following steps:
在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;During the running of the software system, whether the software code of the software system is modified in real time or periodically;
若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;If the software code of the software system is modified, the modified software code is found, and the automation associated with the found modified software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Test execution script;
在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。The determined individual automated test execution scripts are run in the software system after the software code is modified, and a test report is generated.
优选地,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤之前还包括:Preferably, before the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system, the method further comprises:
逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;Running each of the automated test execution scripts corresponding to the software system one by one, and analyzing and recording the software code associated with the automated test execution script during the execution of an automated test execution script, the software associated with the automated test execution script The code is the software code that is invoked during the running of the automated test execution script;
保存软件代码与自动化测试执行脚本的关联数据。Save the associated data of the software code and the automated test execution script.
优选地,所述在软件代码被修改后的该软件系统中运行确定的各个自动 化测试执行脚本,并生成测试报告的步骤之前还包括:Preferably, the determining each of the automatics is run in the software system after the software code is modified Before testing the execution script and generating the test report, it also includes:
分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;Analyzing whether an automated test execution script associated with the modified software code is determined;
若是,则执行在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤;If yes, executing the steps of running the determined automated test execution scripts in the software system after the software code is modified, and generating a test report;
若否,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。If not, a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
优选地,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤包括:Preferably, the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system comprises:
在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
优选地,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息。Preferably, the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
此外,为实现上述目的,本发明还提供一种自动化测试装置,所述自动化测试装置包括:In addition, in order to achieve the above object, the present invention also provides an automated testing device, the automated testing device comprising:
第一分析模块,用于在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;a first analysis module, configured to analyze whether the software code of the software system is modified in real time or timing during the running of the software system;
确定模块,用于若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;a determining module, configured to: if the software code of the software system is modified, find the modified software code, and determine and modify the modified software according to the associated data of the pre-saved software code and the automated test execution script An automated test execution script associated with the code;
测试模块,用于在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。The test module is configured to run the determined individual automated test execution scripts in the software system after the software code is modified, and generate a test report.
优选地,所述自动化测试装置还包括:Preferably, the automated testing device further comprises:
记录模块,用于逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;a recording module, configured to run each of the automated test execution scripts corresponding to the software system one by one, and analyze and record the software code associated with the automated test execution script during an automated test execution script running, the automated test execution The software code associated with the script is the software code that is invoked during the running of the automated test execution script;
保存模块,用于保存软件代码与自动化测试执行脚本的关联数据。A save module that holds the associated data of the software code and the automated test execution script.
优选地,所述自动化测试装置还包括:Preferably, the automated testing device further comprises:
第二分析模块,用于分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;a second analysis module, configured to analyze whether an automated test execution script associated with the modified software code is determined;
提醒模块,用于若没有与被修改的软件代码相关联的自动化测试执行脚本,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。The reminder module is configured to generate a reminder message if there is no automated test execution script associated with the modified software code to remind the user to add a corresponding automated test execution script for the modified software code.
优选地,所述第一分析模块还用于:Preferably, the first analysis module is further configured to:
在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
优选地,所述测试报告包括出现测试错误的自动化测试执行脚本的列表 信息,及/或,测试错误的错误类型信息。Preferably, the test report includes a list of automated test execution scripts in which a test error has occurred Information, and/or, error type information for testing errors.
此外,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述的自动化测试方法及装置的步骤。Moreover, the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the automated test method and apparatus described above.
本发明提出的自动化测试方法、计算机可读存储介质及装置,在分析出软件系统的软件代码被修改时,通过预先保存的软件代码与自动化测试执行脚本的关联数据,确定出与被修改的软件代码相关联的自动化测试执行脚本,并在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,以生成测试报告。由于只需确定出与被修改的软件代码相关联的自动化测试执行脚本,并执行确定出的自动化测试执行脚本完成测试,而无需在修改代码后的软件系统上进行所有自动化测试执行脚本的运行测试,提高了测试效率,且更加容易查找测试错误,节约了人力物力。The automated test method, the computer readable storage medium and the device provided by the invention determine the software to be modified through the associated data of the pre-stored software code and the automated test execution script when the software code of the software system is modified. The code is associated with an automated test execution script and runs the determined automated test execution scripts in the software system after the software code is modified to generate a test report. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
附图说明DRAWINGS
图1为本发明自动化测试方法第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention;
图2为本发明自动化测试方法第二实施例的流程示意图;2 is a schematic flow chart of a second embodiment of an automated test method according to the present invention;
图3为本发明自动化测试方法第三实施例的流程示意图;3 is a schematic flow chart of a third embodiment of an automated test method according to the present invention;
图4为本发明自动化测试装置第一实施例的功能模块示意图;4 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention;
图5为本发明自动化测试装置第二实施例的功能模块示意图;5 is a schematic diagram of functional modules of a second embodiment of an automated test apparatus according to the present invention;
图6为本发明自动化测试装置第三实施例的功能模块示意图。FIG. 6 is a schematic diagram of functional modules of a third embodiment of an automated test apparatus according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, in order to make the present invention. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种自动化测试方法。The present invention provides an automated test method.
参照图1,图1为本发明自动化测试方法第一实施例的流程示意图。1 is a schematic flow chart of a first embodiment of an automated test method according to the present invention.
在第一实施例中,该自动化测试方法包括:In a first embodiment, the automated test method comprises:
步骤S10,在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;Step S10: During the running of the software system, analyze whether the software code of the software system is modified in real time or periodically;
在一个软件系统上线运行之后,根据该软件系统的实际运行状况,开发人员有时需针对该软件系统的软件代码进行部分修改,例如,新增代码、修改代码、删除代码等等。本实施例中,在软件系统上线运行过程中,实时或者定时(例如,每天的23:59)分析该软件系统的软件代码是否被修改,如是否有新增代码、修改代码、删除代码等。 After a software system is online, depending on the actual operating conditions of the software system, developers sometimes need to make partial modifications to the software code of the software system, such as adding code, modifying code, deleting code, and so on. In this embodiment, during the online operation of the software system, whether the software code of the software system is modified, such as whether there is new code, modified code, deleted code, etc., is analyzed in real time or at a time (for example, 23:59 every day).
在一种实施方式中,在该软件系统运行过程中,实时或者定时调取系统日志信息,并从系统日志信息中提取出该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改。In an implementation manner, during the running of the software system, the system log information is retrieved in real time or periodically, and the software modification log of the software system is extracted from the system log information to analyze whether the software code of the software system is modified.
在另一种实施方式中,还可在该软件系统上预先配置一软件修改信息采集模块,通过该软件修改信息采集模块实时或定时地侦测并记录每一软件代码修改的详细信息,如修改类型、修改时间、修改方身份信息等,并利用侦测到的软件修改信息进行更加细化的分析以判断该软件系统的软件代码是否应识别为被修改。例如,可预先设定在设定时间段或设定的高级别开发人员对该软件系统的软件代码进行修改后,无需对该软件系统进行自动化测试,则若通过该软件修改信息采集模块侦测并记录到在设定时间段或设定的高级别开发人员对该软件系统的软件代码进行了修改,则分析识别为该软件系统的软件代码没有被修改,更加灵活、实用。In another implementation manner, a software modification information collection module may be pre-configured on the software system, and the information acquisition module is modified by the software to detect and record detailed information of each software code modification in real time or periodically, such as modifying. Type, modification time, modification party identity information, etc., and use the detected software modification information for more detailed analysis to determine whether the software code of the software system should be identified as being modified. For example, it may be preset that after the set time period or the set high level developer modifies the software code of the software system, the software system is not required to be automatically tested, and then the information acquisition module is modified by the software. It also records that the software code of the software system has been modified by the high-level developer in the set time period or setting, and the software code identified as the software system is not modified, which is more flexible and practical.
步骤S20,若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;Step S20: If the software code of the software system is modified, the modified software code is found, and the associated software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Connected automated test execution scripts;
若分析出该软件系统的软件代码被修改如有新增代码、修改代码、删除代码等情况时,则找出被修改的软件代码,该被修改的软件代码也即该软件系统的软件代码中与修改后代码相对应的被修改前的原始软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定该被修改的软件代码相关联的自动化测试执行脚本。其中,软件代码与自动化测试执行脚本的关联数据可以是预先针对该软件系统的软件代码与各个自动化测试执行脚本进行分析,找出该软件系统的每段软件代码所对应的自动化测试执行脚本,并进行关联保存。软件代码与自动化测试执行脚本的关联数据也可以是从云端服务器获取,如可从云端服务器直接获取与该软件系统相同的软件系统所提供的软件代码与自动化测试执行脚本的关联数据;还可从云端服务器获取多个与该软件系统相同或相似的软件系统提供的软件代码与自动化测试执行脚本的关联数据,进行对比选取最准确的软件代码与自动化测试执行脚本的关联数据,在此不做限定。If it is analyzed that the software code of the software system is modified, such as adding new code, modifying code, deleting code, etc., the modified software code is found, and the modified software code is also the software code of the software system. The pre-modified original software code corresponding to the modified code, and determining the automated test execution script associated with the modified software code based on the pre-stored software code and the associated data of the automated test execution script. The associated data of the software code and the automated test execution script may be an analysis of the software code of the software system and each of the automated test execution scripts in advance, and find an automated test execution script corresponding to each piece of software code of the software system, and Save the association. The associated data of the software code and the automated test execution script may also be obtained from the cloud server, for example, the software code provided by the same software system as the software system may be directly obtained from the cloud server and the associated test data of the automated test execution script; The cloud server obtains the associated data of the software code provided by the software system identical or similar to the software system and the automated test execution script, and compares and selects the data of the most accurate software code and the automated test execution script, which is not limited herein. .
步骤S30,在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。Step S30, running the determined various automated test execution scripts in the software system after the software code is modified, and generating a test report.
在确定出与被修改的软件代码相关联的自动化测试执行脚本之后,即可在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,以对软件代码被修改后的该软件系统进行自动化测试,即利用与被修改前的原始软件代码相关联的自动化测试执行脚本,来对代码被修改后的该软件系统进行自动化测试,以测试修改后的软件系统中与该被修改前的原始软件代码在内容、功能、作用等方面均相同或相似的修改后代码是否存在修改不兼容、不匹配等问题,并生成测试报告。其中,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息,所述错误类型信息包括但不限于H5页面异常、系统崩溃等。 After determining the automated test execution script associated with the modified software code, the determined individual automated test execution scripts may be run in the software system after the software code is modified to modify the software code. The system performs automated testing, that is, using the automated test execution script associated with the original software code before modification, to automatically test the software system whose code has been modified to test the modified software system and before the modification. The original software code has the same or similar modified content in terms of content, function, function, etc., whether there is any incompatibility, mismatch, etc., and generates a test report. The test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error, including but not limited to an H5 page exception, a system crash, and the like.
本实施例在分析出软件系统的软件代码被修改时,通过预先保存的软件代码与自动化测试执行脚本的关联数据,确定出与被修改的软件代码相关联的自动化测试执行脚本,并在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,以生成测试报告。由于只需确定出与被修改的软件代码相关联的自动化测试执行脚本,并执行确定出的自动化测试执行脚本完成测试,而无需在修改代码后的软件系统上进行所有自动化测试执行脚本的运行测试,提高了测试效率,且更加容易查找测试错误,节约了人力物力。In the embodiment, when the software code of the software system is modified, the automated test execution script associated with the modified software code is determined by the pre-stored software code and the associated data of the automated test execution script, and the software code is The modified automated test execution scripts are run in the modified software system to generate test reports. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
如图2所示,本发明第二实施例提出一种自动化测试方法,在上述实施例的基础上,在上述步骤S10之前还包括:As shown in FIG. 2, the second embodiment of the present invention provides an automated test method. Based on the foregoing embodiment, before the step S10, the method further includes:
步骤S40,逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;Step S40, running each of the automated test execution scripts corresponding to the software system one by one, and analyzing and recording the software code associated with the automated test execution script during an automated test execution script running process, wherein the automated test execution script is related to the automated test execution script The associated software code is the software code that is invoked during the running of the automated test execution script;
步骤S50,保存软件代码与自动化测试执行脚本的关联数据。In step S50, the associated data of the software code and the automated test execution script is saved.
本实施例中,针对一个软件系统,逐一运行该软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本关联的软件代码,所述与该自动化测试执行脚本关联的软件代码指的是该自动化测试执行脚本执行过程中所调用的软件代码。这样,即可准确地为该软件系统的每一段软件代码找到与之相关联的一个或多个自动化测试执行脚本,并将记录的该软件系统的软件代码与自动化测试执行脚本的关联数据进行保存,以供后续在确定与该软件系统中被修改的软件代码相关联的自动化测试执行脚本时使用。In this embodiment, for each software system, each of the automated test execution scripts corresponding to the software system is run one by one, and during an automated test execution script running process, the software code associated with the automated test execution script is analyzed and recorded, The software code associated with the automated test execution script refers to the software code that is invoked during the execution of the automated test execution script. In this way, one or more automated test execution scripts associated with each piece of software code of the software system can be accurately found, and the recorded software data of the software system and the associated data of the automated test execution script can be saved. For subsequent use in determining an automated test execution script associated with the software code being modified in the software system.
如图3所示,本发明第三实施例提出一种自动化测试方法,在上述实施例的基础上,在上述步骤S30之前还包括:As shown in FIG. 3, the third embodiment of the present invention provides an automated test method. Based on the foregoing embodiment, before the step S30, the method further includes:
步骤S60,分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;Step S60, analyzing whether an automated test execution script associated with the modified software code is determined;
若是,则执行步骤S30;If yes, proceed to step S30;
若否,则执行步骤S70,生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。If not, step S70 is executed to generate reminder information to remind the user to add a corresponding automated test execution script for the modified software code.
本实施例中,在确定被修改的软件代码关联的自动化测试执行脚本时,若没有找到与被修改的软件代码相关联的自动化测试执行脚本,则说明该被修改的软件代码预先没有关联到相关的自动化测试执行脚本或该被修改的软件代码为新增代码,没有与之关联的自动化测试执行脚本,需要开发人员为其手动添加自动化测试执行脚本。则在界面上生成提醒信息如弹窗信息等,或者,向预先确定的终端如开发人员的手机发送提醒信息,提醒开发人员为该被修改的软件代码进行人工编写脚本或调取已有脚本以添加对应的自动化测试执行脚本,从而能对软件代码被修改后的该软件系统进行更加全面的自动化测试。 In this embodiment, when the automated test execution script associated with the modified software code is determined, if the automated test execution script associated with the modified software code is not found, the modified software code is not previously associated with the relevant The automated test execution script or the modified software code is new code, there is no automated test execution script associated with it, and the developer is required to manually add automated test execution scripts. Then generating reminder information such as pop-up information on the interface, or sending reminder information to a predetermined terminal, such as a developer's mobile phone, to remind the developer to manually write a script for the modified software code or to retrieve an existing script. Add the corresponding automated test execution script to enable more comprehensive automated testing of the software system with the modified software code.
本发明进一步提供一种自动化测试装置。The invention further provides an automated test device.
参照图4,图4为本发明自动化测试装置第一实施例的功能模块示意图。Referring to FIG. 4, FIG. 4 is a schematic diagram of functional modules of a first embodiment of an automated test apparatus according to the present invention.
在第一实施例中,该自动化测试装置包括:In a first embodiment, the automated test device comprises:
第一分析模块01,用于在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;The first analysis module 01 is configured to analyze whether the software code of the software system is modified in real time or timing during the running of the software system;
在一个软件系统上线运行之后,根据该软件系统的实际运行状况,开发人员有时需针对该软件系统的软件代码进行部分修改,例如,新增代码、修改代码、删除代码等等。本实施例中,在软件系统上线运行过程中,实时或者定时(例如,每天的23:59)分析该软件系统的软件代码是否被修改,如是否有新增代码、修改代码、删除代码等。After a software system is online, depending on the actual operating conditions of the software system, developers sometimes need to make partial modifications to the software code of the software system, such as adding code, modifying code, deleting code, and so on. In this embodiment, during the online operation of the software system, whether the software code of the software system is modified, such as whether there is new code, modified code, deleted code, etc., is analyzed in real time or at a time (for example, 23:59 every day).
在一种实施方式中,在该软件系统运行过程中,实时或者定时调取系统日志信息,并从系统日志信息中提取出该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改。In an implementation manner, during the running of the software system, the system log information is retrieved in real time or periodically, and the software modification log of the software system is extracted from the system log information to analyze whether the software code of the software system is modified.
在另一种实施方式中,还可在该软件系统上预先配置一软件修改信息采集模块,通过该软件修改信息采集模块实时或定时地侦测并记录每一软件代码修改的详细信息,如修改类型、修改时间、修改方身份信息等,并利用侦测到的软件修改信息进行更加细化的分析以判断该软件系统的软件代码是否应识别为被修改。例如,可预先设定在设定时间段或设定的高级别开发人员对该软件系统的软件代码进行修改后,无需对该软件系统进行自动化测试,则若通过该软件修改信息采集模块侦测并记录到在设定时间段或设定的高级别开发人员对该软件系统的软件代码进行了修改,则分析识别为该软件系统的软件代码没有被修改,更加灵活、实用。In another implementation manner, a software modification information collection module may be pre-configured on the software system, and the information acquisition module is modified by the software to detect and record detailed information of each software code modification in real time or periodically, such as modifying. Type, modification time, modification party identity information, etc., and use the detected software modification information for more detailed analysis to determine whether the software code of the software system should be identified as being modified. For example, it may be preset that after the set time period or the set high level developer modifies the software code of the software system, the software system is not required to be automatically tested, and then the information acquisition module is modified by the software. It also records that the software code of the software system has been modified by the high-level developer in the set time period or setting, and the software code identified as the software system is not modified, which is more flexible and practical.
确定模块02,用于若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;The determining module 02 is configured to: if the software code of the software system is modified, find the modified software code, and determine and modify the modified software according to the associated data of the pre-saved software code and the automated test execution script. An automated test execution script associated with the software code;
若分析出该软件系统的软件代码被修改如有新增代码、修改代码、删除代码等情况时,则找出被修改的软件代码,该被修改的软件代码也即该软件系统的软件代码中与修改后代码相对应的被修改前的原始软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定该被修改的软件代码相关联的自动化测试执行脚本。其中,软件代码与自动化测试执行脚本的关联数据可以是预先针对该软件系统的软件代码与各个自动化测试执行脚本进行分析,找出该软件系统的每段软件代码所对应的自动化测试执行脚本,并进行关联保存。软件代码与自动化测试执行脚本的关联数据也可以是从云端服务器获取,如可从云端服务器直接获取与该软件系统相同的软件系统所提供的软件代码与自动化测试执行脚本的关联数据;还可从云端服务器获取多个与该软件系统相同或相似的软件系统提供的软件代码与自动化测试执行脚本的关联数据,进行对比选取最准确的软件代码与自动化测试执行脚本的关联数据,在此不做限定。If it is analyzed that the software code of the software system is modified, such as adding new code, modifying code, deleting code, etc., the modified software code is found, and the modified software code is also the software code of the software system. The pre-modified original software code corresponding to the modified code, and determining the automated test execution script associated with the modified software code based on the pre-stored software code and the associated data of the automated test execution script. The associated data of the software code and the automated test execution script may be an analysis of the software code of the software system and each of the automated test execution scripts in advance, and find an automated test execution script corresponding to each piece of software code of the software system, and Save the association. The associated data of the software code and the automated test execution script may also be obtained from the cloud server, for example, the software code provided by the same software system as the software system may be directly obtained from the cloud server and the associated test data of the automated test execution script; The cloud server obtains the associated data of the software code provided by the software system identical or similar to the software system and the automated test execution script, and compares and selects the data of the most accurate software code and the automated test execution script, which is not limited herein. .
测试模块03,用于在软件代码被修改后的该软件系统中运行确定的各个 自动化测试执行脚本,并生成测试报告。a test module 03, configured to run the determined each in the software system after the software code is modified Automate test execution scripts and generate test reports.
在确定出与被修改的软件代码相关联的自动化测试执行脚本之后,即可在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,以对软件代码被修改后的该软件系统进行自动化测试,即利用与被修改前的原始软件代码相关联的自动化测试执行脚本,来对代码被修改后的该软件系统进行自动化测试,以测试修改后的软件系统中与该被修改前的原始软件代码在内容、功能、作用等方面均相同或相似的修改后代码是否存在修改不兼容、不匹配等问题,并生成测试报告。其中,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息,所述错误类型信息包括但不限于H5页面异常、系统崩溃等。After determining the automated test execution script associated with the modified software code, the determined individual automated test execution scripts may be run in the software system after the software code is modified to modify the software code. The system performs automated testing, that is, using the automated test execution script associated with the original software code before modification, to automatically test the software system whose code has been modified to test the modified software system and before the modification. The original software code has the same or similar modified content in terms of content, function, function, etc., whether there is any incompatibility, mismatch, etc., and generates a test report. The test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error, including but not limited to an H5 page exception, a system crash, and the like.
本实施例在分析出软件系统的软件代码被修改时,通过预先保存的软件代码与自动化测试执行脚本的关联数据,确定出与被修改的软件代码相关联的自动化测试执行脚本,并在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,以生成测试报告。由于只需确定出与被修改的软件代码相关联的自动化测试执行脚本,并执行确定出的自动化测试执行脚本完成测试,而无需在修改代码后的软件系统上进行所有自动化测试执行脚本的运行测试,提高了测试效率,且更加容易查找测试错误,节约了人力物力。In the embodiment, when the software code of the software system is modified, the automated test execution script associated with the modified software code is determined by the pre-stored software code and the associated data of the automated test execution script, and the software code is The modified automated test execution scripts are run in the modified software system to generate test reports. Since it is only necessary to determine the automated test execution script associated with the modified software code and execute the determined automated test execution script to complete the test without running all automated test execution scripts on the software system after the code is modified. Improves test efficiency and makes it easier to find test errors, saving manpower and material resources.
如图5所示,本发明第二实施例提出一种自动化测试装置,在上述实施例的基础上,还包括:As shown in FIG. 5, the second embodiment of the present invention provides an automated testing device. Based on the foregoing embodiments, the method further includes:
记录模块04,用于逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;The recording module 04 is configured to run each of the automated test execution scripts corresponding to the software system one by one, and analyze and record the software code associated with the automated test execution script during an automated test execution script operation, and the automated test The software code associated with the execution script is the software code that is invoked during the running of the automated test execution script;
保存模块05,用于保存软件代码与自动化测试执行脚本的关联数据。The saving module 05 is used to save the associated data of the software code and the automated test execution script.
本实施例中,针对一个软件系统,逐一运行该软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本关联的软件代码,所述与该自动化测试执行脚本关联的软件代码指的是该自动化测试执行脚本执行过程中所调用的软件代码。这样,即可准确地为该软件系统的每一段软件代码找到与之相关联的一个或多个自动化测试执行脚本,并将记录的该软件系统的软件代码与自动化测试执行脚本的关联数据进行保存,以供后续在确定与该软件系统中被修改的软件代码相关联的自动化测试执行脚本时使用。In this embodiment, for each software system, each of the automated test execution scripts corresponding to the software system is run one by one, and during an automated test execution script running process, the software code associated with the automated test execution script is analyzed and recorded, The software code associated with the automated test execution script refers to the software code that is invoked during the execution of the automated test execution script. In this way, one or more automated test execution scripts associated with each piece of software code of the software system can be accurately found, and the recorded software data of the software system and the associated data of the automated test execution script can be saved. For subsequent use in determining an automated test execution script associated with the software code being modified in the software system.
如图6所示,本发明第三实施例提出一种自动化测试装置,在上述实施例的基础上,还包括:As shown in FIG. 6, the third embodiment of the present invention provides an automatic testing device. Based on the foregoing embodiments, the method further includes:
第二分析模块06,用于分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;a second analysis module 06, configured to analyze whether an automated test execution script associated with the modified software code is determined;
提醒模块07,用于若没有与被修改的软件代码相关联的自动化测试执行 脚本,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。 Reminder module 07 for automated test execution if not associated with the modified software code The script generates a reminder message to remind the user to add a corresponding automated test execution script for the modified software code.
本实施例中,在确定被修改的软件代码关联的自动化测试执行脚本时,若没有找到与被修改的软件代码相关联的自动化测试执行脚本,则说明该被修改的软件代码预先没有关联到相关的自动化测试执行脚本或该被修改的软件代码为新增代码,没有与之关联的自动化测试执行脚本,需要开发人员为其手动添加自动化测试执行脚本。则在界面上生成提醒信息如弹窗信息等,或者,向预先确定的终端如开发人员的手机发送提醒信息,提醒开发人员为该被修改的软件代码进行人工编写脚本或调取已有脚本以添加对应的自动化测试执行脚本,从而能对软件代码被修改后的该软件系统进行更加全面的自动化测试。In this embodiment, when the automated test execution script associated with the modified software code is determined, if the automated test execution script associated with the modified software code is not found, the modified software code is not previously associated with the relevant The automated test execution script or the modified software code is new code, there is no automated test execution script associated with it, and the developer is required to manually add automated test execution scripts. Then generating reminder information such as pop-up information on the interface, or sending reminder information to a predetermined terminal, such as a developer's mobile phone, to remind the developer to manually write a script for the modified software code or to retrieve an existing script. Add the corresponding automated test execution script to enable more comprehensive automated testing of the software system with the modified software code.
此外,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述的各实施例中的自动化测试方法及装置的步骤。Furthermore, the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the automated test method and apparatus of the various embodiments described above step.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements that are not explicitly listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上参照附图说明了本发明的优选实施例,并非因此局限本发明的权利范围。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The preferred embodiments of the present invention have been described above with reference to the drawings, and are not intended to limit the scope of the invention. The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments. Additionally, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
本领域技术人员不脱离本发明的范围和实质,可以有多种变型方案实现本发明,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本发明的技术构思之内所作的任何修改、等同替换和改进,均应在本发明的权利范围之内。 A person skilled in the art can implement the invention in various variants without departing from the scope and spirit of the invention. For example, the features of one embodiment can be used in another embodiment to obtain a further embodiment. Any modifications, equivalent substitutions and improvements made within the technical concept of the invention are intended to be included within the scope of the invention.

Claims (20)

  1. 一种自动化测试方法,其特征在于,所述方法包括以下步骤:An automated test method, characterized in that the method comprises the following steps:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;During the running of the software system, whether the software code of the software system is modified in real time or periodically;
    若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;If the software code of the software system is modified, the modified software code is found, and the automation associated with the found modified software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Test execution script;
    在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。The determined individual automated test execution scripts are run in the software system after the software code is modified, and a test report is generated.
  2. 如权利要求1所述的自动化测试方法,其特征在于,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤之前还包括:The automated testing method according to claim 1, wherein the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system further comprises:
    逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;Running each of the automated test execution scripts corresponding to the software system one by one, and analyzing and recording the software code associated with the automated test execution script during the execution of an automated test execution script, the software associated with the automated test execution script The code is the software code that is invoked during the running of the automated test execution script;
    保存软件代码与自动化测试执行脚本的关联数据。Save the associated data of the software code and the automated test execution script.
  3. 如权利要求1所述的自动化测试方法,其特征在于,所述在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤之前还包括:The automated testing method according to claim 1, wherein the step of executing the determined individual automated test execution scripts in the software system after the software code is modified and generating the test report further comprises:
    分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;Analyzing whether an automated test execution script associated with the modified software code is determined;
    若是,则执行在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤;If yes, executing the steps of running the determined automated test execution scripts in the software system after the software code is modified, and generating a test report;
    若否,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。If not, a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
  4. 如权利要求2所述的自动化测试方法,其特征在于,所述在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤之前还包括:The automated testing method according to claim 2, wherein the step of running the determined individual automated test execution scripts in the software system after the software code is modified and generating the test report further comprises:
    分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;Analyzing whether an automated test execution script associated with the modified software code is determined;
    若是,则执行在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤;If yes, executing the steps of running the determined automated test execution scripts in the software system after the software code is modified, and generating a test report;
    若否,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。If not, a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
  5. 如权利要求1所述的自动化测试方法,其特征在于,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤包 括:The automated testing method according to claim 1, wherein the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system include:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  6. 如权利要求2所述的自动化测试方法,其特征在于,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤包括:The automated testing method according to claim 2, wherein the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system comprises:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  7. 如权利要求1所述的自动化测试方法,其特征在于,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息。The automated test method according to claim 1, wherein the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
  8. 如权利要求2所述的自动化测试方法,其特征在于,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息。The automated test method according to claim 2, wherein the test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
  9. 一种自动化测试装置,其特征在于,所述自动化测试装置包括:An automated testing device, characterized in that the automated testing device comprises:
    第一分析模块,用于在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;a first analysis module, configured to analyze whether the software code of the software system is modified in real time or timing during the running of the software system;
    确定模块,用于若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;a determining module, configured to: if the software code of the software system is modified, find the modified software code, and determine and modify the modified software according to the associated data of the pre-saved software code and the automated test execution script An automated test execution script associated with the code;
    测试模块,用于在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。The test module is configured to run the determined individual automated test execution scripts in the software system after the software code is modified, and generate a test report.
  10. 如权利要求9所述的自动化测试装置,其特征在于,还包括:The automated testing device of claim 9 further comprising:
    记录模块,用于逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;a recording module, configured to run each of the automated test execution scripts corresponding to the software system one by one, and analyze and record the software code associated with the automated test execution script during an automated test execution script running, the automated test execution The software code associated with the script is the software code that is invoked during the running of the automated test execution script;
    保存模块,用于保存软件代码与自动化测试执行脚本的关联数据。A save module that holds the associated data of the software code and the automated test execution script.
  11. 如权利要求9所述的自动化测试装置,其特征在于,还包括:The automated testing device of claim 9 further comprising:
    第二分析模块,用于分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;a second analysis module, configured to analyze whether an automated test execution script associated with the modified software code is determined;
    提醒模块,用于若没有与被修改的软件代码相关联的自动化测试执行脚 本,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。Reminder module for automated test execution feet if not associated with the modified software code In this case, a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
  12. 如权利要求10所述的自动化测试装置,其特征在于,还包括:The automated testing device of claim 10, further comprising:
    第二分析模块,用于分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;a second analysis module, configured to analyze whether an automated test execution script associated with the modified software code is determined;
    提醒模块,用于若没有与被修改的软件代码相关联的自动化测试执行脚本,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。The reminder module is configured to generate a reminder message if there is no automated test execution script associated with the modified software code to remind the user to add a corresponding automated test execution script for the modified software code.
  13. 如权利要求9所述的自动化测试装置,其特征在于,所述第一分析模块还用于:The automated testing device of claim 9, wherein the first analysis module is further configured to:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  14. 如权利要求10所述的自动化测试装置,其特征在于,所述第一分析模块还用于:The automated testing device of claim 10, wherein the first analysis module is further configured to:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
  15. 如权利要求9所述的自动化测试装置,其特征在于,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息。The automated test apparatus according to claim 9, wherein said test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
  16. 如权利要求10所述的自动化测试装置,其特征在于,所述测试报告包括出现测试错误的自动化测试执行脚本的列表信息,及/或,测试错误的错误类型信息。The automated test apparatus according to claim 10, wherein said test report includes list information of an automated test execution script in which a test error occurs, and/or error type information of the test error.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质是哪个存储有计算机程序,所述计算机程序被处理器执行时,实现如下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the following steps are implemented:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改;During the running of the software system, whether the software code of the software system is modified in real time or periodically;
    若分析该软件系统的软件代码被修改,则找出被修改的软件代码,并根据预先保存的软件代码与自动化测试执行脚本的关联数据,确定与找出的被修改的软件代码相关联的自动化测试执行脚本;If the software code of the software system is modified, the modified software code is found, and the automation associated with the found modified software code is determined according to the associated data of the pre-saved software code and the automated test execution script. Test execution script;
    在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告。 The determined individual automated test execution scripts are run in the software system after the software code is modified, and a test report is generated.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤之前,所述计算机程序被处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 17, wherein said computer program is processed by said processor before said step of analyzing whether software code of said software system is modified in real time or timing during operation of said software system When executed, the following steps are also implemented:
    逐一运行软件系统对应的各个自动化测试执行脚本,并在一个自动化测试执行脚本运行过程中,分析并记录与该自动化测试执行脚本相关联的软件代码,所述与该自动化测试执行脚本相关联的软件代码为该自动化测试执行脚本在运行过程中所调用的软件代码;Running each of the automated test execution scripts corresponding to the software system one by one, and analyzing and recording the software code associated with the automated test execution script during the execution of an automated test execution script, the software associated with the automated test execution script The code is the software code that is invoked during the running of the automated test execution script;
    保存软件代码与自动化测试执行脚本的关联数据。Save the associated data of the software code and the automated test execution script.
  19. 如权利要求17或18所述的计算机可读存储介质,其特征在于,所述在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤之前,所述计算机程序被处理器执行时,还实现如下步骤:A computer readable storage medium according to claim 17 or 18, wherein said step of executing said determined automated test execution script in said software system after said software code is modified and generating a test report When the computer program is executed by the processor, the following steps are also implemented:
    分析是否确定出与被修改的软件代码相关联的自动化测试执行脚本;Analyzing whether an automated test execution script associated with the modified software code is determined;
    若是,则执行在软件代码被修改后的该软件系统中运行确定的各个自动化测试执行脚本,并生成测试报告的步骤;If yes, executing the steps of running the determined automated test execution scripts in the software system after the software code is modified, and generating a test report;
    若否,则生成提醒信息,以提醒为该被修改的软件代码添加对应的自动化测试执行脚本。If not, a reminder message is generated to remind the user to add a corresponding automated test execution script for the modified software code.
  20. 如权利要求17或18所述的计算机可读存储介质,其特征在于,所述在软件系统运行过程中,实时或者定时分析该软件系统的软件代码是否被修改的步骤包括:The computer readable storage medium according to claim 17 or 18, wherein the step of analyzing whether the software code of the software system is modified in real time or timing during the running of the software system comprises:
    在软件系统运行过程中,实时或者定时分析该软件系统的软件修改日志,以分析出该软件系统的软件代码是否被修改;该修改包括新增代码、修改代码或删除代码。 During the running of the software system, the software modification log of the software system is analyzed in real time or periodically to analyze whether the software code of the software system is modified; the modification includes adding a new code, modifying a code, or deleting a code.
PCT/CN2017/105011 2016-12-30 2017-09-30 Automatic test method and device, and computer-readable storage medium WO2018120965A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611261210.1A CN106776339B (en) 2016-12-30 2016-12-30 Automated testing method and device
CN201611261210.1 2016-12-30

Publications (1)

Publication Number Publication Date
WO2018120965A1 true WO2018120965A1 (en) 2018-07-05

Family

ID=58954929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105011 WO2018120965A1 (en) 2016-12-30 2017-09-30 Automatic test method and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN106776339B (en)
WO (1) WO2018120965A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515852A (en) * 2019-08-30 2019-11-29 北京浪潮数据技术有限公司 A kind of application update test method and relevant apparatus based on agile development
CN111367555A (en) * 2020-03-23 2020-07-03 北京字节跳动网络技术有限公司 Assertion method, assertion device, electronic equipment and computer readable medium
CN112925716A (en) * 2021-03-19 2021-06-08 广东好太太智能家居有限公司 Visual image testing method and device and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776339B (en) * 2016-12-30 2018-07-24 深圳壹账通智能科技有限公司 Automated testing method and device
CN107992424A (en) * 2017-12-15 2018-05-04 平安科技(深圳)有限公司 Automatic test analysis method, application server and computer-readable recording medium
CN108427639B (en) * 2018-01-24 2021-05-07 深圳壹账通智能科技有限公司 Automated testing method, application server and computer readable storage medium
CN108681504A (en) * 2018-04-13 2018-10-19 深圳壹账通智能科技有限公司 Automated testing method, test server and computer readable storage medium
CN111581103A (en) * 2020-05-11 2020-08-25 成都库珀区块链科技有限公司 Data detection method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100192128A1 (en) * 2009-01-27 2010-07-29 Honeywell International Inc. System and methods of using test points and signal overrides in requirements-based test generation
CN102521700A (en) * 2011-12-13 2012-06-27 广东电网公司信息中心 Electrical network informatization evaluation rapid test system
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
US20140181591A1 (en) * 2012-12-20 2014-06-26 Microsoft Corporation Test strategy for profile-guided code execution optimizers
CN105260303A (en) * 2015-10-10 2016-01-20 浪潮电子信息产业股份有限公司 Automated-test based agile testing scheme
CN106776339A (en) * 2016-12-30 2017-05-31 上海亿账通互联网科技有限公司 Automated testing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100192128A1 (en) * 2009-01-27 2010-07-29 Honeywell International Inc. System and methods of using test points and signal overrides in requirements-based test generation
CN102521700A (en) * 2011-12-13 2012-06-27 广东电网公司信息中心 Electrical network informatization evaluation rapid test system
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
US20140181591A1 (en) * 2012-12-20 2014-06-26 Microsoft Corporation Test strategy for profile-guided code execution optimizers
CN105260303A (en) * 2015-10-10 2016-01-20 浪潮电子信息产业股份有限公司 Automated-test based agile testing scheme
CN106776339A (en) * 2016-12-30 2017-05-31 上海亿账通互联网科技有限公司 Automated testing method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515852A (en) * 2019-08-30 2019-11-29 北京浪潮数据技术有限公司 A kind of application update test method and relevant apparatus based on agile development
CN111367555A (en) * 2020-03-23 2020-07-03 北京字节跳动网络技术有限公司 Assertion method, assertion device, electronic equipment and computer readable medium
CN111367555B (en) * 2020-03-23 2023-08-08 抖音视界有限公司 Assertion method, assertion device, electronic equipment and computer readable medium
CN112925716A (en) * 2021-03-19 2021-06-08 广东好太太智能家居有限公司 Visual image testing method and device and storage medium
CN112925716B (en) * 2021-03-19 2024-01-23 广东好太太智能家居有限公司 Visual image testing method, visual image testing equipment and storage medium

Also Published As

Publication number Publication date
CN106776339B (en) 2018-07-24
CN106776339A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
WO2018120965A1 (en) Automatic test method and device, and computer-readable storage medium
US11281570B2 (en) Software testing method, system, apparatus, device medium, and computer program product
WO2018010552A1 (en) Test method and device
US9824002B2 (en) Tracking of code base and defect diagnostic coupling with automated triage
CN110362480A (en) Client buries a test method, device, equipment and storage medium
CN106951369B (en) Management method and device for joint debugging test
US9396092B1 (en) Software testing with feedback acquisition
US10089109B2 (en) System and method for evaluating human resources in a software development environment
US8209658B2 (en) Method of creating signatures for classifying program failures
CN105302722B (en) CTS automatic testing method and device
CN108491321B (en) Method and device for determining test case range and storage medium
CN108923997B (en) Cloud service node automatic testing method and device based on python
US20180357143A1 (en) Testing computing devices
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
CN111274154A (en) Automatic testing method, device, equipment and storage medium
CN108509344B (en) Daily cutting batch test method, equipment and readable storage medium
CN113448862B (en) Software version testing method and device and computer equipment
CN110297767B (en) Automatic execution method, device, equipment and storage medium for test cases
US20150089290A1 (en) Derivation of generalized test cases
CN111198811A (en) Page automatic test method and device, electronic equipment and storage medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
US9886374B1 (en) Virtual device farm for software testing
WO2019005294A1 (en) Recovery of application from error
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17888801

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17888801

Country of ref document: EP

Kind code of ref document: A1