CN115509918A - Software testing method and device, electronic equipment and storage medium - Google Patents

Software testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115509918A
CN115509918A CN202211192496.8A CN202211192496A CN115509918A CN 115509918 A CN115509918 A CN 115509918A CN 202211192496 A CN202211192496 A CN 202211192496A CN 115509918 A CN115509918 A CN 115509918A
Authority
CN
China
Prior art keywords
interface
target
operation chain
chain
user
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.)
Pending
Application number
CN202211192496.8A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202211192496.8A priority Critical patent/CN115509918A/en
Publication of CN115509918A publication Critical patent/CN115509918A/en
Pending legal-status Critical Current

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
    • 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

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 embodiment of the invention provides a software testing method, a software testing device, electronic equipment and a storage medium, wherein an operation chain is obtained in advance based on the calling behavior of each interface generated by operating terminal equipment in the process of using software by a user, and then the interface is called based on the operation chain to test the function of each interface.

Description

Software testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a software testing method and apparatus, an electronic device, and a storage medium.
Background
Iterative upgrading of computer software, such as APPs (applications), is typically accomplished by adding a back-end interface or modifying the original interface. In order to ensure the availability and stability of the upgraded software, the upgraded software generally needs to be tested.
In the existing software testing mode, a tester generally writes a large number of test cases to test each interface function of the upgraded software. However, in the test mode, a tester needs to compile a used test case, and data which is not practical easily occurs when the test case is compiled manually, so that repeated tests are needed, and the software test efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a software testing method, a software testing device, electronic equipment and a storage medium, so as to improve software testing efficiency. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a software testing method, including:
acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
based on the target operation chain, calling each target interface according to the calling sequence;
and acquiring a software test result obtained based on a result returned after each target interface is called.
In a possible implementation manner, an operation chain identifier is preset for each interface;
the obtaining of the target operation chain comprises: acquiring a target operation chain from a preset operation log library; the operation log library is pre-established according to the following steps:
determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
for each user, arranging the interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain the operation chain corresponding to each operation chain identifier;
and storing the operation chain for each user.
In one possible implementation, the storing the operation chain includes: storing the operation chain identification and the operation chain correspondingly;
the obtaining of the target operation chain comprises:
acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
and acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested.
In a possible implementation manner, the software test result is obtained by the monitoring system based on a result returned after each target interface is called.
In a possible implementation manner, the obtaining a software test result obtained based on a result returned after each target interface is called includes:
obtaining and displaying a returned result after each target interface is called;
and acquiring a software test result input aiming at a returned result after each target interface is called.
In a second aspect of the present invention, there is also provided a software testing apparatus, comprising:
the extraction module is used for acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
the calling module is used for calling each target interface according to the calling sequence based on the target operation chain;
and the test result acquisition module is used for acquiring a software test result obtained based on a result returned after each target interface is called.
In a possible implementation manner, an operation chain identifier is preset for each interface;
the obtaining of the target operation chain comprises: acquiring a target operation chain from a preset operation log library; the operation log library is pre-established according to the following steps:
determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
aiming at each user, arranging interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain an operation chain corresponding to each operation chain identifier;
and storing the operation chain for each user.
In one possible implementation, the storing the operation chain includes: storing the operation chain identification and the operation chain correspondingly;
the obtaining of the target operation chain comprises:
acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
and acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested.
The implementation of the invention also provides electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for completing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the software testing method steps when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing any of the software testing methods described above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the software testing methods described above.
According to the software testing method provided by the embodiment of the invention, a target operation chain is obtained; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces; calling each target interface according to the calling sequence based on the target operation chain; and acquiring a software test result obtained based on a returned result after each target interface is called. By applying the embodiment of the invention, the operation chain is obtained in advance based on the calling behavior of each interface generated by the operation terminal equipment in the process of using software by a user, and then the interface is called based on the operation chain to test the function of each interface.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below.
FIG. 1 is a flow chart of a software testing method provided in an embodiment of the present invention;
FIG. 2 is a flow chart of creating an oplog library according to an embodiment of the present invention;
FIG. 3 is another flowchart of a software testing method provided in an embodiment of the present invention;
FIG. 4 is a flowchart of a software testing method provided in an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a software testing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In the prior art, the updated software is generally tested in the following way: in the mode 1, testers periodically return to test or rewrite a large number of test cases to perform online test, and the state of the interface is monitored in an interface monitoring mode. Mode 2, a mirror module of a nginnx (a high-performance web server of HTTP and reverse proxy) is used to copy real-time traffic in software, obtain interface request information included in the real-time traffic, and test an interface of the software.
However, in the mode 1, the test cases used for testing need to be written and maintained by specially-assigned persons, the labor cost is high, and the test cases need to be written manually, so that unreasonable test cases may occur, the interface test effect is affected, and the software test efficiency is low. And the interface monitoring mode generally monitors the success rate of a single interface and cannot ensure the smoothness of the whole access chain everywhere. In the method 2, a special person is required to configure the Nginx, the difficulty in configuring the Nginx is high, and high labor cost is also required, and the mirror module of the Nginx realizes that the flow replication can affect the real-time flow in the software, namely the normal use of the software, and the problem in the software cannot be solved by making multiple requests on the same flow, and the online problem cannot be replicated by flow playback.
In order to solve the above problems, the present invention provides a software testing method, apparatus, electronic device and storage medium. First, the software testing method provided by the present invention is explained in an exemplary manner.
As shown in fig. 1, fig. 1 is a flowchart of a software testing method provided in the embodiment of the present invention, which may specifically include the following steps:
step S110, acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
step S120, based on the target operation chain, calling each target interface according to the calling sequence;
and step S130, acquiring a software test result obtained based on a returned result after each target interface is called.
According to the software testing method provided by the embodiment of the invention, a target operation chain is obtained; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces; calling each target interface according to the calling sequence based on the target operation chain; and acquiring a software test result obtained based on a returned result after each target interface is called. By applying the embodiment of the invention, the operation chain is obtained in advance based on the calling behavior of each interface generated by operating the terminal equipment in the process of using the software by the user, and then the interface is called based on the operation chain to test the function of each interface.
In addition, by applying the embodiment of the invention, the labor cost is reduced because a large number of test cases do not need to be compiled manually. Secondly, each interface is called according to the target operation chain for testing, and the smoothness of the whole calling chain of the service can be ensured. Furthermore, by applying the embodiment of the invention, nginx does not need to be configured, the labor cost of software testing is reduced, the operation chain is obtained in advance based on the calling behavior of each interface generated by the user operating the terminal device, namely the operation chain is obtained in an asynchronous acquisition mode, the ongoing online service is not influenced, the problem in the software can be checked by making multiple requests on the same operation chain, and the online problem can be reproduced by repeatedly using the same operation chain.
The following is an exemplary description of the above steps S110 to S130:
the software testing method provided by the embodiment of the invention can be applied to any electronic equipment with a software testing function. The electronic device may be a server, a computer, or the like. The software testing method provided by the embodiment of the invention can be applied to testing environments such as a gray scale test environment or a pre-release environment, and the like, and can be used for verifying codes to be on-line or reconstruction codes and the like, and the invention is not particularly limited to this.
In step S110, one or more target operation chains may be obtained at a time, and each target operation chain includes a target interface and a call sequence of each target interface. Different target operation chains can contain different target interfaces or the same target interface, but the calling sequence of each target interface is different.
For example, the target operation chain 1 includes interfaces ase:Sub>A, B, and C, the calling order of the three interfaces is ase:Sub>A-B-C, the target operation chain 2 also includes interfaces ase:Sub>A, B, and C, and the calling order of the three interfaces is B-ase:Sub>A-C, and the target operation chain 1 and the target operation chain 2 are different operation chains because the calling orders of the interfaces are different.
The target operation chain can be obtained based on the operation behaviors generated by the tester in the software using process. In another possible implementation, the target operation chain may be obtained from a preset operation log library. The operation log library is established in advance based on the calling behaviors of each interface in the process of running software by the terminal equipment. That is, the operation log library is obtained based on operation behaviors generated during the use of software by a user.
The operation log library comprises a plurality of operation chains, and each operation chain comprises an interface called in the operation chain and a sequence for calling each interface in the operation chain. The operation chains may further include interface information of each interface. The interface information may include an address of the interface, that is, a Uniform Resource Identifier (URI) address of the interface. The URI address may uniquely identify the interface.
The interface information may further include an operation chain identifier traceid of each interface. The operation chain identifier may be preset for each interface, and marks an operation flow in which the interface participates. Taking video APP as an example, a user logs in, opens a camera, shoots a video and uploads the video to form a complete video uploading process, and then the same traceid can be set for each interface called in the operation process. In practical applications, different operation flows may call the same interface, and each flow in the video APP may involve a user login operation, that is, different operation flows in the APP call the user login interface. Therefore, multiple operation chains traceids may be set for the same interface to identify the respective operation flows in which the interface participates.
The interface information may further include software version information appversion corresponding to the interface. In practical application, after software is updated each time, the version number of the software is updated at the same time. The software version information in the interface information may identify a software version corresponding to the interface.
As a specific embodiment, as shown in fig. 2, the operation log library may be set for each user using software, and may be pre-established by the following steps:
step S210, determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
step S220, aiming at each user, arranging the interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain the operation chain corresponding to each operation chain identifier;
step S230, storing the operation chain for each user.
The above steps S210 to S230 are exemplarily explained as follows:
in step S210, the preset time period may be preset, for example, the operation behavior of each user may be set to be collected at regular time, so as to update the operation chain of each user in the operation log library. For example, the operation behavior of the user in the previous day may be collected at 00. The operation behavior of the user may be collected every 10 minutes or 20 minutes. The present invention is not particularly limited in this regard.
The operation behavior of each user includes request parameters of the user equipment, such as an interface address requested by the user equipment, an order of requesting the interface address, a type of a client initiating the request, a type of data, and the like. Therefore, after the operation behaviors of each user are obtained, the called interface, the interface information of the interface and the sequence for calling the interface can be obtained from the operation behaviors of the user.
In general, various operation behavior data of a user are stored in a user log, and a storage field of the data is preset for each type of data. For example, store the operation chain identification using traceid, store the user identification using userid, store the version number using appversion, store the interface address of the call with URL. Therefore, the embodiment of the present invention may obtain corresponding data, such as a user identifier, an operation chain identifier, an interface address, and the like, from the user log based on the preset storage field.
As described above, the interface information of each interface includes an operation chain identifier. Therefore, in step S220, for each user, each interface corresponding to the same operation chain identifier in each interface called by the user operation behavior may be determined, and then the interfaces are arranged according to the calling sequence, so as to obtain the operation chain corresponding to the corresponding operation chain identifier.
For example, if the interface for collecting the operation behavior call within ten minutes of the user a includes interfaces a, B, C, D, E and F. The operation chain identifiers of the interface A are t1, t2 and t3, the operation chain identifiers of the interface B and the interface C are both t1, and the operation chain identifiers of the interface D, the interface E and the interface F are both t2. Then, the operation chains obtained based on the operation behaviors of the user are A-B-C, A-D-E-F and A respectively.
After the operation chain identifier is obtained, for each user, the operation chain obtained based on the user operation behavior may be stored in correspondence with the user, for example, the user identifier userid may be stored in correspondence with the operation chain. A user operation log may be set for each user, and an operation chain obtained based on each user operation behavior may be stored in the user operation log of the user.
As described above, the operation chains are distinguished by operation chain identifiers, and therefore, in another possible implementation manner, the operation chain identifiers and the operation chains may be stored in correspondence with each user. For example, the user identifier userid, the operation chain identifier traceid, and the operation chain may be stored correspondingly to obtain the operation log library. The operation chain includes interfaces, interface information of each interface, and a sequence for calling each interface. Of course, the operation chain identifier traceid and the operation chain may also be stored in the user operation log of the corresponding user. The user operation logs of the users form an operation log library. And storing each operation chain obtained based on the user operation behavior and the corresponding operation chain identifier in each user operation log.
And updating the operation log library after the operation chain is obtained for each user. The updating of the operation log library may be updating of a user operation log, or updating of an operation chain corresponding to the user identifier. The following describes a method for updating the operation log library, taking the updating of the user operation log as an example:
as an embodiment, for each user, after the operation chain obtained in step S230 is added to the current operation behavior chain corresponding to the operation identifier according to the operation identifier, the operation chain corresponding to the operation chain identifier may be updated. Of course, the operation chain obtained in step S230 may be stored as a new operation chain for each user in association with the operation chain identifier. The present invention is not particularly limited in this regard.
For example, for ase:Sub>A user ase:Sub>A, the operation chain corresponding to the operation chain identifier t1 is obtained as ase:Sub>A-B-C, and the operation chain corresponding to the operation chain identifier t1 stored in the user operation log of the current user ase:Sub>A is D-B-ase:Sub>A-C-E, so that after the user operation log of the user ase:Sub>A is updated, the operation chain corresponding to the operation chain identifier t1 is obtained as D-B-ase:Sub>A-C-E-ase:Sub>A-B-C, or the ase:Sub>A-B-C can be stored as ase:Sub>A separate operation chain corresponding to the operation chain identifier t1 to update the user operation log of the user ase:Sub>A.
When the software needs to be tested, the target operation chain can be extracted from the operation log library to test each interface of the software. The operation log library may be used to extract a target operation chain from the operation log library. For example, if it is necessary to test an interface that can be used in each operation flow, for example, if it is necessary to test an interface called by a user to log in, display an APP open screen advertisement, and the like, a target operation chain may be randomly extracted from the operation log library, and the interfaces may be called according to a calling sequence in the target operation chain to test functions of the interfaces themselves and interactions between the interfaces and other interfaces. As described above, the operation log library correspondingly stores the user identifier userid, the operation chain identifier traceid, and the operation chain. When the operation chain is randomly extracted, the operation chain can be randomly extracted according to the userid and/or the traceid. The present invention is not particularly limited thereto.
For other scenarios, the target operation chain for testing can be extracted from the operation log library in other manners.
For example, if an interface for implementing a specific function needs to be tested, if an interface called by shooting a video by a video APP, an interface called by uploading the video, or the like needs to be tested, an operation chain may be extracted from the operation log library according to information of the interface to be tested, and the interface to be tested is tested.
Specifically, based on fig. 1, as shown in fig. 3, the step S110 may specifically include the following steps:
step S111, acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
step S112, acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces.
In step S111, the interface information of the interface to be tested may include an interface address, an operation chain identifier, a software version number, and the like.
As described above, the operation log library correspondingly stores the user identifier userid, the operation chain identifier traceid, and the operation chain, which includes the called interface, the interface information of each called interface, and the sequence of calling each interface. The interface information of each interface includes the version number appversion, address, and operation chain identifier traceid of the interface. Therefore, in step S112, the operation chain may be extracted from the operation log library according to the interface information of the target interface obtained in step S111, such as based on the interface address, the operation chain identifier, and the interface version number appversion of the target interface.
The number of the extracted target operation chains can be preset, such as 10000, 15000 and the like. All operation chains meeting the requirements can also be used as target operation chains, and the present invention is not particularly limited to this.
In a possible implementation manner, after the target operation chain is extracted, the target operation chain may be screened, for example, repeated operation chains may be filtered, so as to further improve software testing efficiency.
After the target operation chain is determined, the target interface can be called according to the target interface and the calling target interface sequence contained in the target operation chain. The target interface comprises the interface to be tested.
And then, based on the results returned by the target interfaces, the test result of the software can be obtained. Such as determining whether the software is abnormal or not, and determining specific abnormal information in case of the software being abnormal. The specific abnormal information may include: the type of failure, the interface that failed, and the cause of the failure, etc.
In the step S130, when the software test result is obtained based on the returned result after each target interface is called, the tester may monitor the returned result of the target interface.
Specifically, in an embodiment of the present invention, based on fig. 1, as shown in fig. 3, the step S130 may include:
s131, acquiring and displaying a returned result after each target interface is called;
and step S132, acquiring a software test result input aiming at the returned result after each target interface is called.
The electronic equipment displays the returned result after the target interface is called, and a tester can obtain the software test result based on the returned result after the target interface displayed by the electronic equipment is called. And inputting the obtained software test result into the electronic equipment for recording, distribution and the like.
In another possible implementation manner, the state of the interfaces can be monitored by using a monitoring system, and a software test result is obtained by using the monitoring system based on a result returned after each target interface is called, so that the software test efficiency is further improved, and the labor cost is saved.
The monitoring system may be an open source monitoring system such as the open source promemeus, kubertnets, fluent monitoring systems, and the like. As a specific implementation manner of the embodiment of the present invention, a prometheus monitoring system may be selected to perform real-time monitoring on the state of each interface, where the interface state includes a result returned after the interface is called.
In a possible implementation manner, an alarm system may be further connected to the prometheus monitoring system, so that when it is monitored that any target interface is abnormal in operation, an alarm system sends alarm information. The alarm system may be an open-source alarm system, such as a hub alarm system, or a self-developed alarm system, which is not specifically limited in the present invention.
In one possible embodiment, the alarm rule may be configured in the hub alarm system in advance. The alarm rule may include a correspondence between the type of the fault and the notified person. For example, the information of the person who needs to be notified when the 404 or 500 fault occurs, the information of the person who needs to be notified when the process is not passed (i.e., the interaction between the interfaces is abnormal) or the front and back versions are not consistent (i.e., the software versions corresponding to the target interfaces are different), and the like may be set, so as to notify the interface fault condition to the relevant person in time, thereby further improving the testing efficiency.
As shown in fig. 4, fig. 4 is a schematic diagram of a specific application flow of the software testing method provided in the embodiment of the present invention, which specifically includes the following steps:
(1) and acquiring user request parameters from user operation behaviors according to keywords such as a user identifier userid, an operation chain identifier traceid, a version number appversion and the like, storing the user request parameters into user operation logs, and forming an operation log library by the user operation logs.
The user request parameters comprise various operation chains obtained based on the interfaces called in the user operation behaviors, the interface information of the interfaces and the sequence of calling the interfaces. The step (1) is performed before the software test.
(2) And extracting an operation chain from the operation log library.
The step (2) may be performed periodically. After the operation chain is obtained, each interface can be called according to the operation chain.
(3) And recording the return results of the interfaces.
(4) And monitoring and observing the results returned by each interface, and sending alarm information when the results returned by the interfaces are abnormal.
By applying the embodiment of the invention, the user request parameters are asynchronously collected, the on-line service is not influenced, the interface function is verified by using real and effective user operation requests, the data is not required to be artificially compiled, the whole calling chain of the service is ensured to be smooth, the cost of testers is reduced, and the test case can be automatically executed at regular time to find the problem and give an early warning in time. The method provided by the embodiment of the invention can also be applied to the pre-release service for verification, and each index is observed, so that potential problems are found in advance, risks are avoided, and the usability of software is improved.
Based on the same technical concept, an embodiment of the present invention further provides a software testing apparatus, as shown in fig. 5, the apparatus may include:
an extraction module 510, configured to obtain a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
a calling module 520, configured to call each target interface according to the calling sequence based on the target operation chain;
a test result obtaining module 530, configured to obtain a software test result based on a result returned after each of the target interfaces is called.
The software testing device provided by the embodiment of the invention obtains a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces; calling each target interface according to the calling sequence based on the target operation chain; and acquiring a software test result obtained based on a returned result after each target interface is called. By applying the embodiment of the invention, the operation chain is obtained in advance based on the calling behavior of each interface generated by the operation terminal equipment in the process of using software by a user, and then the interface is called based on the operation chain to test the function of each interface.
In a possible implementation manner, an operation chain identifier is preset for each interface;
the obtaining of the target operation chain comprises: acquiring a target operation chain from a preset operation log library; the operation log library is pre-established according to the following steps:
determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
aiming at each user, arranging interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain an operation chain corresponding to each operation chain identifier;
and storing the operation chain for each user.
In one possible implementation, the storing the operation chain includes: storing the operation chain identification and the operation chain correspondingly;
the obtaining of the target operation chain comprises:
acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
and acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested.
In a possible implementation manner, the software test result is obtained by the monitoring system based on a result returned after each target interface is called.
In a possible implementation manner, the obtaining a software test result obtained based on a result returned after each target interface is called includes:
obtaining and displaying a returned result after each target interface is called;
and acquiring a software test result input aiming at a result returned after each target interface is called.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
based on the target operation chain, calling each target interface according to the calling sequence;
and acquiring a software test result obtained based on a result returned after each target interface is called.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the software testing method described in any of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the software testing method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the apparatus, electronic device, storage medium, and program product embodiments, as they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for testing software, the method comprising:
acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
calling each target interface according to the calling sequence based on the target operation chain;
and acquiring a software test result obtained based on a result returned after each target interface is called.
2. The method according to claim 1, characterized in that an operation chain identification is preset for each interface;
the obtaining of the target operation chain comprises: acquiring a target operation chain from a preset operation log library; the operation log library is pre-established according to the following steps:
determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
aiming at each user, arranging interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain an operation chain corresponding to each operation chain identifier;
and storing the operation chain for each user.
3. The method of claim 2,
the storing the chain of operations includes: storing the operation chain identification and the operation chain correspondingly;
the obtaining of the target operation chain comprises:
acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
and acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested.
4. The method of claim 1, wherein the software test results are obtained by the monitoring system based on results returned after each of the target interfaces is called.
5. The method of claim 1, wherein obtaining software test results based on results returned after each of the target interfaces is called comprises:
obtaining and displaying a returned result after each target interface is called;
and acquiring a software test result input aiming at a result returned after each target interface is called.
6. A software testing apparatus, characterized in that the apparatus comprises:
the extraction module is used for acquiring a target operation chain; the target operation chain is obtained in advance based on the calling behavior of each interface in the process of running software by the terminal equipment; the target operation chain comprises target interfaces and calling sequences of the target interfaces;
the calling module is used for calling each target interface according to the calling sequence based on the target operation chain;
and the test result acquisition module is used for acquiring a software test result obtained based on a result returned after each target interface is called.
7. The apparatus according to claim 6, wherein an operation chain identifier is preset for each interface;
the obtaining of the target operation chain comprises: acquiring a target operation chain from a preset operation log library; the operation log library is pre-established according to the following steps:
determining each interface called in the operation behavior of each user within a preset time period and the calling sequence of each interface for each user;
aiming at each user, arranging interfaces corresponding to the same operation chain identifier in each interface according to the calling sequence to obtain an operation chain corresponding to each operation chain identifier;
and storing the operation chain for each user.
8. The apparatus of claim 7,
the storing the operation chain comprises: storing the operation chain identification and the operation chain correspondingly;
the obtaining of the target operation chain comprises:
acquiring interface information of an interface to be tested; the interface information comprises an operation chain identifier preset for the interface to be tested;
and acquiring a target operation chain from the operation log library based on the interface information of the interface to be tested.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202211192496.8A 2022-09-28 2022-09-28 Software testing method and device, electronic equipment and storage medium Pending CN115509918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211192496.8A CN115509918A (en) 2022-09-28 2022-09-28 Software testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211192496.8A CN115509918A (en) 2022-09-28 2022-09-28 Software testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115509918A true CN115509918A (en) 2022-12-23

Family

ID=84505835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211192496.8A Pending CN115509918A (en) 2022-09-28 2022-09-28 Software testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115509918A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858395A (en) * 2023-01-28 2023-03-28 北京蓝色星际科技股份有限公司 Password function testing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858395A (en) * 2023-01-28 2023-03-28 北京蓝色星际科技股份有限公司 Password function testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107402880B (en) Test method and electronic equipment
CN112559361A (en) Flow playback method, device, equipment and computer readable medium
US20180081795A1 (en) Automated test generation for multi-interface enterprise virtualization management environment
US9378015B2 (en) Predicting defects in code
Syer et al. Continuous validation of performance test workloads
CN103946809A (en) Generating production server load activity for a test server
Syer et al. Continuous validation of load test suites
CN110007921B (en) Code publishing method and device
CN109324968B (en) System testing method and device
CN112100052A (en) Interface test scene playback method and device
CN111580855A (en) Strategy issuing method and system based on full-flow gray level issuing and electronic equipment
CN111611140A (en) Reporting verification method and device of buried point data, electronic equipment and storage medium
CN112650688A (en) Automated regression testing method, associated device and computer program product
CN115509918A (en) Software testing method and device, electronic equipment and storage medium
CN113014445A (en) Operation and maintenance method, device and platform for server and electronic equipment
CN112953904A (en) Abnormality detection method, abnormality detection device, server, and storage medium
CN116405412B (en) Method and system for verifying cluster effectiveness of simulation server based on chaotic engineering faults
CN116662197A (en) Automatic interface testing method, system, computer and readable storage medium
CN115904938A (en) Change risk prevention and control system, method, electronic device and storage medium
US10380339B1 (en) Reactively identifying software products exhibiting anomalous behavior
CN114385498A (en) Performance test method, system, computer equipment and readable storage medium
US20170068919A1 (en) Risk assessment in online collaborative environments
CN108536604B (en) Method and terminal for testing response time of WEB page
Khalid On the link between mobile app quality and user reviews
CN111611520B (en) Flow cheating monitoring method and device, electronic 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