WO2019200808A1 - 测试案例推荐方法、电子装置及可读存储介质 - Google Patents

测试案例推荐方法、电子装置及可读存储介质 Download PDF

Info

Publication number
WO2019200808A1
WO2019200808A1 PCT/CN2018/102405 CN2018102405W WO2019200808A1 WO 2019200808 A1 WO2019200808 A1 WO 2019200808A1 CN 2018102405 W CN2018102405 W CN 2018102405W WO 2019200808 A1 WO2019200808 A1 WO 2019200808A1
Authority
WO
WIPO (PCT)
Prior art keywords
test case
test
software system
http request
tested
Prior art date
Application number
PCT/CN2018/102405
Other languages
English (en)
French (fr)
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 WO2019200808A1 publication Critical patent/WO2019200808A1/zh

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
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a test case recommendation method, an electronic device, and a readable storage medium.
  • code coverage is the proportion of source code being tested.
  • code coverage data can only represent which code has been tested, and does not represent whether or not to test the code with the appropriate test case.
  • the dynamic link refers to a method chain or the like that passes through a dynamic process in which the system under test initiates an http request to the web server.
  • generally only all test cases can be executed or manually performed by an experienced tester. Some test cases are selected for testing, and it is not possible to automatically recommend accurate and appropriate test cases to execute the tests, resulting in inefficient testing.
  • the purpose of the present application is to provide a test case recommendation method, an electronic device, and a readable storage medium, which are intended to improve test efficiency.
  • a first aspect of the present application provides an electronic device, where the electronic device includes a memory and a processor, and the memory stores a test case recommendation system that can be run on the processor, where the test case is The recommendation system implements the following steps when executed by the processor:
  • the mapping relationship between each test case and the Hypertext Transfer Protocol (HTTP) request is established according to a preset rule, and the HTTP request and the waiting are performed. Testing the mapping relationship of method chains in the software system;
  • HTTP Hypertext Transfer Protocol
  • the affected method chain is analyzed by the change code; and the HTTP request corresponding to the affected method chain is determined according to the mapping relationship between the established HTTP request and the method chain; The mapping relationship between the test case and the HTTP request, and determine the test case mapped by the HTTP request corresponding to the affected method chain;
  • the recommended test case is a test case for performing a test on the software system to be tested.
  • test case recommendation method includes:
  • mapping relationship between each test case and the HTTP request is established according to a preset rule, and the HTTP request and the method chain in the software system to be tested are Mapping relationship;
  • the affected method chain is analyzed by the change code; and the HTTP request corresponding to the affected method chain is determined according to the mapping relationship between the established HTTP request and the method chain; The mapping relationship between the test case and the HTTP request, and determine the test case mapped by the HTTP request corresponding to the affected method chain;
  • the recommended test case is a test case for performing a test on the software system to be tested.
  • a third aspect of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a test case recommendation system, where the test case recommendation system can be executed by at least one processor And causing the at least one processor to perform the steps of the test case recommendation method as described above.
  • the test case recommendation method, system and readable storage medium provided by the application when the code change occurs in the software system to be tested, analyze the affected method chain by changing the code; according to the pre-established HTTP request and method chain
  • the mapping relationship determines the HTTP request corresponding to the affected method chain; according to the mapping relationship between the established test case and the HTTP request, the test case mapped by the HTTP request corresponding to the affected method chain is determined to be recommended.
  • the mapping relationship between each test case and the HTTP request and the mapping relationship between the HTTP request and the method chain in the software system to be tested are established in the dynamic link execution test process of the test software system in the test case.
  • the relationship between the affected method chain and the HTTP request and the test case may be changed according to the code, and according to the affected method chain, HTTP request, and test.
  • the relationship between the three cases is used to recommend the test case. It can accurately test the case for the change code, maximize the use of test execution resources, and improve test efficiency.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a test case recommendation system 10 of the present application;
  • FIG. 2 is a schematic flowchart diagram of an embodiment of a test case recommendation method according to the present application.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of the test case recommendation system 10 of the present application.
  • test case recommendation system 10 is installed and operated in the electronic device 1.
  • the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a display 13.
  • Figure 1 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 is at least one type of readable computer storage medium, which in some embodiments may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • SMC smart memory card
  • secure digital device Secure Digital, SD
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 is configured to store application software and various types of data installed in the electronic device 1, such as program code of the test case recommendation system 10.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 in some embodiments, may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example
  • the test case recommendation system 10 and the like are executed.
  • the display 13 in some embodiments may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display 13 is used to display information processed in the electronic device 1 and a user interface for displaying visualization, such as marking a change code of a software system to be tested, a test case for final recommendation execution, and the like.
  • the components 11-13 of the electronic device 1 communicate with one another via a system bus.
  • the test case recommendation system 10 includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement various embodiments of the present application.
  • test case recommendation system 10 when executed by the processor 12, the following steps are implemented:
  • Step S1 In the dynamic test execution test of the test software system to be tested in the preset test case, establish a mapping relationship between each test case and the HTTP request according to a preset rule, and an HTTP request and the software system to be tested.
  • the mapping relationship of the method chain In the dynamic test execution test of the test software system to be tested in the preset test case, establish a mapping relationship between each test case and the HTTP request according to a preset rule, and an HTTP request and the software system to be tested. The mapping relationship of the method chain.
  • the HTTP request entering the software system to be tested and the method chain through which the HTTP request passes are recorded; the software system to be tested is entered.
  • the HTTP request is associated with the method chain through which the HTTP request passes, establishing a mapping relationship between the HTTP request and the method chain; and associating the executed test case with the HTTP request entering the software system to be tested, establishing a test case and HTTP The mapping relationship between requests.
  • the test software system performs the test process, records the HTTP request b entering the software system to be tested and the method chain c through which the HTTP request b passes; associates the HTTP request b with the method chain c, and establishes Mapping between the HTTP request and the method chain; associating the test case a with the HTTP request b, establishing a mapping relationship between the test case and the HTTP request, and finally establishing the test case a and the HTTP request b, the method chain c The mapping relationship between the three.
  • the test cases preset in this embodiment include but are not limited to interface test cases, Web (web) test cases, and the like.
  • the preset test case can be either a self-written test case or a call to an existing test case, such as a statement covering test cases, decision coverage test cases, and condition coverage tests designed for code that implements different functions. Cases, decision conditions cover test cases, conditional combination coverage test cases, path coverage test cases, etc., are not limited here.
  • step S2 when a code change occurs in the software system to be tested, the affected method chain is analyzed by changing the code; and the HTTP request corresponding to the affected method chain is determined according to the mapping relationship between the established HTTP request and the method chain. According to the mapping relationship between the established test case and the HTTP request, the test case mapped by the HTTP request corresponding to the affected method chain is determined.
  • step S3 the determined test case is a test case for performing a test on the software system to be tested.
  • the test case is used to perform the test.
  • determine the change code in the software system to be tested such as obtaining the record recorded by the preset version management tool corresponding to the software system to be tested (for example, the open source version control system SVN, CVS or distributed version control system GIT, etc.)
  • the code analyzes all the change codes between the different versions of the submitted software system to be tested; then, determines the method chain associated with all the change codes, ie as the affected method chain.
  • the SVN when the code is submitted to the SVN, the SVN will record and analyze all the code change records between the two software versions on the SVN. For example, the two software versions of the code can be compared, and the different software parts between the two software versions. As a change code. Then, the affected method (chain) is analyzed by the change code. For example, in one embodiment, by correlating the code coverage test data of the software system to be tested in the past, it is possible to determine the function code associated with each part.
  • the method chain for example, the code chain corresponding to the code for implementing the "registration" function is "A", the method chain corresponding to the code for implementing the "login” function is "B", and the like.
  • the affected method chain is determined for the change code between the two software versions, including: (1) when the change code is a change (modification or update) of the same function code between the two software versions, for example, before The "Registration" function code portion of a software version is changed to form the latter software version, and it is determined that the method chain affected by the change code is "A”. (2) When the change code is the addition or deletion of different function codes between the two software versions, for example, adding or deleting the "login" function code in the previous software version to form the latter software version, Determine the method chain affected by the change code as "B". In summary, the method chain associated with the change code can be determined as the affected method chain.
  • the appropriate test case can be recommended according to the association mapping between the test case, the method chain and the HTTP request dynamically determined in the process of executing each test case.
  • the HTTP request corresponding to the affected method chain may be determined according to the mapping relationship between the determined method chain and the HTTP request, and then determined according to the mapping relationship between the determined HTTP request and the test case.
  • the test case corresponding to the HTTP request is used as the recommended test case to be executed.
  • the affected method chain is analyzed by changing the code; and the mapping relationship between the HTTP request and the method chain is determined according to the pre-established mapping relationship between the HTTP request and the method chain.
  • the HTTP request corresponding to the affected method chain; according to the mapping relationship between the established test case and the HTTP request, the test case mapped by the HTTP request corresponding to the affected method chain is determined to be recommended.
  • the mapping relationship between each test case and the HTTP request and the mapping relationship between the HTTP request and the method chain in the software system to be tested are established in the dynamic link execution test process of the test software system in the test case.
  • the relationship between the affected method chain and the HTTP request and the test case may be changed according to the code, and according to the affected method chain, HTTP request, and test.
  • the relationship between the three cases is used to recommend the test case. It can accurately test the case for the change code, maximize the use of test execution resources, and improve test efficiency.
  • test case recommendation system 10 when executed by the processor 12, the method includes the following steps:
  • a Java bytecode tool as a Java proxy.
  • a preset web server When a preset web server is started, a preset test case is used to test the software system, and the filter is used to enhance the filter of the software system to be tested.
  • the filter To capture an HTTP request entering the software system to be tested; and use the Java proxy to record a method chain through which an HTTP request entering the software system under test passes.
  • the association mapping between the test case, the method chain, and the HTTP request is dynamically determined in the process of executing each test case.
  • the Java bytecode toolkit can be configured as a javassist or Java proxy.
  • Javassist is an open source java bytecode operation tool, which is mainly used to modify and process the compiled class files.
  • the javassist toolkit is first configured as a java proxy.
  • the web (website) server is started, the java proxy is used to intercept the class file of the software system to be tested before or during the running. For example, modify the bytecode to enhance the method (chain) in the test software system code to record information about the method (chain) (such as name, number, etc.); and to filter the software system to be tested. Enhanced to capture information about HTTP requests.
  • an HTTP request to the software system to be tested can be recorded, and the method (chain) through which the HTTP request to the test software system passes is saved, and the HTTP request is associated with the method chain.
  • the mapping between the method chain and the HTTP request can be established.
  • the test case to be executed is associated with the HTTP request entering the software system to be tested during the execution of the test case, and after a plurality of test cases are executed in sequence, the mapping relationship between the HTTP request and the test case can be established.
  • FIG. 2 is a schematic flowchart of an embodiment of a test case recommendation method according to the present application.
  • the test case recommendation method includes the following steps:
  • Step S10 During the dynamic test execution test of the test software system to be tested in the preset test case, establish a mapping relationship between each test case and the HTTP request according to a preset rule, and an HTTP request and the software system to be tested. The mapping relationship of the method chain.
  • the HTTP request entering the software system to be tested and the method chain through which the HTTP request passes are recorded; the software system to be tested is entered.
  • the HTTP request is associated with the method chain through which the HTTP request passes, establishing a mapping relationship between the HTTP request and the method chain; and associating the executed test case with the HTTP request entering the software system to be tested, establishing a test case and HTTP The mapping relationship between requests.
  • the test software system performs the test process, records the HTTP request b entering the software system to be tested and the method chain c through which the HTTP request b passes; associates the HTTP request b with the method chain c, and establishes Mapping between the HTTP request and the method chain; associating the test case a with the HTTP request b, establishing a mapping relationship between the test case and the HTTP request, and finally establishing the test case a and the HTTP request b, the method chain c The mapping relationship between the three.
  • the test cases preset in this embodiment include but are not limited to interface test cases, Web (web) test cases, and the like.
  • the preset test case can be either a self-written test case or a call to an existing test case, such as a statement covering test cases, decision coverage test cases, and condition coverage tests designed for code that implements different functions. Cases, decision conditions cover test cases, conditional combination coverage test cases, path coverage test cases, etc., are not limited here.
  • Step S20 When a code change occurs in the software system to be tested, the affected method chain is analyzed by changing the code; and the HTTP request corresponding to the affected method chain is determined according to the mapping relationship between the established HTTP request and the method chain. According to the mapping relationship between the established test case and the HTTP request, the test case mapped by the HTTP request corresponding to the affected method chain is determined.
  • the determined test case is a test case for performing a test on the software system to be tested.
  • the test case is used to perform the test.
  • determine the change code in the software system to be tested such as obtaining the record recorded by the preset version management tool corresponding to the software system to be tested (for example, the open source version control system SVN, CVS or distributed version control system GIT, etc.)
  • the code analyzes all the change codes between the different versions of the submitted software system to be tested; then, determines the method chain associated with all the change codes, ie as the affected method chain.
  • the SVN when the code is submitted to the SVN, the SVN will record and analyze all the code change records between the two software versions on the SVN. For example, the two software versions of the code can be compared, and the different software parts between the two software versions. As a change code. Then, the affected method (chain) is analyzed by the change code. For example, in one embodiment, by correlating the code coverage test data of the software system to be tested in the past, it is possible to determine the function code associated with each part.
  • the method chain for example, the code chain corresponding to the code for implementing the "registration" function is "A", the method chain corresponding to the code for implementing the "login” function is "B", and the like.
  • the affected method chain is determined for the change code between the two software versions, including: (1) when the change code is a change (modification or update) of the same function code between the two software versions, for example, before The "Registration" function code portion of a software version is changed to form the latter software version, and it is determined that the method chain affected by the change code is "A”. (2) When the change code is the addition or deletion of different function codes between the two software versions, for example, adding or deleting the "login" function code in the previous software version to form the latter software version, Determine the method chain affected by the change code as "B". In summary, the method chain associated with the change code can be determined as the affected method chain.
  • the appropriate test case can be recommended according to the association mapping between the test case, the method chain and the HTTP request dynamically determined in the process of executing each test case.
  • the HTTP request corresponding to the affected method chain may be determined according to the mapping relationship between the determined method chain and the HTTP request, and then determined according to the mapping relationship between the determined HTTP request and the test case.
  • the test case corresponding to the HTTP request is used as the recommended test case to be executed.
  • the affected method chain is analyzed by changing the code; and the mapping relationship between the HTTP request and the method chain is determined according to the pre-established mapping relationship between the HTTP request and the method chain.
  • the HTTP request corresponding to the affected method chain; according to the mapping relationship between the established test case and the HTTP request, the test case mapped by the HTTP request corresponding to the affected method chain is determined to be recommended.
  • the mapping relationship between each test case and the HTTP request and the mapping relationship between the HTTP request and the method chain in the software system to be tested are established in the dynamic link execution test process of the test software system in the test case.
  • the relationship between the affected method chain and the HTTP request and the test case may be changed according to the code, and according to the affected method chain, HTTP request, and test.
  • the relationship between the three cases is used to recommend the test case. It can accurately test the case for the change code, maximize the use of test execution resources, and improve test efficiency.
  • the step S10 includes:
  • a Java bytecode tool as a Java proxy.
  • a preset web server When a preset web server is started, a preset test case is used to test the software system, and the filter is used to enhance the filter of the software system to be tested.
  • the filter To capture an HTTP request entering the software system to be tested; and use the Java proxy to record a method chain through which an HTTP request entering the software system under test passes.
  • the association mapping between the test case, the method chain, and the HTTP request is dynamically determined in the process of executing each test case.
  • the Java bytecode toolkit can be configured as a javassist or Java proxy.
  • Javassist is an open source java bytecode operation tool, which is mainly used to modify and process the compiled class files.
  • the javassist toolkit is first configured as a java proxy.
  • the web (website) server is started, the java proxy is used to intercept the class file of the software system to be tested before or during the running. For example, modify the bytecode to enhance the method (chain) in the test software system code to record information about the method (chain) (such as name, number, etc.); and to filter the software system to be tested. Enhanced to capture information about HTTP requests.
  • an HTTP request to the software system to be tested can be recorded, and the method (chain) through which the HTTP request to the test software system passes is saved, and the HTTP request is associated with the method chain.
  • the mapping between the method chain and the HTTP request can be established.
  • the test case to be executed is associated with the HTTP request entering the software system to be tested during the execution of the test case, and after a plurality of test cases are executed in sequence, the mapping relationship between the HTTP request and the test case can be established.
  • the present application also provides a computer readable storage medium storing a test case recommendation system, the test case recommendation system being executable by at least one processor to cause the at least one processor.
  • 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 application 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 mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

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

Abstract

本申请涉及一种测试案例推荐方法、电子装置及可读存储介质,该方法包括:在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与超文本传输协议HTTP请求之间的映射关系,及HTTP请求与待测试软件系统中方法链的映射关系;当待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例;推荐确定出的测试案例为对待测试软件系统执行测试的测试案例。本申请针对变更代码进行精准的测试案例推荐,最大化利用测试执行资源,提高测试效率。

Description

测试案例推荐方法、电子装置及可读存储介质
优先权申明
本申请基于巴黎公约申明享有2018年04月17日递交的申请号为CN 2018103450268、名称为“测试案例推荐方法、电子装置及可读存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种测试案例推荐方法、电子装置及可读存储介质。
背景技术
现有的软件测试中,衡量测试质量的一个重要指标是代码覆盖率,即源代码被测试的比例。然而,代码覆盖率数据只能代表测试过哪些代码,不能代表是否利用合适的测试案例来测试好这些代码。例如,在利用测试案例对待测系统进行测试时,有时需针对待测系统的动态链路进行测试。该动态链路指的是在待测系统向web服务器发起http请求的动态过程中所经过的方法链等。现有技术中无法根据该动态过程中涉及的方法链、http请求有针对性地向测试人员推荐相应的测试案例,现有技术中一般只能执行所有的测试案例或由经验丰富的测试人员人工挑选出部分测试案例来进行测试,而无法自动推荐出精准合适的测试案例来执行测试,导致测试效率低下。
发明内容
本申请的目的在于提供一种测试案例推荐方法、电子装置及可读 存储介质,旨在提高测试效率。
为实现上述目的,本申请第一方面提供一种电子装置,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的测试案例推荐系统,所述测试案例推荐系统被所述处理器执行时实现如下步骤:
在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与超文本传输协议(HTTP)请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系;
当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例;
推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
此外,为实现上述目的,本申请第二方面还提供一种测试案例推荐方法,所述测试案例推荐方法包括:
在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系;
当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射 的测试案例;
推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
进一步地,为实现上述目的,本申请第三方面还提供一种计算机可读存储介质,所述计算机可读存储介质存储有测试案例推荐系统,所述测试案例推荐系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述的测试案例推荐方法的步骤。
本申请提出的测试案例推荐方法、系统及可读存储介质,当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据预先建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例来进行推荐。由于能预先在测试案例对待测试软件系统的动态链路执行测试过程中,建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系,在待测软件系统中出现代码变更时,可根据该代码变更对应的受影响的方法链与HTTP请求、测试案例三者之间的关联关系分析,并根据受影响的方法链、HTTP请求和测试案例三者之间的关联关系来进行测试案例的推荐,能针对变更代码进行精准的测试案例推荐,最大化利用测试执行资源,提高测试效率。
附图说明
图1为本申请测试案例推荐系统10较佳实施例的运行环境示意图;
图2为本申请测试案例推荐方法一实施例的流程示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
本申请提供一种测试案例推荐系统。请参阅图1,是本申请测试案例推荐系统10较佳实施例的运行环境示意图。
在本实施例中,所述的测试案例推荐系统10安装并运行于电子装置1中。该电子装置1可包括,但不仅限于,存储器11、处理器12及显示器13。图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述存储器11为至少一种类型的可读计算机存储介质,所述存储器11在一些实施例中可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘或内存。所述存储器11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字 (Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括所述电子装置1的内部存储单元也包括外部存储设备。所述存储器11用于存储安装于所述电子装置1的应用软件及各类数据,例如所述测试案例推荐系统10的程序代码等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器11中存储的程序代码或处理数据,例如执行所述测试案例推荐系统10等。
所述显示器13在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器13用于显示在所述电子装置1中处理的信息以及用于显示可视化的用户界面,例如标记出待测试软件系统的变更代码、最终推荐执行的测试案例等。所述电子装置1的部件11-13通过系统总线相互通信。
测试案例推荐系统10包括至少一个存储在所述存储器11中的计算机可读指令,该至少一个计算机可读指令可被所述处理器12执行,以实现本申请各实施例。
其中,上述测试案例推荐系统10被所述处理器12执行时实现如下步骤:
步骤S1,在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系。
本实施例中,在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经 过的方法链;将进入所述待测试软件系统的HTTP请求与该HTTP请求经过的方法链进行关联,建立HTTP请求与方法链之间的映射关系;并将执行的测试案例与进入所述待测试软件系统的HTTP请求进行关联,建立测试案例与HTTP请求之间的映射关系。例如,测试案例a对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求b及该HTTP请求b所经过的方法链c;将HTTP请求b与方法链c进行关联,建立HTTP请求与方法链之间的映射关系;并将测试案例a与HTTP请求b进行关联,建立测试案例与HTTP请求之间的映射关系,最终即可建立测试案例a与HTTP请求b、方法链c这三者之间的映射关系。其中,本实施例中预设的测试案例包括但不限于接口测试案例、Web(网页)测试案例等等。预设的测试案例既可以是有针对性自主编写的测试案例,也可以是调用已有的测试案例,如针对实现不同功能的代码所设计的语句覆盖测试案例、判定覆盖测试案例、条件覆盖测试案例、判定条件覆盖测试案例、条件组合覆盖测试案例、路径覆盖测试案例等等,在此不做限定。
步骤S2,当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例。
步骤S3,推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
本实施例中,当待测软件系统出现代码变更时,需利用测试案例来执行测试。首先确定出待测软件系统中的变更代码,如获取待测试软件系统对应的预设版本管理工具(例如开放源代码的版本控制系统 SVN、CVS或分布式版本控制系统GIT等)所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;然后,确定出所有变更代码相关联的方法链,即作为受影响的方法链。
例如,当代码提交到SVN时,SVN会进行记录,分析SVN上两个软件版本间的所有代码变更记录,如可对两个软件版本的代码进行比对,两个软件版本间不同的代码部分作为变更代码。然后,通过变更代码分析出受影响的方法(链),例如,在一种实施方式中,通过对过往对待测软件系统的代码覆盖测试数据进行统计,可确定出与各个部分功能代码相关联的方法链,例如,用于实现“注册”功能的代码所对应的方法链为“A”,用于实现“登录”功能的代码所对应的方法链为“B”,等。针对两个软件版本间的变更代码确定出受影响的方法链包括:(1)、当该变更代码为对两个软件版本间同一种功能代码的更改(修改或更新)时,例如,对前一个软件版本中的“注册”功能代码部分进行更改,形成后一个软件版本,则确定出由变更代码受影响的方法链为“A”。(2)、当该变更代码为对两个软件版本间不同功能代码的增加或删减时,例如,在前一个软件版本中增加或删减“登录”功能代码,形成后一个软件版本,则确定出由变更代码受影响的方法链为“B”。综上,即可确定出所述变更代码关联的方法链,作为受影响的方法链。
通过变更代码分析出受影响的方法链后,可根据在各个测试案例执行的过程中动态确定出的测试案例、方法链与HTTP请求之间的关联映射关系,推荐合适的测试案例。具体地,可先根据确定好的方法链与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求;再根据确定好的HTTP请求与测试案例之间的映射关系,确定出所述HTTP请求对应的测试案例,将确定出的测试案例作为推 荐的待执行的测试案例。
与现有技术相比,本实施例中当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据预先建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例来进行推荐。由于能预先在测试案例对待测试软件系统的动态链路执行测试过程中,建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系,在待测软件系统中出现代码变更时,可根据该代码变更对应的受影响的方法链与HTTP请求、测试案例三者之间的关联关系分析,并根据受影响的方法链、HTTP请求和测试案例三者之间的关联关系来进行测试案例的推荐,能针对变更代码进行精准的测试案例推荐,最大化利用测试执行资源,提高测试效率。
在一可选的实施例中,在上述实施例的基础上,所述测试案例推荐系统10被所述处理器12执行上述步骤S1时,包括以下步骤:
配置Java字节码工具作为Java代理,当预设的Web服务器启动,预设的测试案例对待测试软件系统执行测试过程中,利用所述Java代理对所述待测试软件系统的过滤器进行增强,以捕获进入所述待测试软件系统的HTTP请求;并利用所述Java代理记录进入所述待测试软件系统的HTTP请求所经过的方法链。
本实施例中,首先在各个测试案例执行的过程中动态地确定出测试案例、方法链与HTTP请求之间的关联映射关系。具体地,可配置Java字节码工具包作为javassist即Java代理,Javassist是一个开源的java字节码操作工具,主要用于对已经编译好的class文件进行修改 和处理。在本实施例中,先配置javassist工具包作为java代理,当web(网站)服务器启动时,利用java代理在加载待测试软件系统的class文件之前或运行期间来进行拦截。例如,对字节码做修改,以对待测试软件系统代码中的方法(链)进行增强,以便记录方法(链)的相关信息(如名称、编号等);并对待测试软件系统的过滤器进行增强,以便捕获HTTP请求相关信息。
例如,在一个测试案例的执行过程中,可记录进入待测试软件系统的HTTP请求,并将进入待测试软件系统的HTTP请求所经过的方法(链)保存起来,使HTTP请求和方法链进行关联,即可建立方法链与HTTP请求之间的映射关系。并且,将执行的测试案例与在该测试案例执行过程中进入待测试软件系统的HTTP请求进行关联,在依次执行完若干测试案例后,即可建立HTTP请求与测试案例之间的映射关系。
如图2所示,图2为本申请测试案例推荐方法一实施例的流程示意图,该测试案例推荐方法包括以下步骤:
步骤S10,在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系。
本实施例中,在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链;将进入所述待测试软件系统的HTTP请求与该HTTP请求经过的方法链进行关联,建立HTTP请求与方法链之间的映射关系;并将执行的测试案例与进入所述待测试软件系统的HTTP请求进行关联,建立测试案例与HTTP请求之间的映射关系。例如,测试案例a对待测试软件系统执行测试过程中,记录进入所述待测试软件系统 的HTTP请求b及该HTTP请求b所经过的方法链c;将HTTP请求b与方法链c进行关联,建立HTTP请求与方法链之间的映射关系;并将测试案例a与HTTP请求b进行关联,建立测试案例与HTTP请求之间的映射关系,最终即可建立测试案例a与HTTP请求b、方法链c这三者之间的映射关系。其中,本实施例中预设的测试案例包括但不限于接口测试案例、Web(网页)测试案例等等。预设的测试案例既可以是有针对性自主编写的测试案例,也可以是调用已有的测试案例,如针对实现不同功能的代码所设计的语句覆盖测试案例、判定覆盖测试案例、条件覆盖测试案例、判定条件覆盖测试案例、条件组合覆盖测试案例、路径覆盖测试案例等等,在此不做限定。
步骤S20,当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例。
步骤S30,推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
本实施例中,当待测软件系统出现代码变更时,需利用测试案例来执行测试。首先确定出待测软件系统中的变更代码,如获取待测试软件系统对应的预设版本管理工具(例如开放源代码的版本控制系统SVN、CVS或分布式版本控制系统GIT等)所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;然后,确定出所有变更代码相关联的方法链,即作为受影响的方法链。
例如,当代码提交到SVN时,SVN会进行记录,分析SVN上两个软件版本间的所有代码变更记录,如可对两个软件版本的代码进 行比对,两个软件版本间不同的代码部分作为变更代码。然后,通过变更代码分析出受影响的方法(链),例如,在一种实施方式中,通过对过往对待测软件系统的代码覆盖测试数据进行统计,可确定出与各个部分功能代码相关联的方法链,例如,用于实现“注册”功能的代码所对应的方法链为“A”,用于实现“登录”功能的代码所对应的方法链为“B”,等。针对两个软件版本间的变更代码确定出受影响的方法链包括:(1)、当该变更代码为对两个软件版本间同一种功能代码的更改(修改或更新)时,例如,对前一个软件版本中的“注册”功能代码部分进行更改,形成后一个软件版本,则确定出由变更代码受影响的方法链为“A”。(2)、当该变更代码为对两个软件版本间不同功能代码的增加或删减时,例如,在前一个软件版本中增加或删减“登录”功能代码,形成后一个软件版本,则确定出由变更代码受影响的方法链为“B”。综上,即可确定出所述变更代码关联的方法链,作为受影响的方法链。
通过变更代码分析出受影响的方法链后,可根据在各个测试案例执行的过程中动态确定出的测试案例、方法链与HTTP请求之间的关联映射关系,推荐合适的测试案例。具体地,可先根据确定好的方法链与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求;再根据确定好的HTTP请求与测试案例之间的映射关系,确定出所述HTTP请求对应的测试案例,将确定出的测试案例作为推荐的待执行的测试案例。
与现有技术相比,本实施例中当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据预先建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的 方法链对应的HTTP请求所映射的测试案例来进行推荐。由于能预先在测试案例对待测试软件系统的动态链路执行测试过程中,建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系,在待测软件系统中出现代码变更时,可根据该代码变更对应的受影响的方法链与HTTP请求、测试案例三者之间的关联关系分析,并根据受影响的方法链、HTTP请求和测试案例三者之间的关联关系来进行测试案例的推荐,能针对变更代码进行精准的测试案例推荐,最大化利用测试执行资源,提高测试效率。
在一可选的实施例中,在上述实施例的基础上,所述步骤S10包括:
配置Java字节码工具作为Java代理,当预设的Web服务器启动,预设的测试案例对待测试软件系统执行测试过程中,利用所述Java代理对所述待测试软件系统的过滤器进行增强,以捕获进入所述待测试软件系统的HTTP请求;并利用所述Java代理记录进入所述待测试软件系统的HTTP请求所经过的方法链。
本实施例中,首先在各个测试案例执行的过程中动态地确定出测试案例、方法链与HTTP请求之间的关联映射关系。具体地,可配置Java字节码工具包作为javassist即Java代理,Javassist是一个开源的java字节码操作工具,主要用于对已经编译好的class文件进行修改和处理。在本实施例中,先配置javassist工具包作为java代理,当web(网站)服务器启动时,利用java代理在加载待测试软件系统的class文件之前或运行期间来进行拦截。例如,对字节码做修改,以对待测试软件系统代码中的方法(链)进行增强,以便记录方法(链)的相关信息(如名称、编号等);并对待测试软件系统的过滤器进行增强,以便捕获HTTP请求相关信息。
例如,在一个测试案例的执行过程中,可记录进入待测试软件系统的HTTP请求,并将进入待测试软件系统的HTTP请求所经过的方法(链)保存起来,使HTTP请求和方法链进行关联,即可建立方法链与HTTP请求之间的映射关系。并且,将执行的测试案例与在该测试案例执行过程中进入待测试软件系统的HTTP请求进行关联,在依次执行完若干测试案例后,即可建立HTTP请求与测试案例之间的映射关系。
此外,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有测试案例推荐系统,所述测试案例推荐系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述实施例中的测试案例推荐方法的步骤,该测试案例推荐方法的步骤S10、S20、S30等具体实施过程如上文所述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在 一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上参照附图说明了本申请的优选实施例,并非因此局限本申请的权利范围。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本领域技术人员不脱离本申请的范围和实质,可以有多种变型方案实现本申请,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本申请的技术构思之内所作的任何修改、等同替换和改进,均应在本申请的权利范围之内。

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的测试案例推荐系统,所述测试案例推荐系统被所述处理器执行时实现如下步骤:
    在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系;
    当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例;
    推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
  2. 如权利要求1所述的电子装置,其特征在于,所述在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系的步骤包括:
    在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链;
    将进入所述待测试软件系统的HTTP请求与该HTTP请求经过的方法链进行关联,建立HTTP请求与方法链之间的映射关系;并将执行的测试案例与进入所述待测试软件系统的HTTP请求进行关联,建立测试案例与HTTP请求之间的映射关系。
  3. 如权利要求2所述的电子装置,其特征在于,所述在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链的步骤包括:
    配置Java字节码工具作为Java代理,当预设的Web服务器启动,预设的测试案例对待测试软件系统执行测试过程中,利用所述Java代理对所述待测试软件系统的过滤器进行增强,以捕获进入所述待测试软件系统的HTTP请求;并利用所述Java代理记录进入所述待测试软件系统的HTTP请求所经过的方法链。
  4. 如权利要求1所述的电子装置,其特征在于,所述当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  5. 如权利要求2所述的电子装置,其特征在于,所述当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  6. 如权利要求3所述的电子装置,其特征在于,所述当所述待 测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  7. 如权利要求1所述的电子装置,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  8. 如权利要求2所述的电子装置,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  9. 如权利要求3所述的电子装置,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  10. 一种测试案例推荐方法,其特征在于,所述测试案例推荐方法包括:
    在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系;
    当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例;
    推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
  11. 如权利要求10所述的测试案例推荐方法,其特征在于,所述在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系的步骤包括:
    在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链;
    将进入所述待测试软件系统的HTTP请求与该HTTP请求经过的方法链进行关联,建立HTTP请求与方法链之间的映射关系;并将执行的测试案例与进入所述待测试软件系统的HTTP请求进行关联,建立测试案例与HTTP请求之间的映射关系。
  12. 如权利要求11所述的测试案例推荐方法,其特征在于,所述在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链的步骤包括:
    配置Java字节码工具作为Java代理,当预设的Web服务器启动,预设的测试案例对待测试软件系统执行测试过程中,利用所述Java代理对所述待测试软件系统的过滤器进行增强,以捕获进入所述待测试软件系统的HTTP请求;并利用所述Java代理记录进入所述待测试软件系统的HTTP请求所经过的方法链。
  13. 如权利要求10所述的测试案例推荐方法,其特征在于,所述当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS 和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  14. 如权利要求11所述的测试案例推荐方法,其特征在于,所述当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  15. 如权利要求12所述的测试案例推荐方法,其特征在于,所述当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链包括:
    获取待测试软件系统对应的预设版本管理工具所记录的提交代码,分析待测试软件系统的不同版本提交代码之间的所有变更代码;所述预设版本管理工具包括开放源代码的版本控制系统SVN、CVS和分布式版本控制系统GIT;
    确定出所有变更代码相关联的方法链,作为受影响的方法链。
  16. 如权利要求10所述的测试案例推荐方法,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  17. 如权利要求11所述的测试案例推荐方法,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  18. 如权利要求12所述的测试案例推荐方法,其特征在于,所述预设的测试案例包括接口测试案例和/或Web测试案例。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存 储介质上存储有测试案例推荐系统,所述测试案例推荐系统被处理器执行时实现如下步骤:
    在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系;
    当所述待测软件系统中出现代码变更时,通过变更代码分析出受影响的方法链;根据建立的HTTP请求与方法链的映射关系,确定出受影响的方法链对应的HTTP请求;根据建立的测试案例与HTTP请求之间的映射关系,确定出受影响的方法链对应的HTTP请求所映射的测试案例;
    推荐确定出的测试案例为对所述待测试软件系统执行测试的测试案例。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述在预设的测试案例对待测试软件系统的动态链路执行测试过程中,按预设规则建立每一测试案例与HTTP请求之间的映射关系,以及HTTP请求与所述待测试软件系统中方法链的映射关系的步骤包括:
    在预设的测试案例对待测试软件系统执行测试过程中,记录进入所述待测试软件系统的HTTP请求及该HTTP请求所经过的方法链;
    将进入所述待测试软件系统的HTTP请求与该HTTP请求经过的方法链进行关联,建立HTTP请求与方法链之间的映射关系;并将执行的测试案例与进入所述待测试软件系统的HTTP请求进行关联,建立测试案例与HTTP请求之间的映射关系。
PCT/CN2018/102405 2018-04-17 2018-08-27 测试案例推荐方法、电子装置及可读存储介质 WO2019200808A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810345026.8 2018-04-17
CN201810345026.8A CN108829575B (zh) 2018-04-17 2018-04-17 测试案例推荐方法、电子装置及可读存储介质

Publications (1)

Publication Number Publication Date
WO2019200808A1 true WO2019200808A1 (zh) 2019-10-24

Family

ID=64155426

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102405 WO2019200808A1 (zh) 2018-04-17 2018-08-27 测试案例推荐方法、电子装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN108829575B (zh)
WO (1) WO2019200808A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905031A (zh) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 一种基于精准质量保障系统的测试用例推荐方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258876B (zh) * 2018-11-30 2023-08-01 中国移动通信集团浙江有限公司 一种微服务架构下的精确回归测试方法及装置
CN110413506B (zh) * 2019-06-19 2023-02-03 平安普惠企业管理有限公司 测试用例推荐方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9419884B1 (en) * 2012-12-28 2016-08-16 Emc Corporation Intelligent automated testing method for restful web services
CN107341098A (zh) * 2017-07-13 2017-11-10 携程旅游信息技术(上海)有限公司 软件性能测试方法、平台、设备及存储介质
US20180121327A1 (en) * 2016-10-28 2018-05-03 Ingram Micro Inc. System and Method for Debugging Applications on a Developer Workstation

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101393807B1 (ko) * 2012-11-22 2014-05-12 슈어소프트테크주식회사 소프트웨어 회귀 검증 장치 및 그 방법
CN103870384B (zh) * 2012-12-11 2017-02-08 航天信息股份有限公司 测试用例推定方法及系统
CN104657256B (zh) * 2013-11-19 2018-07-31 阿里巴巴集团控股有限公司 一种收集用例与代码之间映射关系的方法和装置
CN105205000B (zh) * 2015-10-12 2018-01-23 用友网络科技股份有限公司 定位软件开发中代码受影响范围的方法及系统
CN107515826B (zh) * 2017-08-28 2020-12-01 阿里巴巴(中国)有限公司 测试用例精准推荐方法、装置、系统、设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9419884B1 (en) * 2012-12-28 2016-08-16 Emc Corporation Intelligent automated testing method for restful web services
US20180121327A1 (en) * 2016-10-28 2018-05-03 Ingram Micro Inc. System and Method for Debugging Applications on a Developer Workstation
CN107341098A (zh) * 2017-07-13 2017-11-10 携程旅游信息技术(上海)有限公司 软件性能测试方法、平台、设备及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905031A (zh) * 2023-03-14 2023-04-04 云筑信息科技(成都)有限公司 一种基于精准质量保障系统的测试用例推荐方法
CN115905031B (zh) * 2023-03-14 2023-06-23 云筑信息科技(成都)有限公司 一种基于精准质量保障系统的测试用例推荐方法

Also Published As

Publication number Publication date
CN108829575A (zh) 2018-11-16
CN108829575B (zh) 2021-08-24

Similar Documents

Publication Publication Date Title
Kula et al. Do developers update their library dependencies? An empirical study on the impact of security advisories on library migration
US10419546B2 (en) Migration assessment for cloud computing platforms
US10481964B2 (en) Monitoring activity of software development kits using stack trace analysis
EP3234851B1 (en) A system and method for facilitating static analysis of software applications
US8819644B2 (en) Selective data flow analysis of bounded regions of computer software applications
WO2019200808A1 (zh) 测试案例推荐方法、电子装置及可读存储介质
US11361149B2 (en) Techniques for web framework detection
WO2019140850A1 (zh) 测试案例推荐方法、电子装置及可读存储介质
WO2019169760A1 (zh) 测试用例范围确定方法、装置及存储介质
CN111563257B (zh) 数据检测方法及装置、计算机可读介质及终端设备
US10229273B2 (en) Identifying components for static analysis of software applications
US20120054724A1 (en) Incremental static analysis
JP2016099857A (ja) 不正プログラム対策システムおよび不正プログラム対策方法
CN108763054B (zh) 测试案例的测试效果展示方法、电子装置及存储介质
US10929265B2 (en) Optimizing automated interactions with web applications
JP5006824B2 (ja) テストプログラム管理システム
US11119763B2 (en) Cognitive selection of software developer for software engineering task
CN113238884B (zh) 一种固件文件的检测方法、装置、电子设备及存储介质
CN110764784B (zh) 一种识别三方so文件的方法、智能终端及存储介质
CN112559370A (zh) 一种基于前端的React项目单元测试方法及相关设备
CN117762818A (zh) 一种软件精准测试的方法、装置、设备及介质
JP2002091764A (ja) プログラム品質管理支援システム、その方法およびプログラム品質管理支援プログラムを記録したコンピュータ読み取り可能な記録媒体
TW201514728A (zh) 文件下載系統及方法
CN117435464A (zh) 软件测试方法及装置、电子设备和计算机可读存储介质
CN114637681A (zh) 基于人工智能的h5页面调试及评估方法及相关设备

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: 18915352

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: 18915352

Country of ref document: EP

Kind code of ref document: A1