A method and apparatus for defect reproduction
By recording and replaying the traffic data of the test equipment, bidirectional communication anomalies are detected, and the location of defects is determined. This solves the problems of long time consumption and low efficiency in defect reproduction in the mobile Internet industry, and realizes fast and convenient defect reproduction.
Patent Information
- Application Number
- CN202310003227.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-03
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-01-03
AI Technical Summary
The drawback of existing technologies is that, in the mobile internet industry, some defects are not always reproducible, resulting in a complicated, time-consuming, and inefficient defect reproduction process.
By recording the traffic data of the test equipment and storing it in the database management system, playing back the data in special scenarios, detecting bidirectional communication anomalies, determining the location of operational defects, and providing feedback on the judgment information, the system can achieve repeatable judgment and recording of defects.
It simplifies the defect reproduction process, shortens the time, and improves human efficiency.
Smart Images

Figure CN116248493B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of defect reproduction, in particular to a defect reproduction method and device. BACKGROUND
[0002] In the current mobile internet industry, because some defects are not stable and always present, even if the precondition, the model and system version of the problem, and the reproduction steps are known, the defects still cannot be reproduced stably. Moreover, when the precondition is complex, the reproduction of the defects is very time-consuming, and the input and output are very low. After the defects are repaired by the developers, the testers need to verify in time. At this time, the same precondition, model, and reproduction steps need to be simulated again, and the operation process is very complicated, resulting in low human efficiency. SUMMARY
[0003] The present application aims to provide a defect reproduction method to solve the problem of long defect reproduction time and low human efficiency caused by complicated defect reproduction process in the prior art.
[0004] To achieve the above-mentioned purpose, the present application provides the following technical solutions:
[0005] In one aspect, the present application provides a defect reproduction method, comprising:
[0006] Starting a flow recording program to record the flow data of the operation of the test device to be tested;
[0007] Storing the flow data recorded by the flow recording program into a database management system;
[0008] Starting a flow playback program and selecting a special scene to be played back;
[0009] Fetching the flow data corresponding to the special scene from the database management system and loading it into the flow playback program;
[0010] Sending the playback instructions of the flow playback program to the test device in sequence;
[0011] Detecting whether there is an exception in the bidirectional communication corresponding to the playback instruction issuing process and the network reply of the test device. If there is no exception in the bidirectional communication, the flow playback process continues to be executed until an exception occurs in the bidirectional communication;
[0012] According to the position of the exception, the operation position of the test device where the operation defect occurs is determined, and the information of the operation position is sent to the front end to make the front end feedback the defect reproduction judgment information;
[0013] In a case where the determination information indicates that the operation defect is a recurring defect, the operation defect is determined to be a recurring defect and is recorded.
[0014] Further, the recording test device needs to test the flow data of the operation , Comprise:
[0015] During the operation of the test device, the environment domain name of the network request is obtained, and it is determined whether the environment domain name conforms to the preset production environment, and if so, the traffic recording program continues to execute.
[0016] Further, the environment domain name of the network request is obtained, and it is determined whether the environment domain name conforms to the preset production environment, and further comprising:
[0017] If the environment domain name does not conform to the preset production environment, the traffic recording program will end immediately and give a pop-up prompt information.
[0018] Further, after determining that the environment domain name of the network request conforms to the preset production environment, further comprising:
[0019] It is determined whether the network request corresponding to the operation of the test device is obtained by using the hypertext transfer protocol, and if the network request corresponding to the operation of the test device is obtained by using the hypertext transfer protocol, the network request is recorded and an operation log is generated;
[0020] If the network request corresponding to the operation of the test device is not obtained by using the hypertext transfer protocol, the traffic recording program ends and does not record.
[0021] Further, the traffic data recorded by the traffic recording program is stored in the database management system, comprising:
[0022] After the traffic recording program is manually stopped, the operation log is summarized into a log file and stored in the database management system.
[0023] Further, the playback instruction of the traffic playback program is sent to the test device in sequence, comprising:
[0024] During the process of sending the playback instruction to the test device in sequence, a daemon process is started to detect whether there is an exception in the process of sending the playback instruction to the test device and the two-way communication corresponding to the network reply of the test device, and if an exception is detected in the two-way communication, a comparison text file command process is started for environment noise reduction processing.
[0025] Further, the information of the operation position is sent to the front end to make the front end feedback the determination information of defect recurrence, further comprising:
[0026] In the case that the determination information indicates that the operation defect is not a repeated defect, it is determined that the operation defect is not a repeated defect, and the front end feeds back corresponding prompt information to make the traffic playback program continue to execute.
[0027] In another aspect, a defect reproduction device is provided, comprising:
[0028] A recording module is configured to record traffic data of a program to be tested by the testing device.
[0029] A playback module is configured to execute the traffic playback program of the special scene.
[0030] An indication module is configured to indicate an operation position of the testing device where the operation defect occurs.
[0031] The present application has at least the following beneficial effects:
[0032] The present application records the traffic data of the operation to be tested by the testing device and stores it in a database management system, determines a special scene to be played back, and then loads the traffic data corresponding to the special scene from the database management system to the traffic playback program. The playback instructions of the traffic playback program are sent to the testing device in sequence, and the two-way communication between the playback instruction issuing process and the network receipt of the testing device is detected for abnormalities. If an abnormality is detected, the operation position of the testing device where the operation defect occurs is determined according to the position of the abnormality, and the operation position is sent to the front end to make the front end feed back determination information of defect reproduction. The determination information indicates whether the operation defect is a repeated defect. In the case that the operation defect is a repeated defect, the operation is recorded, and the reproduction of the defect is realized. The operation process is simple, the time required for defect reproduction is significantly shortened, and the human efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0034] Figure 1 is a flow chart of a defect reproduction method according to an exemplary embodiment;
[0035] Figure 2 is a flow chart of a traffic recording program method according to an exemplary embodiment;
[0036] Figure 3 is a flow chart of a method of a traffic playback procedure according to an exemplary embodiment;
[0037] Figure 4 is a block diagram schematic of an apparatus of defect reproduction according to an exemplary embodiment. DETAILED DESCRIPTION
[0038] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described in detail below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0039] Please refer to Figure 1 , Figure 1 is a flow chart of a method of defect reproduction according to an exemplary embodiment, the method comprising the following steps:
[0040] S101, starting a traffic recording procedure to record traffic data of operations required to be tested by a test device;
[0041] S102, storing the traffic data recorded by the traffic recording procedure into a database management system;
[0042] S103, starting a traffic playback procedure to select a special scene to be played back;
[0043] S104, calling the traffic data corresponding to the special scene from the database management system and loading the traffic data into the traffic playback procedure;
[0044] S105, calling playback instructions of the traffic playback procedure and sending the playback instructions to the test device in sequence;
[0045] S106, detecting whether there is an exception in bidirectional communication corresponding to the process of issuing the playback instructions and network feedback of the test device, if there is no exception in the bidirectional communication, the traffic playback procedure continues to be executed until an exception occurs in the bidirectional communication;
[0046] S107, determining an operation position of the test device where an operation defect occurs according to the position where the exception occurs, and sending information of the operation position to a front end to make the front end feed back judgment information of defect reproduction;
[0047] S108, in the case that the judgment information indicates that the operation defect is a repeatedly occurring defect, determining that the operation defect is a repeatedly occurring defect and recording the operation defect.
[0048] In practical application, the scheme stores the flow data of the operation to be tested by the test equipment into the database management system through the flow recording program, and the flow data in the database management system can be recalled at any time according to the needs in subsequent work, the flow playback program is started, the special scene to be played back is selected, and then the position of the operation defect in the operation process is determined according to the position of the exception in the process of executing the flow playback program, and whether the operation defect is a repeatedly occurring defect is judged, so that the method of reproducing the defect is simpler and easier to operate, and the artificial time is greatly shortened, and the work efficiency is improved.
[0049] Based on step S101, the flow recording program is started, and the flow data of the operation to be tested by the test equipment is recorded;
[0050] Specifically, please refer to Figure 2 , Figure 2 is a flowchart of a method of a flow recording program according to an exemplary embodiment. First, the flow recording program is started on a computer, the local IP address of the computer is queried, and then the network agent of the test equipment is set to enable the test equipment to access the local network of the computer, so that the network flow reaching the test equipment can be captured by the flow recording program on the computer.
[0051] After confirming that the network agent configuration of the test equipment is correct and that all network requests of the test equipment can be captured by the computer, a series of operations to be recorded are started on the test equipment.
[0052] Specifically, the test equipment is a mobile phone, the mobile phone is connected to the local network of the computer on which the flow recording program is started, the software to be tested is selected, and then a series of operations such as login, browsing goods, querying inventory, ordering and payment are performed on the mobile phone application program
[0053] At the same time of the operation of the test equipment, the flow recording program on the computer detects whether the environment domain name of the captured network request conforms to the preset production environment in real time. If it is judged that it conforms to the preset production environment, the flow recording program continues to record normally, and if it is judged that it does not conform to the preset production environment, the flow recording program will end immediately and give a pop-up prompt.
[0054] The above logical judgment is mainly controlled by environment variables. Different environments have a unique set of domain names, such as production environment, test environment, development environment, connection environment and pre-release environment. Only when the captured environment domain name conforms to the preset production environment, the flow recording program will run normally, otherwise it will exit immediately and give a prompt.
[0055] After determining that the environment domain name of the captured network request meets the preset production environment, the traffic recording program further determines whether the network request corresponding to the operation of the test device is obtained by using HTTP (Hyper Text Transfer Protocol). If the network request corresponding to the operation of the test device is obtained by using HTTP, the network request is temporarily recorded in the middleware, and an operation log is generated. If the network request corresponding to the operation of the test device is not obtained by using HTTP, the traffic recording program ends, and the operation log is not recorded.
[0056] Based on step S102, the traffic data recorded by the traffic recording program is stored in the database management system.
[0057] Specifically, in the manual stop case, the traffic recording program collects all the operation logs of the network requests recorded in the middleware into a log file and stores the log file in the database management system, so as to be called at any time.
[0058] The traffic recording program always executes the above-mentioned logic until it is manually stopped or an abnormal situation occurs.
[0059] Based on step S103, the traffic playback program is started, and a special scene to be played back is selected.
[0060] Specifically, please refer to Figure 3 , Figure 3 is a flowchart of a method of a traffic playback program according to an exemplary embodiment. The traffic playback program is started on a computer, the local IP address of the computer is queried, and the network proxy of the test device is set, so that the test device accesses the network of the local computer. In this way, the traffic playback program on the computer can send network requests to the test device, and the reply of the test device can also be sent back to the traffic playback program, so that bidirectional communication can be realized.
[0061] Based on step S104, the traffic data corresponding to the special scene is called from the database management system and loaded into the traffic playback program.
[0062] Step S105, the playback instructions of the traffic playback program are sequentially sent to the test device.
[0063] Specifically, after confirming that the test device and the computer network are connected correctly and the special scene to be played back is selected, the traffic playback program queries the traffic data stored in the database management system corresponding to the special scene to be played back and loads the traffic data into the traffic playback program. At the same time, the playback instructions in the traffic playback process are called, and the playback instructions are sequentially sent to the test device.
[0064] Based on step S106, the detection of the playback instruction issuing process and the network reply of the test equipment corresponding to the two-way communication is detected for abnormality. If the two-way communication is not abnormal, the traffic playback process continues to execute until the two-way communication is abnormal.
[0065] Step S107, according to the position of the abnormality, the operation position of the test equipment where the operation defect occurs is determined, and the information of the operation position is sent to the front end to make the front end feedback the determination information of the defect recurrence.
[0066] Step S108, in the case where the determination information indicates that the operation defect is a repeatedly occurring defect, it is determined that the operation defect is a repeatedly occurring defect, and the record is made.
[0067] Specifically, in the process of issuing the traffic playback program to the test equipment, a daemon is started to detect in real time whether the playback instruction issuing process to the test equipment and the network reply of the test equipment corresponding to the two-way communication are abnormal.
[0068] If the two-way communication is not abnormal, the traffic playback process continues to execute until the two-way communication is abnormal. According to the position of the abnormality, the operation position of the test equipment where the operation defect occurs is determined, and the information of the operation position is sent to the front end to make the front end feedback the determination information of the defect recurrence. In the case where the determination information indicates that the operation defect is a repeatedly occurring defect, it is determined that the operation defect is a repeatedly occurring defect, and the record is made.
[0069] In the specific implementation process, the determination of whether the defect is a repeatedly occurring defect can be but is not limited to the manual intervention to make the judgment. If the manual judgment is a repeatedly occurring defect, the traffic playback program is ended, and the process operation log is recorded.
[0070] In step S106, if the daemon detects an abnormality, a diff command is started to perform environment noise reduction processing.
[0071] Specifically, starting the diff command to perform environment noise reduction processing is to detect what causes the abnormality, and then make corresponding adjustments to make the traffic playback program continue to execute, for example, the request parameter is not the same, the corresponding parameter is adjusted; the returned message is not correct, the returned message is adjusted.
[0072] If the manual judgment is not a repeatedly occurring defect, the diff command is started to perform noise reduction processing, and corresponding adjustments are made to continue to execute the traffic playback program.
[0073] Please refer to Figure 4 , Figure 4This is a block diagram of a defect reproduction apparatus according to an exemplary embodiment. The defect reproduction apparatus 4 includes:
[0074] Recording module 41 is used to record the traffic data of the program that the test device needs to test;
[0075] Playback module 42 is used to execute traffic playback programs for special scenarios that require playback;
[0076] Indicator module 43 is used to indicate the location where an operational defect occurs in the test equipment.
[0077] Regarding the defect reproduction apparatus in the above embodiments, the specific manner in which it performs the defect reproduction method has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0078] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0079] It should be noted that in the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "multiple" or "more" means at least two.
[0080] It should be understood that when an element is referred to as "fixed to" or "set on" another element, it may be directly on the other element or may have an intervening element present at the same time; when an element is referred to as "connected to" another element, it may be directly connected to the other element or may have an intervening element present at the same time. In addition, the term "connected" as used herein may include wireless connections; the word "and / or" as used includes any unit and all combinations of one or more of the associated listed items.
[0081] Any process or method description in the flowchart or otherwise herein can be understood as: representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0082] It should be understood that each of the elements of the present application can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following technologies known in the art or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0083] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiment method can be completed by a program instructing the relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0084] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically, or two or more units can be integrated into one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software function module. The integrated module, if realized in the form of a software function module and sold or used as an independent product, can also be stored in a computer readable storage medium.
[0085] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.
[0086] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0087] Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.
Claims
1. A method of defect reproduction, characterized by, The method comprises: starting a traffic recording program to record traffic data of operations of a test device to be tested; storing the traffic data recorded by the traffic recording program into a database management system; starting a traffic playback program to select a special scene to be played back; calling the traffic data corresponding to the special scene from the database management system and loading the traffic data into the traffic playback program; sending playback instructions of the traffic playback program to the test device in sequence; detecting whether there is an abnormality in bidirectional communication corresponding to the process of sending the playback instructions and network feedback of the test device, if there is no abnormality in the bidirectional communication, the traffic playback process continues to be executed until an abnormality occurs in the bidirectional communication; determining an operation position of an operation defect of the test device according to the position of the abnormality, and sending information of the operation position to a front end to make the front end feed back determination information of defect reproduction; if the determination information indicates that the operation defect is a repeatedly occurring defect, determining that the operation defect is a repeatedly occurring defect and recording the same; recording the traffic data of the operations of the test device to be tested, comprising: acquiring an environment domain name of a network request in the process of the operation of the test device, and determining whether the environment domain name conforms to a preset production environment, if yes, the traffic recording program continues to be executed; acquiring the environment domain name of the network request, and determining whether the environment domain name conforms to the preset production environment, further comprising: if the environment domain name does not conform to the preset production environment, the traffic recording program will be immediately ended and a pop-up prompt information will be given; after it is determined that the environment domain name acquired by the network request conforms to the preset production environment, further comprising: determining whether the network request corresponding to the operation of the test device is acquired by using a hypertext transfer protocol, if the network request corresponding to the operation of the test device is acquired by using the hypertext transfer protocol, the network request is recorded and an operation log is generated; if the network request corresponding to the operation of the test device is not acquired by using the hypertext transfer protocol, the traffic recording program is ended and no recording is performed.
2. The method of claim 1, wherein, storing the traffic data recorded by the traffic recording program into the database management system, comprising: after the traffic recording program is manually stopped, the operation log is summarized into a log file and stored into the database management system.
3. The method of claim 2, wherein, sending the playback instructions of the traffic playback program to the test device in sequence, comprising: in the process of sending the playback instructions to the test device in sequence, starting a daemon process to detect whether there is an abnormality in bidirectional communication corresponding to the process of sending the playback instructions to the test device and network feedback of the test device, if an abnormality is detected in the bidirectional communication, starting a comparison text file command process to perform environment noise reduction processing.
4. The method of claim 3, wherein, sending the information of the operation position to the front end to make the front end feed back the determination information of defect reproduction, further comprising: In a case where the determination information indicates that the operation defect is not a recurring defect, it is determined that the operation defect is not a recurring defect, and the front-end feedback correspondingly prompts information to enable the traffic playback program to continue execution.
5. An apparatus for defect reproduction, characterized by The method for defect reproduction according to any one of claims 1 to 4, the device for defect reproduction, comprising: a recording module configured to record traffic data of a program to be tested by the test device; a playback module configured to execute the traffic playback program of the special scene; an indication module configured to indicate an operation position of the test device where the operation defect occurs.
Citation Information
Patent Citations
Recording and playback method and device and storage medium
CN114546814A
Using recorder technology to find defects in software applications
US20080141221A1