CN107678948B - Test case generation method, terminal and storage medium - Google Patents

Test case generation method, terminal and storage medium Download PDF

Info

Publication number
CN107678948B
CN107678948B CN201710848937.8A CN201710848937A CN107678948B CN 107678948 B CN107678948 B CN 107678948B CN 201710848937 A CN201710848937 A CN 201710848937A CN 107678948 B CN107678948 B CN 107678948B
Authority
CN
China
Prior art keywords
historical operation
test case
target
timestamp
starting point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710848937.8A
Other languages
Chinese (zh)
Other versions
CN107678948A (en
Inventor
康德恩
何方
梁玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maojia Technology Guangdong Co ltd
Original Assignee
Maojia Technology Guangdong Co ltd
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 Maojia Technology Guangdong Co ltd filed Critical Maojia Technology Guangdong Co ltd
Priority to CN201710848937.8A priority Critical patent/CN107678948B/en
Publication of CN107678948A publication Critical patent/CN107678948A/en
Application granted granted Critical
Publication of CN107678948B publication Critical patent/CN107678948B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

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

The invention discloses a test case generation method, a terminal and a storage medium, wherein the method comprises the following steps: acquiring a historical operation record of target equipment and a first timestamp when abnormality occurs; searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp; and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point. According to the invention, the target historical operation is searched from the historical operation record, the starting point of the test case is determined according to the target historical operation, and the problem is accurately positioned, so that the problem of the test case is generated and solved, the problem is prevented from flowing into the market due to the difficulty in positioning and the problem which cannot be further solved, the product quality is improved, and the user experience is improved.

Description

Test case generation method, terminal and storage medium
Technical Field
The invention relates to the field of automatic testing, in particular to a test case generation method, a terminal and a storage medium.
Background
The labor cost in China is higher and higher, and the automatic test is urgently needed to reduce the testing labor. The factory needs to improve the testing efficiency and guarantee the product quality by using an automatic technology during industrial transformation. The existing operating systems all have log systems, and all kinds of abnormal states can see related information on the log systems. Software developers are difficult to locate problems according to the logs, often need testers to help to reproduce the problems, and many problems are sporadic and difficult to reproduce. Because of the difficulty in reproducing, these problems can flow to the market and eventually be met by customer complaints. The existing automatic test case is completely written manually according to the experience of testers. For accidental problems, reasonable test cases are difficult to write.
The above information is only for assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above information is prior art.
Disclosure of Invention
The invention mainly aims to provide a test case generation method, a terminal and a storage medium, and aims to solve the technical problem that the corresponding test case cannot be written due to the difficulty in positioning.
In order to achieve the above object, the present invention provides a test case generation method, which includes the following steps:
acquiring a historical operation record of target equipment and a first timestamp when abnormality occurs;
searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp;
and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point.
Preferably, the determining a starting point of the test case according to the target historical operation specifically includes:
judging whether the target historical operation is preset data or not;
and when the target historical operation record is the preset data, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
Preferably, after determining whether the target historical operation is preset data, the method further includes:
when the target historical operation is not the preset data, acquiring a second timestamp corresponding to the target historical operation;
and searching a new target historical operation which is before the second timestamp and is closest to the second timestamp from the historical operation record, and then executing the step of judging whether the target historical operation is preset data.
Preferably, the preset data specifically includes: the application starts data or adjusts the operation interface without a screen menu, or stays in a page for more than preset time and does not send any operation instruction or has a preset number of page switching records.
Preferably, the historical operating record comprises: historical operation and historical page data;
accordingly, the target historical operation which is before the first time stamp and is closest to the first time stamp is searched from the historical operation record; determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point, wherein the method specifically comprises the following steps:
searching target historical operation and target historical page data which are before the first timestamp and are closest to the first timestamp from the historical operation records;
and determining a starting point of the test case according to the target historical operation and the historical page data, and generating the test case according to the determined starting point.
Preferably, before the obtaining of the historical operation record of the target device and the first timestamp when the abnormality occurs, the method further includes:
acquiring a system log of the target equipment;
and determining whether the target equipment has abnormality according to the system log, and executing the step of acquiring the historical operation record of the target equipment and the first time stamp when the target equipment has abnormality.
Preferably, the determining whether the system is abnormal according to the system log specifically includes:
searching an abnormal identifier according to the system log;
and judging whether the system is abnormal or not according to the searched abnormal identifier.
Preferably, the determining whether the system is abnormal according to the found abnormal identifier specifically includes:
obtaining a third timestamp when the anomaly identifier occurs;
searching the historical operation record for the historical operation before the third time stamp;
and judging whether the system is abnormal or not according to the historical operation.
In addition, to achieve the above object, the present invention further provides a terminal, including: the test case generation method comprises a memory, a processor and a test case generation program which is stored on the memory and can run on the processor, wherein the test case generation program is configured to realize the steps of the test case generation method.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a test case generation program is stored, and the test case generation program, when executed by a processor, implements the steps of the test case generation method as described above.
The method comprises the steps of obtaining a historical operation record of target equipment and a first timestamp when abnormality occurs; searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp; and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point. And accurately positioning the problem according to the first timestamp and the target historical operation, so that a test case is generated to solve the problem, and the problem is prevented from flowing into the market due to the fact that the problem cannot be further solved due to difficulty in positioning.
Drawings
FIG. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of a test case generation method of the present invention;
FIG. 2 is a flowchart illustrating a test case generation method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a test case generation method according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a test case generating method according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory terminal separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The terminal may be a desktop computer, a notebook computer, a television, a smart phone, or a tablet computer, which is not limited in this embodiment.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test case generation program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting a server and performing data communication with the server; the user interface 1003 is mainly used for receiving an instruction input by a user, and the terminal invokes the test case generation program stored in the memory 1005 through the processor 1001 and executes the following operations:
acquiring a historical operation record of target equipment and a first timestamp when abnormality occurs;
searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp;
and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
judging whether the target historical operation is preset data or not;
and when the target historical operation record is the preset data, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
when the target historical operation is not the preset data, acquiring a second timestamp corresponding to the target historical operation;
and searching a new target historical operation which is before the second timestamp and is closest to the second timestamp from the historical operation record, and then executing the step of judging whether the target historical operation is preset data.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
searching target historical operation and target historical page data which are before the first timestamp and are closest to the first timestamp from the historical operation records;
and determining a starting point of the test case according to the target historical operation and the historical page data, and generating the test case according to the determined starting point.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
acquiring a system log of the target equipment;
and determining whether the target equipment has abnormality according to the system log, and executing the step of acquiring the historical operation record of the target equipment and the first time stamp when the target equipment has abnormality.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
searching an abnormal identifier according to the system log;
and judging whether the system is abnormal or not according to the searched abnormal identifier.
Further, the processor 1001 may call the test case generation program stored in the memory 1005, and further perform the following operations:
obtaining a third timestamp when the anomaly identifier occurs;
searching the historical operation record for the historical operation before the third time stamp;
and judging whether the system is abnormal or not according to the historical operation.
Based on the hardware structure, the embodiment of the test case generation method is provided.
Referring to fig. 2, a first embodiment of a test case generation method according to the present invention is provided.
In this embodiment, the test case generation method includes the following steps:
step S10, acquiring the historical operation record of the target device and a first time stamp when abnormality occurs;
it is understood that the target device may be a television, a smart phone, a tablet computer, a notebook computer, or a desktop computer, which is not limited in this embodiment.
It should be noted that, a log system is usually provided in the operating system of the target device, and records are provided for the running state of the target device, which is generally called a system log, when the target device is abnormal, various abnormal states can be checked on the system log, each log has a corresponding timestamp, and when the target device is abnormal, the timestamp, i.e. the first timestamp, at the time of the abnormality can be found according to the system log.
It should be understood that when the device performs various operations, the system usually has an operation record, and any operation performed by the device system at each time can be checked according to the operation record, and each operation corresponds to a corresponding timestamp, so that it can be clearly understood when the corresponding operation is performed, and the operation record is analyzed, so as to find the timestamp where the problem occurs, thereby locating the problem.
Step S20, searching the historical operation record for the target historical operation which is before the first time stamp and is closest to the first time stamp;
it can be understood that, in the prior art, when an anomaly occurs, a problem often flows into the market because the problem cannot be accurately located, in this embodiment, when the anomaly occurs, a first timestamp corresponding to the occurrence of the anomaly is acquired, a historical operation before the first timestamp is searched from a historical operation record of a target device system, the historical operation closest to the first timestamp is used as a target historical operation, and the target historical operation is analyzed, so that the problem is located.
And step S30, determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point.
It should be understood that the target historical operation is analyzed, whether the target historical operation is abnormal operation data or not is judged, when the target historical operation is abnormal operation data, a time stamp appearing in the target historical operation can be determined as a time stamp of occurrence of a problem, a starting point of a test case can be determined, and then the test case is generated, so that a corresponding problem is solved.
It should be noted that when the target history operation is not abnormal operation data, it is described that the first timestamp is not time when a problem occurs, and then an abnormal operation needs to be further searched, at this time, a second timestamp corresponding to the target history operation is obtained, a new target history operation which is before the second timestamp and is closest to the second timestamp is searched from the history operation record, and then a start point of the test case is determined according to the new target history operation. Therefore, the starting point of the test case can be determined until the searched target historical operation can be determined.
In a specific implementation, in the history operation record, there may be history page data in addition to the history operation, and in order to find out the timestamp of the occurrence of the problem more comprehensively and more accurately, in this embodiment, the history operation record includes: historical operation and historical page data;
accordingly, the target historical operation which is before the first time stamp and is closest to the first time stamp is searched from the historical operation record; determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point, wherein the method specifically comprises the following steps:
searching target historical operation and target historical page data which are before the first timestamp and are closest to the first timestamp from the historical operation records;
and determining a starting point of the test case according to the target historical operation and the historical page data, and generating the test case according to the determined starting point.
According to the scheme of the embodiment, the historical operation record of the target equipment and the first time stamp when the abnormality occurs are obtained; searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp; and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point. The problem is accurately positioned according to the first timestamp and the target historical operation, so that a test case is generated to solve the problem, the problem is prevented from flowing into the market due to the fact that the problem cannot be further solved due to the fact that the problem is difficult to position, the product quality is improved, and the user experience is improved.
Further, as shown in fig. 3, a second embodiment of the test case generation method according to the present invention is provided based on the first embodiment.
In this embodiment, the step S30 specifically includes:
step S301, judging whether the target historical operation is preset data or not;
it can be understood that, when the target historical operation is analyzed, and an abnormal operation usually occurs, the target historical operation is different from a normal operation, the preset data is abnormal operation data, and when the target historical operation is the preset data, it can be determined that a problem occurs, and then a timestamp corresponding to the target historical operation is used as a starting point of the test case. In order to accurately locate the timestamp of the occurrence of the problem, in this embodiment, the preset abnormal data includes: application launch data; or, there is no menu type of screen to regulate the operation interface; or, staying in a page for more than preset time and not sending any operation instruction; or, there are a preset number of page switching records.
It should be understood that, when the application is started, an abnormality such as a stuck event is likely to occur, if the target historical operation is application starting data, the timestamp corresponding to the application starting data is determined to be a timestamp in which the abnormality occurs, and the timestamp corresponding to the application starting data is used as a starting point of the test case. And when the target historical operation is application starting data, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
It can be understood that the screen menu type adjusting interface is a rectangular menu of adjusting item information of the display popped up on the screen after pressing a menu key, and various working indexes of the display including color, mode, geometric shape and the like can be adjusted through the menu, so that the optimal use state is achieved. And when the target historical operation is a screen-free menu type adjusting interface, the target historical operation is abnormal operation. For example: if the video is played for a long time and is abnormal in the process of playing the video, and the screen menu type adjusting interface cannot be displayed, the video directly enters the playing interface, and the timestamp corresponding to the historical operation of playing the video is used as the starting point of the test case. And when the target historical operation is a screen-menu-free adjustment operation interface, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
It should be noted that, when the target device is running, the target device usually does not stay in a page for too long, and if the target device stays in a page for too long and does not send any operation instruction, this page is an abnormal page, for example: if the target device is tested, the target device sends test instructions all the time, the interval time between the test instructions is usually only 10 seconds, and if one page stays for 2 minutes and no operation instruction is sent, the exception is considered to exist, and the timestamp appearing on the secondary page is used as the starting point of the test case. When the target historical operation is a page staying for more than preset time and no operation instruction is sent, the timestamp corresponding to the target historical operation can be used as the starting point of the test case.
It should be understood that the more steps that are generally regressed, the easier it is to reproduce the exception box, that is, the more page switches, the easier it is for the exception box to be reproduced, and when there are generally 10 page switch records, the exception box can be reproduced. And when the target historical operation has a preset number of page switching records, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
Step S302, when the target historical operation record is the preset data, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
In a specific implementation, whether the target historical operation is application starting data or not can be judged; or, there is no menu type of screen to regulate the operation interface; or, staying in a page for more than preset time and not sending any operation instruction; or, there is any one of the preset number of page switching records, and when the target historical operation record is in any one of the four situations, the timestamp corresponding to the target historical operation is used as the starting point of the test case.
In this embodiment, after the step S301, the method further includes:
step S303, when the target historical operation is not the preset data, acquiring a second timestamp corresponding to the target historical operation;
it should be understood that, when the target historical operation is not the preset data, it is considered that the timestamp corresponding to the target historical operation is not the time when the problem occurs, and cannot be used as the starting point of the test case, at this time, the historical operation in the historical operation record should be continuously searched until the searched historical operation is the preset data. Therefore, a second timestamp corresponding to the target historical operation is obtained, and a new target historical operation is searched forward according to the second timestamp.
Step S304, searching a new target historical operation which is before the second timestamp and is closest to the second timestamp from the historical operation record, and then executing step S301.
It can be understood that when the target historical operation is not the preset data, the historical operation is continuously searched in the historical operation record, if the target historical operation is the historical operation which is before the first time stamp and is closest to the first time stamp, the historical operation needs to be searched again, so that the second time stamp corresponding to the target historical operation is obtained, the historical operation which is before the second time stamp is searched in the historical operation record of the target equipment system, the historical operation which is closest to the second time stamp is used as a new target historical operation, the new target historical operation is analyzed, whether the operation is the preset data or not is judged, and therefore a problem is located.
In the above solution of this embodiment, by analyzing the target historical operation, when the target historical operation is preset data, taking a timestamp corresponding to the target historical operation as a starting point of a test case, when the target historical operation is not the preset abnormal data, continuously searching a new target historical operation that is before a second timestamp corresponding to the target historical operation and is closest to the second timestamp from the historical operation record, and then according to whether the new target historical operation is preset data or not, until the found new historical operation is the preset data, taking the timestamp corresponding to the new historical operation as the starting point of the test case, so as to accurately locate a problem occurrence time according to the historical operation record, determine the starting point of the test case, and further generate the test case to solve the problem, the problem is avoided flowing to the market, the quality of the target equipment is improved, and the user experience is improved.
Further, as shown in fig. 4, a third embodiment of the test case generation method according to the present invention is provided based on the second embodiment.
In this embodiment, before the step S10, the method further includes:
step S01, acquiring a system log of the target device;
it should be understood that, there is usually a log system in the operating system of the target device, there is a record of the running state of the target device, which is usually called a system log, when the target device is abnormal, the various abnormal states can be seen on the system log, and each log has a corresponding timestamp. The system log of the target device is obtained from the log system of the target device.
Step S02, determining whether there is an abnormality in the target device according to the system log, and executing the step S10 when there is an abnormality in the target device.
It will be appreciated that by looking at the system log, it can be identified whether there is an anomaly in the target device, for example: the target device is a television or a smart phone, when a system of the television or the smart phone runs, software running information which is output in a standard mode is the system log, when the system is abnormal, an abnormal identifier can appear in the system log, and the abnormal identifier comprises a system abnormal tag, an error and a system state information field. According to the exception field, it may be identified whether the system of the target device has an exception, in this embodiment, the determining whether the system has an exception according to the system log specifically includes: searching an abnormal identifier according to the system log; and judging whether the system is abnormal or not according to the searched abnormal identifier.
It should be noted that, when finding the abnormal identifier according to the system log, according to a third timestamp corresponding to the abnormal identifier, finding a historical operation before the third timestamp in the historical operation record, and determining whether the found historical operation is an abnormal operation, so as to further determine whether an abnormality exists, in this embodiment, determining whether the system is abnormal according to the found abnormal identifier specifically includes: obtaining a third timestamp when the anomaly identifier occurs; searching the historical operation record for the historical operation before the third time stamp; and judging whether the system is abnormal or not according to the historical operation.
According to the scheme, the abnormal identifier is searched through the system log, whether the system is abnormal or not is judged, when the system is abnormal, the first time stamp when the abnormality occurs is obtained, the initial point of the test case is further determined according to historical operation before the first time stamp, the problem can be accurately positioned, the test case is generated, the problem is solved in time, the problem is prevented from flowing into the market, and the quality of target equipment is improved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a test case generation program is stored on the computer-readable storage medium, and when executed by a processor, the test case generation program implements the following operations:
acquiring a historical operation record of target equipment and a first timestamp when abnormality occurs;
searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp;
and determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point.
Further, when executed by the processor, the test case generator further performs the following operations:
judging whether the target historical operation is preset data or not;
and when the target historical operation record is the preset data, taking a timestamp corresponding to the target historical operation as a starting point of the test case.
Further, when executed by the processor, the test case generator further performs the following operations:
when the target historical operation is not the preset data, acquiring a second timestamp corresponding to the target historical operation;
and searching a new target historical operation which is before the second timestamp and is closest to the second timestamp from the historical operation record, and then executing the step of judging whether the target historical operation is preset data.
Further, when executed by the processor, the test case generator further performs the following operations:
searching target historical operation and target historical page data which are before the first timestamp and are closest to the first timestamp from the historical operation records;
and determining a starting point of the test case according to the target historical operation and the historical page data, and generating the test case according to the determined starting point.
Further, when executed by the processor, the test case generator further performs the following operations:
acquiring a system log of the target equipment;
and determining whether the target equipment has abnormality according to the system log, and executing the step of acquiring the historical operation record of the target equipment and the first time stamp when the target equipment has abnormality.
Further, when executed by the processor, the test case generator further performs the following operations:
searching an abnormal identifier according to the system log;
and judging whether the system is abnormal or not according to the searched abnormal identifier.
Further, when executed by the processor, the test case generator further performs the following operations:
obtaining a third timestamp when the anomaly identifier occurs;
searching the historical operation record for the historical operation before the third time stamp;
and judging whether the system is abnormal or not according to the historical operation.
According to the scheme, the target historical operation is searched from the historical operation record, the starting point of the test case is determined according to the target historical operation, and the problem is accurately positioned, so that the problem is solved by generating the test case, the problem is prevented from flowing into the market due to the fact that the problem is difficult to position and cannot be further solved, the product quality is improved, and the user experience is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The usage of the words first, second, third, etcetera herein does not indicate any ordering. These words may be interpreted as names.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the information in the specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A test case generation method is characterized by comprising the following steps:
acquiring a historical operation record of target equipment and a first timestamp when abnormality occurs;
searching the historical operation record for a target historical operation which is before the first time stamp and is closest to the first time stamp;
determining a starting point of a test case according to the target historical operation, and generating the test case according to the determined starting point;
wherein, the determining the starting point of the test case according to the target historical operation specifically comprises:
judging whether the target historical operation is preset data or not;
when the target historical operation record is the preset data, taking a timestamp corresponding to the target historical operation as a starting point of a test case;
after judging whether the target historical operation is preset data, the method further comprises the following steps:
when the target historical operation is not the preset data, acquiring a second timestamp corresponding to the target historical operation;
searching a new target historical operation which is before the second timestamp and is closest to the second timestamp from the historical operation record, and then executing the step of judging whether the target historical operation is preset data;
wherein the preset data includes: application launch data;
or, there is no menu type of screen to regulate the operation interface;
or, staying in a page for more than preset time and not sending any operation instruction;
or, there are a preset number of page switching records.
2. The test case generation method of claim 1, wherein the historical operational record comprises: historical operation and historical page data;
accordingly, the target historical operation which is before the first time stamp and is closest to the first time stamp is searched from the historical operation record; determining a starting point of the test case according to the target historical operation, and generating the test case according to the determined starting point, wherein the method specifically comprises the following steps:
searching target historical operation and target historical page data which are before the first timestamp and are closest to the first timestamp from the historical operation records;
and determining a starting point of the test case according to the target historical operation and the historical page data, and generating the test case according to the determined starting point.
3. The method for generating test cases according to claim 1, wherein before obtaining the historical operation record of the target device and the first timestamp when the abnormality occurs, the method further comprises:
acquiring a system log of the target equipment;
and determining whether the target equipment has abnormality according to the system log, and executing the step of acquiring the historical operation record of the target equipment and the first time stamp when the target equipment has abnormality.
4. The method for generating test cases according to claim 3, wherein the determining whether the system is abnormal according to the system log specifically includes:
searching an abnormal identifier according to the system log;
and judging whether the system is abnormal or not according to the searched abnormal identifier.
5. The method for generating a test case according to claim 4, wherein the determining whether the system is abnormal according to the found abnormal identifier specifically includes:
obtaining a third timestamp when the anomaly identifier occurs;
searching the historical operation record for the historical operation before the third time stamp;
and judging whether the system is abnormal or not according to the historical operation.
6. A terminal, characterized in that the terminal comprises: a memory, a processor, and a test case generation program stored on the memory and executable on the processor, the test case generation program configured to implement the steps of the test case generation method of any of claims 1 to 5.
7. A computer-readable storage medium, on which a test case generation program is stored, which when executed by a processor implements the steps of the test case generation method according to any one of claims 1 to 5.
CN201710848937.8A 2017-09-18 2017-09-18 Test case generation method, terminal and storage medium Active CN107678948B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710848937.8A CN107678948B (en) 2017-09-18 2017-09-18 Test case generation method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710848937.8A CN107678948B (en) 2017-09-18 2017-09-18 Test case generation method, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN107678948A CN107678948A (en) 2018-02-09
CN107678948B true CN107678948B (en) 2021-09-07

Family

ID=61137253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710848937.8A Active CN107678948B (en) 2017-09-18 2017-09-18 Test case generation method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107678948B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108490922B (en) * 2018-04-27 2020-03-24 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN109460349B (en) * 2018-09-19 2021-09-21 武汉达梦数据库股份有限公司 Test case generation method and device based on log
CN109460363B (en) * 2018-11-09 2022-04-01 贵州医渡云技术有限公司 Automatic testing method and device, electronic equipment and computer readable medium
CN111104324B (en) * 2019-12-17 2023-08-18 广州品唯软件有限公司 Method and device for generating test cases and computer readable storage medium
CN113221122A (en) * 2021-05-21 2021-08-06 珠海金山网络游戏科技有限公司 Vulnerability reproduction method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7661031B2 (en) * 2006-12-28 2010-02-09 International Business Machines Corporation Correlating macro and error data for debugging program error event
CN102831052B (en) * 2011-06-16 2016-03-09 中国银联股份有限公司 Test exemple automation generating apparatus and method
CN102768639B (en) * 2012-06-11 2015-02-18 北京奇虎科技有限公司 Operating system kernel-level error positioning method and device
CN105022694B (en) * 2015-08-19 2018-07-13 上海斐讯数据通信技术有限公司 Method for generating test case and system for mobile terminal test
US10013335B2 (en) * 2015-12-21 2018-07-03 Intel Corporation Data flow analysis in processor trace logs using compiler-type information method and apparatus
CN105955862A (en) * 2016-04-15 2016-09-21 乐视控股(北京)有限公司 Abnormal problem monitoring positioning method and device
CN106055473A (en) * 2016-05-23 2016-10-26 乐视控股(北京)有限公司 Test method and apparatus

Also Published As

Publication number Publication date
CN107678948A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
CN107678948B (en) Test case generation method, terminal and storage medium
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
US9280451B2 (en) Testing device
CN108427616B (en) Background program monitoring method and monitoring device
US20150331882A1 (en) Redundant file deletion method, apparatus and storage medium
CN111045952A (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN105302722B (en) CTS automatic testing method and device
CN106126414B (en) Application software testing method and system
CN107645546B (en) File monitoring method based on android system, intelligent device and storage medium
US10241808B2 (en) Determining test application effectiveness
US11294746B2 (en) Extracting moving image data from an error log included in an operational log of a terminal
US20140082582A1 (en) Resource Tracker
CN112988605A (en) Method and device for realizing WEB application automatic test
CN110795353B (en) Quick application debugging method, device, equipment and storage medium
CN110069406B (en) Automatic triggering TPC-DS test method and system
KR101689984B1 (en) Programmable controller, programmable controller system, and execute error information creation method
CN110750460A (en) Browser compatibility detection method, device, equipment and readable storage medium
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN112543478B (en) WiFi module automatic test method and device, computer equipment and storage medium
CN108073511B (en) Test code generation method and device
CN109656826B (en) Application testing method, system, device and computer readable storage medium
CN117009248A (en) Machine learning model testing method and device, electronic equipment and storage medium
CN106708705B (en) Terminal background process monitoring method and system
WO2014164079A1 (en) Method and system for analyzing a trace timeline of computer system activity
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 516000 No. 1 Qiaoguang Road, Chenjiang street, Zhongkai high tech Zone, Huizhou, Guangdong

Applicant after: Maojia Technology (Guangdong) Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. 19 district

Applicant before: TCL OVERSEAS ELECTRONICS (HUIZHOU) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant