CN112363932A - Method and device for testing business object to be tested and electronic device - Google Patents

Method and device for testing business object to be tested and electronic device Download PDF

Info

Publication number
CN112363932A
CN112363932A CN202011256942.8A CN202011256942A CN112363932A CN 112363932 A CN112363932 A CN 112363932A CN 202011256942 A CN202011256942 A CN 202011256942A CN 112363932 A CN112363932 A CN 112363932A
Authority
CN
China
Prior art keywords
service
tested
business object
script file
service request
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
CN202011256942.8A
Other languages
Chinese (zh)
Other versions
CN112363932B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011256942.8A priority Critical patent/CN112363932B/en
Publication of CN112363932A publication Critical patent/CN112363932A/en
Application granted granted Critical
Publication of CN112363932B publication Critical patent/CN112363932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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

Abstract

The invention discloses a method and a device for testing a business object to be tested and an electronic device. Wherein, the method comprises the following steps: acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing table locking operation on the data table associated with the to-be-tested business object; in the process of executing the table locking operation, repeatedly initiating a service request associated with the service object to be tested to a server; and stopping executing the lock table operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server. The invention solves the technical problems of lower test accuracy and higher test cost of the test service object in the related technology.

Description

Method and device for testing business object to be tested and electronic device
Technical Field
The invention relates to the field of data processing, in particular to a method and a device for testing a business object to be tested and an electronic device.
Background
In the related art, the accuracy and uniqueness of data are usually required to be verified in a software testing process, for example, a method of a system performance test and a database performance test is adopted to test a service object, but due to complexity of a service scenario, only a single function test or performance test (for example, a performance test is performed on a system pressure or a database pressure) is adopted, and it is difficult to effectively test the problem of data uniqueness caused by data concurrency, for example, a problem that repeated data is not processed in time due to database lock table caused by low performance of the database due to too many concurrent requests is caused. And moreover, the cost of using a performance testing tool to test in the related technology is high, the performance testing execution efficiency is not high, and the test process is difficult to reproduce.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for testing a business object to be tested and an electronic device, which are used for at least solving the technical problems of lower test accuracy and higher test cost of testing the business object in the related technology.
According to an aspect of the embodiments of the present invention, a method for testing a business object to be tested is provided, which includes: acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing table locking operation on the data table associated with the to-be-tested business object; in the process of executing the table locking operation, repeatedly initiating a service request associated with the service object to be tested to a server; and stopping executing the lock table operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server.
According to another aspect of the embodiments of the present invention, there is also provided a testing apparatus for a business object to be tested, including: the acquisition module is used for acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object; the table locking module is used for operating the database script file and executing table locking operation on the data table associated with the to-be-tested business object; the request module is used for repeatedly initiating the service request associated with the service object to be tested to the server in the process of executing the table locking operation; and the processing module is used for stopping executing the table locking operation and determining whether the service request passes the service test or not based on a service processing result corresponding to the service request returned by the server.
According to another aspect of the embodiments of the present invention, a nonvolatile storage medium is further provided, where the nonvolatile storage medium includes a stored program, and when the program runs, the apparatus where the nonvolatile storage medium is located is controlled to execute any one of the above test methods for the business object to be tested.
According to another aspect of the embodiments of the present invention, there is also provided a processor, where the processor is configured to execute a program stored in a memory, where the program executes any one of the above methods for testing a business object to be tested.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform any one of the above methods for testing a business object to be tested.
In the embodiment of the invention, a database script file corresponding to a to-be-tested business object is obtained, wherein the database script file is used for simulating the execution of table locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing table locking operation on the data table associated with the to-be-tested business object; in the process of executing the table locking operation, repeatedly initiating a service request associated with the service object to be tested to a server; and stopping executing the table locking operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server, so as to achieve the purpose of testing the service request associated with the service object, thereby achieving the technical effects of improving the test accuracy of the service object and reducing the test cost, and further solving the technical problems of lower test accuracy and higher test cost of the service object in the related art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flowchart of a method for testing a business object to be tested according to an embodiment of the present invention;
FIG. 2 is a flowchart of an alternative testing method for a business object to be tested according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a testing apparatus for a business object to be tested according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for testing business objects under test, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that herein.
The technical scheme of the method embodiment can be executed in a mobile terminal, a computer terminal or a similar arithmetic device. Taking the example of the Mobile terminal running on the Mobile terminal, the Mobile terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet device (MID for short), a PAD, and the like. The mobile terminal may include one or more processors (which may include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processing (DSP) chip, a Microprocessor (MCU), a programmable logic device (FPGA), a neural Network Processor (NPU), a Tensor Processor (TPU), an Artificial Intelligence (AI) type processor, etc.) and a memory for storing data. Optionally, the mobile terminal may further include a transmission device, an input/output device, and a display device for a communication function. It will be understood by those skilled in the art that the foregoing structural description is only illustrative and not restrictive of the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than described above, or have a different configuration than described above.
The memory may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the game screen processing method in the embodiment of the present invention, and the processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implements the game screen processing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner. The technical scheme of the embodiment of the method can be applied to various communication systems, such as: a Global System for Mobile communications (GSM) System, a Code Division Multiple Access (CDMA) System, a Wideband Code Division Multiple Access (WCDMA) System, a General Packet Radio Service (GPRS), a Long Term Evolution (Long Term Evolution, LTE) System, a Frequency Division Duplex (FDD) System, a Time Division Duplex (TDD), a Universal Mobile Telecommunications System (UMTS), a Worldwide Interoperability for Microwave Access (WiMAX) communication System, or a 5G System. Optionally, Device-to-Device (D2D for short) communication may be performed between multiple mobile terminals. Alternatively, the 5G system or the 5G network is also referred to as a New Radio (NR) system or an NR network.
The display device may be, for example, a touch screen type Liquid Crystal Display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a Graphical User Interface (GUI) with which a user can interact by touching finger contacts and/or gestures on a touch-sensitive surface, where the human-machine interaction function optionally includes the following interactions: executable instructions for creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, emailing, call interfacing, playing digital video, playing digital music, and/or web browsing, etc., for performing the above-described human-computer interaction functions, are configured/stored in one or more processor-executable computer program products or readable non-volatile storage media.
Fig. 1 is a flowchart of a method for testing a business object to be tested according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, a database script file corresponding to a to-be-tested business object is obtained, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object;
step S102, operating the database script file, and executing table locking operation on the data table associated with the business object to be tested;
step S104, repeatedly initiating a service request associated with the service object to be tested to a server in the process of executing the table locking operation;
step S106, stopping executing the table locking operation, and determining whether the service request passes the service test or not based on the service processing result corresponding to the service request returned by the server.
In the embodiment of the invention, a database script file corresponding to a to-be-tested business object is obtained, wherein the database script file is used for simulating the execution of table locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing table locking operation on the data table associated with the to-be-tested business object; in the process of executing the table locking operation, repeatedly initiating a service request associated with the service object to be tested to a server; and stopping executing the table locking operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server, so as to achieve the purpose of testing the service request associated with the service object, thereby achieving the technical effects of improving the test accuracy of the service object and reducing the test cost, and further solving the technical problems of lower test accuracy and higher test cost of the service object in the related art.
Optionally, the business object to be tested may be any type of software testing business object, such as an attendance process business, a card punching process business, a leave application process business, and the like.
It should be noted that, in the embodiment of the present application, the execution main body is a client, and the client tests whether a service request initiated to the server passes a service test, and in the embodiment of the present application, the client may write a database script file that delays occupying a database table, for example, a transaction sql script, in a manner of analyzing the data table associated with the service object to be tested.
In an optional embodiment, fig. 2 is a flowchart of a testing method for an optional business object to be tested according to an embodiment of the present invention, and as shown in fig. 2, the step S102 of obtaining the database script file corresponding to the business object to be tested includes:
step S202, analyzing the data table associated with the business object to be tested, and determining a main table associated with the business object to be tested from the data table;
step S204, configuring the database script file based on the business process data recorded in the main table.
Optionally, the main table is used to record the business process data of the business object to be tested.
As an optional embodiment, in the attendance application process, only 1 leave request can be initiated within the same time, that is, two leave requests cannot be requested within the same time, which is exemplified by an attendance application service as follows:
firstly, a client determines an attendance master table CUX _ Wf _ LeaveApply associated with an attendance application service from a data table by analyzing the data table associated with the attendance application service to be tested; since the service flow data of the attendance application service are all recorded in the attendance master table CUX _ Wf _ leavepapply, a database script file (e.g., sql script) for simulating a database lock table can be written based on the service flow data.
In an optional embodiment, configuring the database script file based on the business process data recorded in the main table includes:
step S302, configuring a lock table operation to be executed and a sleep duration corresponding to the lock table operation to be executed based on the business process data recorded in the main table, to obtain the database script file.
Wherein, the dormancy duration is used for repeatedly initiating the service request.
Still taking the above attendance application service as an example, the client writes a transaction to perform a table locking operation (update operation) on the attendance master table CUX _ Wf _ leavepapply based on the service flow data recorded in the attendance master table CUX _ Wf _ leavepapply, and a sleeping duration (for example, sleeping for 1 minute so as to have enough time to send a repeat request) corresponding to the table locking operation to be executed, so as to obtain a database script file which can be but is not limited to the following:
Begin Tran
Update CUX_Wf_LeaveApply Set ApplyReason=ApplyReason+”;
WaitFor Delay'00:01:00';
Rollback Tran;
as an optional embodiment, the client runs the database script file, that is, the table locking operation can be performed on the attendance master table CUX _ Wf _ leavepapply, it should be noted that the table locking operation can be caused by performing the update operation on the database table, and the method belongs to a table locking mechanism of the database table.
In an optional embodiment, the method further includes:
step S402, configuring the time information and the content information included in the service request based on the service flow data recorded in the main table.
Optionally, the time information may be a leave request duration, and the content information may be leave request content.
As an optional embodiment, in the process of executing the lock table operation, the client repeatedly initiates a service request (WEB request) associated with the service object to be tested to the server.
For example, still taking the above attendance application service as an example, the client repeatedly submits attendance application requests with leave-on duration of 2020-07-0109: 00 to 10:00 to the server with the same attendance account. And after the service request is repeatedly initiated, the client stops executing the lock table operation, and determines whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server.
In an alternative embodiment, the stopping of the execution of the lock table operation includes:
step S502, after the sleep duration elapses, data rollback is performed to resume executing the service object to be tested.
Optionally, the client stops executing the table locking operation, that is, performs data Rollback after experiencing the sleep duration, for example, the client performs data Rollback by running a "Rollback Tran" in the database script file, still taking the attendance application service as an example.
In the embodiment of the application, the execution of the table locking operation is stopped, namely, the service is continuously operated, the execution of the service object to be tested is resumed, and a real service scene is simulated.
In an optional embodiment, determining whether the service request passes a service test based on the service processing result returned by the server includes:
step S602, when the service processing result meets the service requirement of the service object to be tested, determining that the service request passes the service test;
step S604, when the service processing result does not meet the service requirement of the service object to be tested, determining that the service request fails the service test.
In the above optional embodiment, the client detects whether the sent service request passes a service test, that is, detects whether the service processing result returned by the server meets the service requirement of the service object to be tested.
In an optional embodiment, still taking the attendance application service as an example, if one leave-asking request of two leave-asking requests with the same leave-asking time sent by the client is not successfully submitted, that is, only one attendance application flow is created for the two leave-asking requests with the same leave-asking time sent by the same attendance account, it is determined that the service processing result meets the service requirement of the service object to be tested, and it is determined that the service request fails the service test.
In another optional embodiment, still taking the above attendance application service as an example, if the client submits successfully both two leave-on requests with the same leave-on time sent by the same attendance account, that is, two leave-on requests with the same leave-on time sent by the same attendance account create two attendance application flows, it is determined that the service processing result does not meet the service requirement of the service object to be tested, and it is determined that the service request does not pass the service test.
By the aid of the test scheme of the business object to be tested, potential problems of unstable other related functions caused by performance test can be avoided, test cost is reduced by reducing test time, and data uniqueness can be tested in a data concurrency scene.
According to an embodiment of the present invention, an embodiment of an apparatus for implementing the testing method of the business object to be tested is further provided, fig. 3 is a schematic structural diagram of a testing apparatus of a business object to be tested according to an embodiment of the present invention, as shown in fig. 3, the testing apparatus of a business object to be tested includes: an obtaining module 30, a lock table module 32, a requesting module 34, and a processing module 36, wherein:
an obtaining module 30, configured to obtain a database script file corresponding to a to-be-tested service object, where the database script file is used to simulate performing a table locking operation on a data table associated with the to-be-tested service object; a table locking module 32, configured to run the database script file, and perform a table locking operation on the data table associated with the service object to be tested; a request module 34, configured to repeatedly initiate a service request associated with the service object to be tested to a server in a process of executing a table locking operation; a processing module 36, configured to stop executing the table locking operation, and determine whether the service request passes a service test based on a service processing result corresponding to the service request returned by the server
It should be noted that the above modules may be implemented by software or hardware, for example, for the latter, the following may be implemented: the modules can be located in the same processor; alternatively, the modules may be located in different processors in any combination.
It should be noted that the obtaining module 30, the lock table module 32, the request module 34 and the processing module 36 correspond to steps S102 to S108 in the method embodiment, and the modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure of the method embodiment. It should be noted that the modules described above may be implemented in a computer terminal as part of an apparatus.
It should be noted that, for alternative or preferred embodiments of the present embodiment, reference may be made to the related description in the method embodiment, and details are not described herein again.
The testing apparatus for the business object to be tested may further include a processor and a memory, where the obtaining module 30, the lock table module 32, the request module 34, the processing module 36, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory, wherein one or more than one kernel can be arranged. The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to the embodiment of the application, the embodiment of the nonvolatile storage medium is also provided. Optionally, in this embodiment, the nonvolatile storage medium includes a stored program, and the device where the nonvolatile storage medium is located is controlled to execute the testing method of any one of the business objects to be tested when the program runs.
Optionally, in this embodiment, the nonvolatile storage medium may be located in any one of a group of computer terminals in a computer network, or in any one of a group of mobile terminals, and the nonvolatile storage medium includes a stored program.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing table locking operation on the data table associated with the to-be-tested business object; in the process of executing the table locking operation, repeatedly initiating a service request associated with the service object to be tested to a server; and stopping executing the lock table operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: analyzing a data table associated with the business object to be tested, and determining a main table associated with the business object to be tested from the data table, wherein the main table is used for recording business process data of the business object to be tested; and configuring the database script file based on the business process data recorded in the main table.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: and configuring a to-be-executed lock table operation and a dormancy duration corresponding to the to-be-executed lock table operation based on the business process data recorded in the main table to obtain the database script file, wherein the dormancy duration is used for repeatedly initiating the business request.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: and configuring time information and content information contained in the service request based on the service flow data recorded in the main table.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: and after the dormancy duration, performing data rollback to resume executing the business object to be tested.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: when the service processing result meets the service requirement of the service object to be tested, determining that the service request passes a service test; and when the service processing result does not meet the service requirement of the service object to be tested, determining that the service request does not pass the service test.
According to the embodiment of the application, the embodiment of the processor is also provided. Optionally, in this embodiment, the processor is configured to execute a program, where the program executes the testing method of any one of the business objects to be tested when running.
According to an embodiment of the present application, an embodiment of an electronic apparatus is further provided, which includes a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the above testing methods for a business object to be tested.
According to an embodiment of the present application, there is further provided a computer program product embodiment, which is adapted to execute a program initializing a testing method step of any one of the above-mentioned business objects to be tested when executed on a data processing device.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable nonvolatile storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a non-volatile storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the above methods according to the embodiments of the present invention. And the aforementioned nonvolatile storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for testing a business object to be tested is characterized by comprising the following steps:
acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object;
running the database script file, and executing table locking operation on the data table associated with the service object to be tested;
repeatedly initiating a service request associated with the service object to be tested to a server in the process of executing the table locking operation;
and stopping executing the lock table operation, and determining whether the service request passes a service test or not based on a service processing result corresponding to the service request returned by the server.
2. The method of claim 1, wherein obtaining the database script file corresponding to the business object to be tested comprises:
analyzing a data table associated with the business object to be tested, and determining a main table associated with the business object to be tested from the data table, wherein the main table is used for recording business process data of the business object to be tested;
and configuring the database script file based on the business process data recorded in the main table.
3. The method of claim 2, wherein configuring the database script file based on the business process data recorded in the master table comprises:
and configuring to-be-executed lock table operation and dormancy duration corresponding to the to-be-executed lock table operation based on the service flow data recorded in the main table to obtain the database script file, wherein the dormancy duration is used for repeatedly initiating the service request.
4. The method of claim 2, further comprising:
and configuring time information and content information contained in the service request based on the service flow data recorded in the main table.
5. The method of claim 3, wherein ceasing to perform lock table operations comprises:
and after the dormancy duration, performing data rollback to resume executing the business object to be tested.
6. The method of claim 1, wherein determining whether the service request passes a service test based on the service processing result returned by the server comprises:
when the service processing result meets the service requirement of the service object to be tested, determining that the service request passes a service test;
and when the service processing result does not accord with the service requirement of the service object to be tested, determining that the service request does not pass the service test.
7. A test apparatus for a business object to be tested, comprising:
the acquisition module is used for acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating to execute table locking operation on a data table associated with the to-be-tested business object;
the table locking module is used for operating the database script file and executing table locking operation on the data table associated with the service object to be tested;
the request module is used for repeatedly initiating a service request associated with the service object to be tested to a server in the process of executing the table locking operation;
and the processing module is used for stopping executing the lock table operation and determining whether the service request passes the service test or not based on a service processing result corresponding to the service request returned by the server.
8. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein when the program runs, a device where the non-volatile storage medium is located is controlled to execute the test method of the business object to be tested according to any one of claims 1 to 6.
9. A processor, characterized in that the processor is configured to run a program stored in a memory, wherein the program is configured to execute the method for testing the business object to be tested according to any one of claims 1 to 6 when running.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the method of testing the business object to be tested according to any one of claims 1 to 6.
CN202011256942.8A 2020-11-11 2020-11-11 Test method and device for business object to be tested and electronic device Active CN112363932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011256942.8A CN112363932B (en) 2020-11-11 2020-11-11 Test method and device for business object to be tested and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011256942.8A CN112363932B (en) 2020-11-11 2020-11-11 Test method and device for business object to be tested and electronic device

Publications (2)

Publication Number Publication Date
CN112363932A true CN112363932A (en) 2021-02-12
CN112363932B CN112363932B (en) 2024-03-22

Family

ID=74515313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011256942.8A Active CN112363932B (en) 2020-11-11 2020-11-11 Test method and device for business object to be tested and electronic device

Country Status (1)

Country Link
CN (1) CN112363932B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051176A (en) * 2021-04-20 2021-06-29 中国工商银行股份有限公司 Method and device for processing automatic test data, electronic equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010058225A (en) * 1999-12-27 2001-07-05 오길록 Replicated Data Processing Scheme for Transaction Processing in Main Memory Database Management Systems
US20030212986A1 (en) * 2002-05-10 2003-11-13 Nelin Constance J. Testing environment for database server side logic
CN102156928A (en) * 2011-04-29 2011-08-17 浪潮通信信息系统有限公司 Method for system concurrency control through business logic lock
US20120016913A1 (en) * 2010-07-14 2012-01-19 Salesforce.Com, Inc. Using xml to run tests in a multi-tenant database environment
US20130042146A1 (en) * 2011-07-01 2013-02-14 Salesforce.Com, Inc. Testing data silo
US20140068568A1 (en) * 2012-09-04 2014-03-06 Salesforce.Com, Inc. System and method for dynamically debugging data in a multi-tenant database environment
CN104185210A (en) * 2014-07-25 2014-12-03 西北大学 Dormancy scheduling based congestion control method of data source
US20140359581A1 (en) * 2013-05-29 2014-12-04 Sap Ag Database code testing framework
CN105183641A (en) * 2015-08-13 2015-12-23 浪潮(北京)电子信息产业有限公司 Data consistency check method and system for kernel module
CN105760286A (en) * 2016-02-17 2016-07-13 中国工商银行股份有限公司 Application database dynamic property detection method and detection device
CN106021107A (en) * 2016-05-19 2016-10-12 浪潮电子信息产业股份有限公司 Modularized test case distribution method
CN108319711A (en) * 2018-02-07 2018-07-24 腾讯科技(深圳)有限公司 Transaction consistency test method, device, storage medium and the equipment of database
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium
EP3702936A1 (en) * 2019-03-01 2020-09-02 Accenture Global Solutions Limited Message recovery system for computing nodes with replicated databases

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010058225A (en) * 1999-12-27 2001-07-05 오길록 Replicated Data Processing Scheme for Transaction Processing in Main Memory Database Management Systems
US20030212986A1 (en) * 2002-05-10 2003-11-13 Nelin Constance J. Testing environment for database server side logic
US20120016913A1 (en) * 2010-07-14 2012-01-19 Salesforce.Com, Inc. Using xml to run tests in a multi-tenant database environment
CN102156928A (en) * 2011-04-29 2011-08-17 浪潮通信信息系统有限公司 Method for system concurrency control through business logic lock
US20130042146A1 (en) * 2011-07-01 2013-02-14 Salesforce.Com, Inc. Testing data silo
US20140068568A1 (en) * 2012-09-04 2014-03-06 Salesforce.Com, Inc. System and method for dynamically debugging data in a multi-tenant database environment
US20140359581A1 (en) * 2013-05-29 2014-12-04 Sap Ag Database code testing framework
CN104185210A (en) * 2014-07-25 2014-12-03 西北大学 Dormancy scheduling based congestion control method of data source
CN105183641A (en) * 2015-08-13 2015-12-23 浪潮(北京)电子信息产业有限公司 Data consistency check method and system for kernel module
CN105760286A (en) * 2016-02-17 2016-07-13 中国工商银行股份有限公司 Application database dynamic property detection method and detection device
CN106021107A (en) * 2016-05-19 2016-10-12 浪潮电子信息产业股份有限公司 Modularized test case distribution method
CN108319711A (en) * 2018-02-07 2018-07-24 腾讯科技(深圳)有限公司 Transaction consistency test method, device, storage medium and the equipment of database
EP3702936A1 (en) * 2019-03-01 2020-09-02 Accenture Global Solutions Limited Message recovery system for computing nodes with replicated databases
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEIXIN_34417183: "SQLserver锁和事务隔离级别的比较与使用", pages 1 - 5, Retrieved from the Internet <URL:《https://blog.csdn.net/weixin_34417183/article/details/86096655》> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051176A (en) * 2021-04-20 2021-06-29 中国工商银行股份有限公司 Method and device for processing automatic test data, electronic equipment and storage medium
CN113051176B (en) * 2021-04-20 2024-03-26 中国工商银行股份有限公司 Automatic test data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112363932B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
US20180107725A1 (en) Data Storage Method and Apparatus, and Data Read Method and Apparatus
US20120072498A1 (en) Method and apparatus for pre-rendering expected system response
US11030079B2 (en) Service virtualization platform
WO2020062980A1 (en) File access tracking method, device, storage medium and terminal
CN106951521B (en) Method, device and system for reading and writing log file
CN106534281A (en) Data request responding method, apparatus and system
CN107066188A (en) A kind of method and terminal for sending screenshot picture
CN103309728A (en) Asynchronous request processing method and equipment
CN107894945A (en) Bury an adding method, mobile terminal and computer-readable recording medium
CN104253842A (en) Method and device for synchronizing terminal mirrors, terminal and server
CN113946403A (en) Data display method and device, storage medium and electronic equipment
CN111625313A (en) Resource processing progress display method and device, electronic equipment and storage medium
CN112363932B (en) Test method and device for business object to be tested and electronic device
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN105574026A (en) Method and device for service supporting by using non-relational database
CN111666199A (en) Debugging method executed on intelligent terminal and software debugger
US20180341426A1 (en) Method and device for clearing data and electronic device
CN107766549A (en) Text delet method and device, terminal installation and readable storage medium storing program for executing
CN112711955A (en) NFC information transmission method, NFC information transmission device and NFC terminal
CN113391749A (en) Mouse click simulation method and device, computer readable storage medium and electronic equipment
CN110209557A (en) User&#39;s operation records restoring method, device, equipment and readable storage medium storing program for executing
CN107168648B (en) File storage method and device and terminal
CN109246077A (en) Distributed concurrent transaction method of calibration, device and computer storage medium
CN113326186A (en) Software testing method and device, electronic equipment and storage medium
CN113326302A (en) Data query method and device 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
GR01 Patent grant
GR01 Patent grant