[go: up one dir, main page]

CN113127335A - System testing method and device - Google Patents

System testing method and device Download PDF

Info

Publication number
CN113127335A
CN113127335A CN202010047456.9A CN202010047456A CN113127335A CN 113127335 A CN113127335 A CN 113127335A CN 202010047456 A CN202010047456 A CN 202010047456A CN 113127335 A CN113127335 A CN 113127335A
Authority
CN
China
Prior art keywords
test
data
tested
request
service table
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.)
Granted
Application number
CN202010047456.9A
Other languages
Chinese (zh)
Other versions
CN113127335B (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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202010047456.9A priority Critical patent/CN113127335B/en
Publication of CN113127335A publication Critical patent/CN113127335A/en
Application granted granted Critical
Publication of CN113127335B publication Critical patent/CN113127335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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 method and a device for system testing, and relates to the technical field of computers. One embodiment of the method comprises: receiving a test request sent by a tested system, wherein the test request is generated when the tested system generates data change and comprises a service table identifier generating the data change; acquiring a test case corresponding to the service table according to the service table identifier; and acquiring test data through the test case, and executing a test on the tested system by using the test data. The method and the system can execute scheduling of the test cases of different test scenes in the same system, so that the fact that the tested system is an internal node under the same organization mechanism or a node under a cross organization mechanism does not need to be concerned, and the problem of system automatic test under the cross organization mechanism is solved.

Description

System testing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for system testing.
Background
The traditional automatic operation mode adopts active trigger operation, for example, continuous integration trigger such as jenkins and the like, manual trigger of an automatic test tool and the like are adopted, the automatic operation is used as a flow node in a continuous integration task, and after the last flow node is completed (for example, the last flow node is a deployment test environment), the flow node of the automatic test is scheduled through the continuous integration task to achieve the purpose of starting the automatic test.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the traditional manner of executing the active trigger test is suitable for the automated test operation in the same person, the same team and the same organization, because the tested item, the automated test script and the caller are all controllable or predictable in the same person, the same team and the same organization. However, for those scenarios (such as joint testing scenarios) with uncontrollable or unpredictable time, the triggering of the automated testing operation is triggered by some system or systems upstream, for example, the generation of a logistics order may be triggered by systems of a plurality of different third party (e.g., vendor) websites, rather than being directly generated by the logistics system to which the logistics order belongs, the data required by orders generated by different third party systems are often different, and the time and data of the automated operation are not within a relatively controllable range, in which case the conventional manner of actively triggering the automated testing cannot meet the requirement.
That is to say, the conventional active trigger test execution mode is suitable for the situation that the test environment maintenance of the automated test case executor and the tested system of the automated test case is one person, or the situation of one continuous integration task, and this situation is mostly suitable for the internal test under the same organization, but is not suitable for the situations of collaborative joint debugging or dependent test, process upstream and downstream test, etc. under the situation of crossing organizations.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for system testing, which can execute scheduling of test cases in different test scenarios in the same system, so that it is not necessary to pay attention to whether a tested system is an internal node under the same organization or a node under a cross-organization, and the problem of system automated testing under the cross-organization is solved.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method of system testing is provided.
A method of system testing, comprising: receiving a test request sent by a tested system, wherein the test request is generated when the tested system has data change and comprises a service table identifier with the data change; acquiring a test case corresponding to the service table according to the service table identifier; and acquiring test data through the test case, and executing a test on the system to be tested by using the test data.
Optionally, the test request is generated by invoking a command parser of a database server when a database trigger of the system under test detects a data change.
Optionally, the obtaining of the test data through the test case includes: searching and triggering the data generating the test request from the service table through the test case; and searching a test result corresponding to the data from a pre-stored test data table according to the identifier of the data, and taking the data and the corresponding test result as test data.
Optionally, after obtaining the test data through the test case, before performing a test on the system under test by using the test data, the method further includes: searching historical process data corresponding to the test data from a pre-stored test data table; judging whether the tested system is the tested system node appointed in the historical process data and the node value corresponding to the tested system node; if so, executing the test on the system to be tested by using the test data; otherwise, the test of the tested system is quitted.
Optionally, after performing the test on the system under test, the method further includes: and determining the next node of the test data flow according to the historical process data, and sending the test data after the test is executed to the next node to trigger the test of the next node.
Optionally, the method is deployed in a standalone application.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for system testing.
An apparatus for system testing, comprising: the device comprises a request receiving module, a data processing module and a data processing module, wherein the request receiving module is used for receiving a test request sent by a tested system, and the test request is generated when the tested system generates data change and comprises a service table identifier generating the data change; the case obtaining module is used for obtaining a test case corresponding to the service table according to the service table identifier; and the test execution module is used for acquiring test data through the test case and executing a test on the tested system by using the test data.
Optionally, the test request is generated by invoking a command parser of a database server when a database trigger of the system under test detects a data change.
Optionally, the test execution module is further configured to: searching and triggering the data generating the test request from the service table through the test case; and searching a test result corresponding to the data from a pre-stored test data table according to the identifier of the data, and taking the data and the corresponding test result as test data.
Optionally, the system further includes a node determining module, configured to: after test data are obtained through the test case and before the test data are used for testing the tested system, historical process data corresponding to the test data are searched from a pre-stored test data table; judging whether the tested system is the tested system node appointed in the historical process data and the node value corresponding to the tested system node; if so, executing the test on the system to be tested by using the test data; otherwise, the test of the tested system is quitted.
Optionally, the apparatus further comprises a data streaming module, configured to: after the tested system is tested, determining the next node of the test data flow according to the historical flow data, and sending the test data after the test is executed to the next node to trigger the test of the next node.
Optionally, the apparatus is deployed in a standalone application.
According to yet another aspect of an embodiment of the present invention, there is provided an electronic device for system test.
An electronic device for system testing, comprising: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the system testing method provided by the embodiment of the invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer readable medium, on which a computer program is stored, which when executed by a processor implements a method of system testing as provided by embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: receiving a test request sent by a tested system, wherein the test request is generated when the data of the tested system is changed; then, acquiring a test case corresponding to the service table according to the service table identifier included in the test request; and then, test data are obtained through the test cases, and the test data are used for testing the tested system, so that the tested system sends a request to call an automatic test method to execute the test after the test data of the tested system is prepared, and the test cases of different test scenes in the same system can be dispatched. According to the technical scheme of the invention, the test cases under different systems do not need to be written in the same project to carry out calling relation configuration among codes, so that the test decoupling and work decomposition of different systems are facilitated, and the automatic test driving among heterogeneous automatic test environments can be realized because the test cases can not be in the same project. The test cases under different systems can be deployed on different servers and triggered by http requests, so that the purpose of distributed parallel testing is achieved. The technical scheme of the invention adopts the http request mode for triggering, can realize the triggering of the automatic test among different networks through the gateway, and can be applied to the test situation among the organizational structures under different networks. In the invention, the trigger and the command resolver do not need to process the input participation return value, and only need to configure the table name and the request path, thereby realizing the automatic and dynamic functions of adding the trigger and the command resolver of the server-side database, and avoiding manual modification and configuration.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of system testing according to an embodiment of the present invention;
FIG. 2 is a schematic test flow diagram of one embodiment of the present invention;
FIG. 3 is a schematic diagram of the main blocks of an apparatus for system testing according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the technical problems in the prior art, the invention provides a method and a device for system testing, wherein a test request is generated to request for testing a tested system when the tested system monitors data change by a passive triggering automatic test execution mode, so that the automatic test is triggered passively, the tested system does not need to be concerned about whether the tested system is an internal node under the same organizational structure or a node under a cross organizational structure, and the problem of system automatic testing under the cross organizational structure is solved.
Fig. 1 is a schematic diagram of main steps of a system testing method according to an embodiment of the present invention. As shown in fig. 1, the method for testing a system according to the embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: receiving a test request sent by a tested system, wherein the test request is generated when the tested system generates data change and comprises a service table identifier generating the data change;
step S102: acquiring a test case corresponding to the service table according to the service table identifier;
step S103: and acquiring test data through the test case, and executing a test on the tested system by using the test data.
According to the technical scheme of the invention, when the data of the system to be tested is changed, a test request is generated and then sent to the system test device (namely, the automatic test script) of the invention, so that the system test device is triggered to execute the test on the system to be tested. Moreover, the test request does not need to contain test data, after receiving the test request sent by the tested system, the system test device acquires a test case corresponding to the service table according to the service table identifier with data change included in the test request, and then acquires the test data through the test case to execute the test on the tested system. The problem that the system to be tested is an internal node under the same organization mechanism or a node under a cross organization mechanism is not required to be concerned, and the problem of automatic testing of the system under the cross organization mechanism is solved.
According to one embodiment of the invention, the test request is generated by calling a command parser of the database server when a database trigger of the system under test detects a data change. The database server side of the tested system mainly comprises a database trigger and a command parser Shell of the server side, wherein in computer science, Shell is commonly called Shell (which is used for distinguishing from core), is software for providing an operation interface for a user, and is a command parser which receives a user command and then calls a corresponding application program.
When new data is written in a service table of a tested service system (called a tested system for short), a database trigger is triggered to execute, and a trigger script calls a server-side shell to initiate a test request. The database trigger can be triggered as long as data are written into the business table (one system triggers another system to generally perform data exchange by adding records in the database), and data are written by calling an interface of the system to be tested, data are artificially added through SQL statements, data are written through a message queue of the system to be tested and are captured by the database trigger, namely, the system to be tested enters a testable state.
In one embodiment of the invention, the pseudo code implemented by the flip-flop is, for example, as follows:
CREATE DEFINER ═ username @ 'authority' TRIGGER 'database name ″' service table name ″
AFTER INSERT ON ' database name ' service table name '
FOR EACH ROW
BEGIN
set done is sys _ exec ("/file path/database name _ service table name.sh");
END;
"service table name" indicates "CREATE DEFINER ═ username '@' authority 'TRIGGER' database name": creating a database trigger, and specifying a database user and user authority for triggering execution, and a database and a data table name which can be operated by the trigger;
"service table name" means "AFTER INSERT ON" database name ": appointing a trigger rule of the trigger as writing new data, and appointing a database and a data table name to be triggered by the trigger at the same time;
"FOR EACH ROW" means: appointing the trigger range of the trigger as each row of newly added data;
"BEGIN" means: the starting statement of the actual script of the trigger is used as a grammar rule and has no actual significance;
"set done ═ sys _ exec ("/file path/database name _ service table name.sh ")" indicates: calling a shell script file in a specified directory at a trigger;
"END" means: the end statement of the trigger actual script, as a grammar rule, has no practical significance.
Through the pseudo code, when new data is written in any row of a business table of the specified database by the trigger, the shell script file in the specified directory is triggered and called.
The server commands the parser shell to initiate an http request of the automated testing application without processing a return value of the http and without entering a reference.
The pseudo code of the server-side shell is as follows:
get http:// autotest.com/service name/service interface method
Wherein, the 'wget' is a free tool for automatically downloading files from the network, supports the downloading by three most common TCP/IP protocols of HTTP, HTTPS and FTP, and can use HTTP proxy; com is a network address domain name of an automatic test script, an IP address corresponding to the domain name is given by a DNS (domain name system) server, when the automatic test script is deployed, the corresponding relation between the domain name corresponding to the DNS server and the IP is modified by the deployment script, and the test server does not need to configure hosts files when calling the domain name, so that the dynamic calling of a test execution machine is realized; the "service name" and the "service interface method" are set by the writer of the automated test application according to the service name and the service interface method to which the system under test belongs.
According to the technical scheme of the invention, when the system test is carried out, on-line historical process data is collected in advance to be used as test data and expected results of the automatic test and is stored in the prediction data table. For different test scenes, the flow nodes are different, and the historical data has authenticity and validity and can be used as a regression test basis.
In the embodiment of the invention, the automation test script can be deployed in an independent application form, such as a web-side application or an application program APP. The invention relates to a method for executing an automated script, which is characterized in that the traditional automated script is executed when a test is started, and the execution is quitted after the test is finished, and the traditional automated script is executed in a deployment mode embedded in other systems or automated frameworks. The automated test is really triggered only when the outside initiates an http request.
After receiving a test request sent by a system under test, an automated test script application (i.e., the system test apparatus of the present invention) distributes the test request to different entry methods for execution according to different url (uniform resource locator) paths of the test request. The entry method corresponds to the service name and the service interface method in the http test request. The entry method queries newly added data records in the service table of the service system to which the trigger belongs, and different data records are further distributed to different test scenes and test cases by the entry method. Wherein different data records refer to different data attributes in the data records. For example: the data attribute identifier of the original data is, for example, 1, and the data attribute identifier of the data after one modification is, for example, 2, then the entry method may determine, according to the data attribute identifier of the acquired data, to which test scenario and test case the data is further distributed.
According to the embodiment of the invention, when the test data is obtained through the test case, the method specifically comprises the following steps: searching data triggering and generating a test request from a service table through a test case; and searching a test result corresponding to the data from a pre-stored test data table according to the identifier of the data, and taking the data and the corresponding test result as test data. In the process of using the test data to execute the test on the tested system, the data in the test data is used as the input of the tested system, then the output of the tested system is obtained, the output is compared and judged with the test result in the test data, if the output is the same as the test result in the test data, the test is passed, otherwise, the test is failed.
After the test data is obtained through the test case and before the test data is used for executing the test on the system under test, the following operations can be executed:
searching historical process data corresponding to the test data from a pre-stored test data table;
judging whether the tested system is the tested system node appointed in the historical process data and the node value corresponding to the tested system node;
if so, executing the test on the tested system by using the test data;
otherwise, the test of the tested system is quitted.
When the test case executes the test, whether the current tested system is the tested system node and the corresponding node value thereof appointed in the historical process data or not is judged, if not, the problem possibly exists, and the test of the tested system by using the current test data is quitted; otherwise, the test case is used for testing the tested system. In addition, after the test of the tested system is finished, the next node of the test data flow is determined according to the historical flow data, and the test data after the test is executed is sent to the next node to trigger the test of the next node. When the test data after the test is executed is sent to the next node of the test flow, the test data after the test is executed is sent to the next service system. The data flow between the service systems may be implemented by data interaction between common service data, such as sending a request or interface call, which is not limited in the present invention. When the next service system receives the test data after the test execution sent by the system to be tested, the database trigger of the next service system generates a test request according to the data change and calls an automatic test script application (namely, the system test device of the invention) to perform the automatic test of the next service system, thus realizing the joint debugging of different service systems under the same organization without manual intervention.
Taking an OA (Office Automation) approval as an example, the historical process data for performing the test is a three-day leave-asking process, which has three nodes: employee application → second-level department leadership approval → first-level department leadership approval. Assuming that the current process node during the test is the second process node, before the test, judging whether the current process node is the account of the second-level department to which the employee belongs, if not, indicating that the data flow is in a problem, ending the test, and reporting an error to exit; if the current node meets the requirements of the historical process data, the current node tries to execute a secondary department examination and approval process, if the examination and approval can be successful, the current node passes the test, and the next node is continuously tested.
The technical scheme of the invention is suitable for automatic test application in a test environment, the data volume and the write-in quantity of the database in the test environment are usually small, and the server cannot generate large performance pressure, so that the method is suitable for being executed in a trigger mode; meanwhile, a tester or a test environment deployment tool under the test environment can have a larger authority, a trigger code can be established, and a shell script is called in the trigger.
The test cases under different systems do not need to be written in the same project for calling relationship configuration among codes, test decoupling and work decomposition of different systems are facilitated, and automatic test driving among heterogeneous automatic test environments can be realized due to the fact that the test cases can not be in the same project, for example, a User Interface (UI) frame of a web end and a UI frame of a mobile phone end.
The test cases under different systems can be deployed on different servers and triggered by http requests, so that the purpose of distributed parallel testing is achieved.
Because the invention adopts the http request mode to trigger the test flow, the automatic test triggering can be realized among different networks through the gateway, and the invention can be applied to the test situation among the organizational structures under different networks.
In the scheme, the trigger and the command parser shell do not need to process the input participation return value, and only a table name and a path of a url request need to be configured, so that the automatic function of dynamically adding the trigger and the shell of the server-side database can be realized, and manual modification and configuration are avoided.
FIG. 2 is a schematic diagram of a test flow according to an embodiment of the present invention. As shown in fig. 2, the entire flow of the automated test from triggering to execution is shown in accordance with one embodiment of the present invention. In this embodiment, there are 3 service tables, each service table corresponds to a service system, and when order data is written in a service table, and a trigger of a database monitors the data change operation, a command parser shell of a database server is called to initiate an http request, where the request includes identification information (service table name) of the service table. And then, processing the url and calling the test case corresponding to the service table. Using the test case to inquire the order data of the trigger request from the service table, and searching the test result corresponding to the order data from the pre-stored test data table according to the identification of the order data, then using the order data and the corresponding test result as the test data, and using the test data to execute the test of the tested system.
In the implementation flow of the embodiment, the http request is initiated by a shell at a database server side, and is received by an application deployed by an automated test case, and the parameter of the http request does not relate to test data. The application to which the automated test case belongs is usually a web-side program of a microservice architecture, which is always running, and therefore can handle the passive triggered execution of the automated test case with unpredictable running time. The Web end program is generally divided into a plurality of levels, wherein the first level is used for processing the received http request; the second level is used for acquiring a corresponding first test case according to the request, inquiring data to be tested in a business table where trigger data of the trigger are located through the first test case, and calling different second test cases (which can also be regarded as sub test cases or conditional branches of the first test case) according to different types of the data to be tested; and the second test case of the third level is used for acquiring historical data corresponding to the data to be tested and executing corresponding tests.
To take a specific example, for example: the trigger is written into an order table A of a database for new data of a common user order, the order number of the common user is 123456, the trigger of the order table A calls a shell to send an http request http:// test.
Fig. 3 is a schematic diagram of main blocks of an apparatus for system test according to an embodiment of the present invention. As shown in fig. 3, the apparatus 300 for system test according to the embodiment of the present invention mainly includes a request receiving module 301, a use case obtaining module 302, and a test executing module 303.
A request receiving module 301, configured to receive a test request sent by a system under test, where the test request is generated when data of the system under test is changed and includes a service table identifier where the data is changed;
a use case obtaining module 302, configured to obtain a test use case corresponding to the service table according to the service table identifier;
and the test execution module 303 is configured to obtain test data through the test case, and execute a test on the system under test by using the test data.
According to one embodiment of the invention, the test request is generated by calling a command parser of a database server when a database trigger of the system under test detects a data change.
According to another embodiment of the present invention, the test execution module 303 may be further configured to:
searching and triggering the data generating the test request from the service table through the test case;
and searching a test result corresponding to the data from a pre-stored test data table according to the identifier of the data, and taking the data and the corresponding test result as test data.
According to another embodiment of the present invention, the apparatus 300 for system testing may further include a node determining module (not shown in the figure) for: after test data is acquired through the test case and before the test data is used for executing the test on the tested system,
searching historical process data corresponding to the test data from a pre-stored test data table;
judging whether the tested system is the tested system node appointed in the historical process data and the node value corresponding to the tested system node;
if so, executing the test on the system to be tested by using the test data;
otherwise, the test of the tested system is quitted.
According to another embodiment of the present invention, the apparatus 300 for system testing may further include a data circulation module (not shown in the figure) for:
after the tested system is tested, determining the next node of the test data flow according to the historical flow data, and sending the test data after the test is executed to the next node to trigger the test of the next node.
According to yet another embodiment of the present invention, the apparatus 300 for system testing is deployed in a stand-alone application.
According to the technical scheme of the embodiment of the invention, the test request sent by the tested system is received, and the test request is generated when the data of the tested system is changed; then, acquiring a test case corresponding to the service table according to the service table identifier included in the test request; and then, test data are obtained through the test cases, and the test data are used for testing the tested system, so that the tested system sends a request to call an automatic test method to execute the test after the test data of the tested system is prepared, and the test cases of different test scenes in the same system can be dispatched. According to the technical scheme of the invention, the test cases under different systems do not need to be written in the same project to carry out calling relation configuration among codes, so that the test decoupling and work decomposition of different systems are facilitated, and the automatic test driving among heterogeneous automatic test environments can be realized because the test cases can not be in the same project. The test cases under different systems can be deployed on different servers and triggered by http requests, so that the purpose of distributed parallel testing is achieved. The technical scheme of the invention adopts the http request mode for triggering, can realize the triggering of the automatic test among different networks through the gateway, and can be applied to the test situation among the organizational structures under different networks. In the invention, the trigger and the command resolver do not need to process the input participation return value, and only need to configure the table name and the request path, thereby realizing the automatic and dynamic functions of adding the trigger and the command resolver of the server-side database, and avoiding manual modification and configuration.
Fig. 4 shows an exemplary system architecture 400 of a system testing apparatus or a method of system testing to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for system testing provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the apparatus for system testing is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a request receiving module, a use case obtaining module, and a test execution module. The names of the units or modules do not form a limitation on the units or modules themselves in some cases, for example, the request receiving module may also be described as a "module for receiving a test request sent by a system under test".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a test request sent by a tested system, wherein the test request is generated when the tested system has data change and comprises a service table identifier with the data change; acquiring a test case corresponding to the service table according to the service table identifier; and acquiring test data through the test case, and executing a test on the system to be tested by using the test data.
According to the technical scheme of the embodiment of the invention, the test request sent by the tested system is received, and the test request is generated when the data of the tested system is changed; then, acquiring a test case corresponding to the service table according to the service table identifier included in the test request; and then, test data are obtained through the test cases, and the test data are used for testing the tested system, so that the tested system sends a request to call an automatic test method to execute the test after the test data of the tested system is prepared, and the test cases of different test scenes in the same system can be dispatched. According to the technical scheme of the invention, the test cases under different systems do not need to be written in the same project to carry out calling relation configuration among codes, so that the test decoupling and work decomposition of different systems are facilitated, and the automatic test driving among heterogeneous automatic test environments can be realized because the test cases can not be in the same project. The test cases under different systems can be deployed on different servers and triggered by http requests, so that the purpose of distributed parallel testing is achieved. The technical scheme of the invention adopts the http request mode for triggering, can realize the triggering of the automatic test among different networks through the gateway, and can be applied to the test situation among the organizational structures under different networks. In the invention, the trigger and the command resolver do not need to process the input participation return value, and only need to configure the table name and the request path, thereby realizing the automatic and dynamic functions of adding the trigger and the command resolver of the server-side database, and avoiding manual modification and configuration.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of system testing, comprising:
receiving a test request sent by a tested system, wherein the test request is generated when the tested system has data change and comprises a service table identifier with the data change;
acquiring a test case corresponding to the service table according to the service table identifier;
and acquiring test data through the test case, and executing a test on the system to be tested by using the test data.
2. The method of claim 1, wherein the test request is generated by invoking a command parser of a database server when a database trigger of the system under test detects a data change.
3. The method of claim 1, wherein obtaining test data via the test case comprises:
searching and triggering the data generating the test request from the service table through the test case;
and searching a test result corresponding to the data from a pre-stored test data table according to the identifier of the data, and taking the data and the corresponding test result as test data.
4. The method according to claim 1 or 3, wherein after obtaining the test data through the test case, before performing the test on the system under test using the test data, the method further comprises:
searching historical process data corresponding to the test data from a pre-stored test data table;
judging whether the tested system is the tested system node appointed in the historical process data and the node value corresponding to the tested system node;
if so, executing the test on the system to be tested by using the test data;
otherwise, the test of the tested system is quitted.
5. The method of claim 4, further comprising, after performing the test on the system under test:
and determining the next node of the test data flow according to the historical process data, and sending the test data after the test is executed to the next node to trigger the test of the next node.
6. The method of claim 1, wherein the method is deployed in a standalone application.
7. An apparatus for system testing, comprising:
the device comprises a request receiving module, a data processing module and a data processing module, wherein the request receiving module is used for receiving a test request sent by a tested system, and the test request is generated when the tested system generates data change and comprises a service table identifier generating the data change;
the case obtaining module is used for obtaining a test case corresponding to the service table according to the service table identifier;
and the test execution module is used for acquiring test data through the test case and executing a test on the tested system by using the test data.
8. The apparatus of claim 7, wherein the test request is generated by invoking a command parser of a database server when a database trigger of the system under test detects a data change.
9. An electronic device for system testing, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202010047456.9A 2020-01-16 2020-01-16 System testing method and device Active CN113127335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010047456.9A CN113127335B (en) 2020-01-16 2020-01-16 System testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010047456.9A CN113127335B (en) 2020-01-16 2020-01-16 System testing method and device

Publications (2)

Publication Number Publication Date
CN113127335A true CN113127335A (en) 2021-07-16
CN113127335B CN113127335B (en) 2024-07-16

Family

ID=76771762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010047456.9A Active CN113127335B (en) 2020-01-16 2020-01-16 System testing method and device

Country Status (1)

Country Link
CN (1) CN113127335B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535567A (en) * 2021-07-21 2021-10-22 工银科技有限公司 Software testing methods, apparatus, equipment and media
CN113656307A (en) * 2021-08-18 2021-11-16 北京沃东天骏信息技术有限公司 System capacity evaluation method, device, equipment and medium
CN114185811A (en) * 2022-01-04 2022-03-15 北京字节跳动网络技术有限公司 Test method, device, storage medium and electronic equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214139A (en) * 2011-06-01 2011-10-12 北京航空航天大学 Automatic test performance control and debugging method facing distributed system
US20130179734A1 (en) * 2012-01-11 2013-07-11 Neopost Technologies Test Case Arrangment and Execution
US20140165043A1 (en) * 2012-07-30 2014-06-12 Infosys Limited System and method for functional test case generation of end-to-end business process models
WO2018000607A1 (en) * 2016-06-30 2018-01-04 乐视控股(北京)有限公司 Method and electronic apparatus for identifying test case failure causes
CN108694118A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 A kind of application testing method and device
CN109683905A (en) * 2018-12-24 2019-04-26 国云科技股份有限公司 A kind of system automatic publishing method
CN109710533A (en) * 2018-12-29 2019-05-03 亚信科技(中国)有限公司 An interface testing method, device and server
CN109726134A (en) * 2019-01-16 2019-05-07 中国平安财产保险股份有限公司 Interface test method and system
CN110290138A (en) * 2019-06-27 2019-09-27 苏宁消费金融有限公司 Limitation login method and system suitable for test database
CN110337642A (en) * 2017-02-28 2019-10-15 搜牌逻有限公司 Method and apparatus for performing testing by using test cases
CN110347590A (en) * 2019-06-18 2019-10-18 平安普惠企业管理有限公司 The interface testing control method and device of operation system
CN110399293A (en) * 2019-06-21 2019-11-01 平安科技(深圳)有限公司 System detection method, device, computer equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214139A (en) * 2011-06-01 2011-10-12 北京航空航天大学 Automatic test performance control and debugging method facing distributed system
US20130179734A1 (en) * 2012-01-11 2013-07-11 Neopost Technologies Test Case Arrangment and Execution
US20140165043A1 (en) * 2012-07-30 2014-06-12 Infosys Limited System and method for functional test case generation of end-to-end business process models
WO2018000607A1 (en) * 2016-06-30 2018-01-04 乐视控股(北京)有限公司 Method and electronic apparatus for identifying test case failure causes
CN110337642A (en) * 2017-02-28 2019-10-15 搜牌逻有限公司 Method and apparatus for performing testing by using test cases
CN108694118A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 A kind of application testing method and device
CN109683905A (en) * 2018-12-24 2019-04-26 国云科技股份有限公司 A kind of system automatic publishing method
CN109710533A (en) * 2018-12-29 2019-05-03 亚信科技(中国)有限公司 An interface testing method, device and server
CN109726134A (en) * 2019-01-16 2019-05-07 中国平安财产保险股份有限公司 Interface test method and system
CN110347590A (en) * 2019-06-18 2019-10-18 平安普惠企业管理有限公司 The interface testing control method and device of operation system
CN110399293A (en) * 2019-06-21 2019-11-01 平安科技(深圳)有限公司 System detection method, device, computer equipment and storage medium
CN110290138A (en) * 2019-06-27 2019-09-27 苏宁消费金融有限公司 Limitation login method and system suitable for test database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SEIYA U.等: "Proposal of Testing Diagrams for Visualizing Test Cases", 2013 IEEE SIXTH INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION, 29 July 2013 (2013-07-29) *
王游;冯曙明;何金陵;方泉;: "基于脚本的流程自适应自动化测试研究", 计算机与现代化, no. 02, 15 February 2015 (2015-02-15) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535567A (en) * 2021-07-21 2021-10-22 工银科技有限公司 Software testing methods, apparatus, equipment and media
CN113656307A (en) * 2021-08-18 2021-11-16 北京沃东天骏信息技术有限公司 System capacity evaluation method, device, equipment and medium
CN114185811A (en) * 2022-01-04 2022-03-15 北京字节跳动网络技术有限公司 Test method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113127335B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
CN110557284B (en) Data aggregation method and device based on client gateway
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN113127335B (en) System testing method and device
CN110795147A (en) Interface protocol file management method and device
CN113434384B (en) Pressure testing method and device
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN109218041B (en) Request processing method and device for server system
CN110806967B (en) Unit testing method and unit testing device
CN110083457A (en) A kind of data capture method, device and data analysing method, device
CN111382953A (en) Dynamic process generation method and device
CN113271334B (en) Service policy distribution method and device based on SaaS scene and electronic equipment
CN109522202B (en) Software testing method and device
CN113778499B (en) Method, apparatus, device and computer readable medium for publishing services
CN113779122A (en) Method and apparatus for exporting data
CN111061543A (en) Multi-tenant workflow engine service method, device and server
CN112181937A (en) Data transmission method and device
CN113505036B (en) Application monitoring method, client and server
CN113704080B (en) Automatic test method and device
CN113031960B (en) Code compiling method, device, server and storage medium
CN113064678B (en) A cache configuration method and device
CN113821430B (en) Multi-service testing method and device
CN110990280B (en) Automatic test data generation system and method
CN112306791B (en) Performance monitoring method and device
CN113220558B (en) Monitoring script generation method and device, and monitoring method and device
CN113495747B (en) Gray scale release method and device

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
GR01 Patent grant
GR01 Patent grant