Unlock instant, AI-driven research and patent intelligence for your innovation.

Test method, system and device for associated source code and test case, and storage medium

A test case and test method technology, applied in the computer field, can solve problems such as non-real-time, time-consuming, and long execution code, so as to improve test efficiency and user experience, and avoid excessive execution time.

Pending Publication Date: 2021-04-02
上海品顺信息科技有限公司
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] At present, from the perspective of the industry, if you want to know which class names / method names of the source code are covered by the mobile iOS test cases, you need to rely on code coverage technology, but because the code coverage data on the mobile terminal is recorded in the bytecode Therefore, the generation is not real-time, but requires the combination of execution data and symbol data, which will cause the execution code of a single test case entered by the user to be too long, more time-consuming, and less efficient

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Test method, system and device for associated source code and test case, and storage medium
  • Test method, system and device for associated source code and test case, and storage medium
  • Test method, system and device for associated source code and test case, and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0057] In view of the defects existing in the existing technology, the inventor actively researches and innovates based on years of rich practical experience and professional knowledge in this industry, and cooperates with the application of academic theory, in order to create a practical technology that can overcome the above defects , making it more practical. After continuous research, design and repeated trials and improvements, the present invention with real practical value is finally created.

[0058] see figure 1 , figure 1 It is a schematic flowchart of a test method for associating source code and test cases disclosed in the embodiment of the present invention. The method is applicable to the scenario of executing test cases for software testing. The method is executed by a test system that associates source code and test cases. The system It can be implemented by software and / or hardware, and integrated inside the computer. like figure 1 As shown, the test metho...

test Embodiment ID

[0069] If so, the method name / class name of the source code covered by the recorded test case is associated with the test case ID and stored in the library;

[0070] If not, continue to execute the step of detecting whether an instruction to end recording input through the floating bar is received.

[0071] It should be noted that after implementing the solution provided in this embodiment, the processing time for recording a class name / method name for a single test case is reduced from 2 minutes to less than 1 second, and the IOS device only needs to consume one time without restarting the App. Complete the hook operation of all method names / class names in minutes, and at the same time solve the problem of memory overflow due to too many class names / method names of hooks using source code.

[0072] The embodiment of the present invention provides a test method for associating source code and test cases, which can learn the method name / class name of the source code covered by ...

Embodiment 2

[0074] like figure 2 As shown, the test method for associating source code and test cases provided by Embodiment 2 of the present invention is based on the technical solution provided by Embodiment 1, to step S101 "when it is detected that the APP is started, start a global scan and add a Hook " Further optimization. Explanations of terms that are the same as or corresponding to the above embodiments are not repeated here. which is:

[0075] When it detects that the APP is started, it detects whether the test switch is turned on;

[0076] If so, start a global scan and add Hooks.

[0077] Based on the above optimization, such as figure 2 As shown, a test method for associating source code and test cases provided in this embodiment may include the following steps:

[0078] S201. When it is detected that the APP is started, check whether the test switch is turned on; if yes, execute step S202; if not, continue to execute S201.

[0079] It should be noted that, in this em...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a test method, system and device for an associated source code and a test case, and a storage medium. The method comprises the steps of starting global scanning when an APP isdetected to be started, and carrying out Hook addition; after the Hook is added, displaying a suspension bar used for recording the test case in the APP; when the test case ID and a recording startinginstruction input through the suspension bar are received, executing the test case corresponding to the test case ID; in the process of executing the test case, recording a method name / class name ofa source code covered by the test case in a Hook mode; and after the execution of the test case is finished, associating the recorded method name / class name of the source code covered by the test casewith the test case ID, and storing the method name / class name in a library. According to the invention, the method name / class name of the source code covered by the executed test case can be learnedin real time, so that the problem that the execution time of entering a single test case by a user is too long is avoided, and the test efficiency and the user experience are improved.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a test method, system, equipment and storage medium for associating source codes with test cases. Background technique [0002] Software testing refers to the process of running a program under specified conditions to find program errors, measure software quality, and evaluate whether it meets design requirements. In the field of software testing, test cases are often used to test source code. Among them, a test case is a set of documents consisting of preconditions, inputs, execution conditions, expected results, etc., to complete the test of a specific requirement or goal, and to reflect the test plan, method, technology and strategy. [0003] At present, from the perspective of the industry, if you want to know which class names / method names of the source code are covered by the mobile iOS test cases, you need to rely on code coverage technology, but because the code covera...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684
Inventor 陈超咏
Owner 上海品顺信息科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More