CN112363932B - Test method and device for business object to be tested and electronic device - Google Patents

Test method and device for business object to be tested and electronic device Download PDF

Info

Publication number
CN112363932B
CN112363932B CN202011256942.8A CN202011256942A CN112363932B CN 112363932 B CN112363932 B CN 112363932B CN 202011256942 A CN202011256942 A CN 202011256942A CN 112363932 B CN112363932 B CN 112363932B
Authority
CN
China
Prior art keywords
tested
service
business object
script file
business
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011256942.8A
Other languages
Chinese (zh)
Other versions
CN112363932A (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

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

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 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 the execution of a locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing a table locking operation on the data table associated with the service object to be tested; repeatedly initiating the service request associated with the service object to be tested to a server in the process of executing the table locking operation; stopping executing the locking list 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. The invention solves the technical problems of lower test accuracy and higher test cost of the test service object in the related technology.

Description

Test method and device for business object to be tested and electronic device
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for testing a service object to be tested, and an electronic device.
Background
In the related art, in the software testing process, accuracy and uniqueness of data are generally required to be verified, for example, a method of system performance test and database performance test is adopted to test a service object, however, due to complexity of a service scenario, only a single functional test or performance test (for example, performance test is carried out on system pressurization or database pressurization) is adopted, so that a problem of data uniqueness caused by data concurrency is difficult to be effectively tested, for example, a problem that database lock table appears due to low database performance caused by excessive concurrency requests, and repeated data on the service is not processed in time is caused. Moreover, the performance testing tool used in the related art has the problems of higher testing cost, low performance testing execution efficiency and difficulty in reproducing the testing process.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for testing a service 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 the service object to be tested in the related technology.
According to an aspect of the embodiment of the present invention, there is provided a test method for a business object to be tested, including: acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating the execution of a locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing a table locking operation on the data table associated with the service object to be tested; repeatedly initiating the service request associated with the service object to be tested to a server in the process of executing the table locking operation; stopping executing the locking list 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.
According to another aspect of the embodiment of the present invention, there is also provided a test apparatus for a business object to be tested, including: the acquisition module is used for acquiring a database script file corresponding to the to-be-tested business object, wherein the database script file is used for simulating the execution of a locking operation on a data table associated with the to-be-tested business object; the lock table module is used for running the database script file and executing lock table operation on the data table related to the business object to be tested; the request module is used for repeatedly initiating the service request related to the service object to be tested to the server in the process of executing the lock table operation; and the processing module is used for stopping executing the locking list 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.
According to another aspect of the embodiment of the present invention, there is further provided a nonvolatile storage medium, where the nonvolatile storage medium includes a stored program, and when the program runs, a device where the nonvolatile storage medium is located is controlled to execute any one of the test methods of the service object to be tested.
According to another aspect of the embodiment of the present invention, there is further provided a processor, where the processor is configured to execute a program stored in a memory, where the program executes any one of the methods for testing a service object to be tested.
According to another aspect of the embodiment 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 run the computer program to execute the test method of any one of the to-be-tested service objects.
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 a locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing a table locking operation on the data table associated with the service object to be tested; repeatedly initiating the 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 locking list operation, 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, and achieving the purpose of testing the service request related to the service object, thereby realizing 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 embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of a method of testing a business object to be tested according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative method of testing a business object to be tested in accordance with an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a test device for a business object to be tested according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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.
According to an embodiment of the present invention, there is provided an embodiment of a method of testing a business object to be tested, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and that, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than what is shown or described herein.
The technical scheme of the method embodiment can be executed in a mobile terminal, a computer terminal or similar computing devices. Taking the mobile terminal as an example, the mobile terminal can be a terminal device such as a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, a mobile internet device (Mobile Internet Devices, abbreviated as MID), a PAD, etc. A mobile terminal may include one or more processors (which may include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processor (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 appreciated by those of ordinary skill in the art that the foregoing structural descriptions are merely illustrative and are not intended to limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than the above structural description, or have a different configuration than the above structural description.
The memory may be used to store a computer program, for example, a software program of application software and a module, for example, a computer program corresponding to a processing method of a game screen in an embodiment of the present invention, and the processor executes the computer program stored in the memory, thereby performing various functional applications and data processing, that is, implementing the above-described processing method of a game screen. 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 remotely located with respect to the processor, the remote memory being connectable 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 for receiving or transmitting 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 (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through the base station to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly. The technical scheme of the method embodiment can be applied to various communication systems, such as: global system for mobile communications (Global System of Mobile communication, abbreviated GSM), code division multiple access (Code Division Multiple Access, abbreviated CDMA) system, wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated WCDMA) system, general packet radio service (General Packet Radio Service, abbreviated GPRS), long term evolution (Long Term Evolution, abbreviated LTE) system, LTE frequency division duplex (Frequency Division Duplex, abbreviated FDD) system, LTE time division duplex (Time Division Duplex, abbreviated TDD), universal mobile communication system (Universal Mobile Telecommunication System, abbreviated UMTS), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, abbreviated WiMAX) communication system, or 5G system, etc. Alternatively, device-to-Device (D2D) communication may be performed between a plurality of mobile terminals. Alternatively, the 5G system or 5G network is also referred to as a New Radio (NR) system or NR network.
Display devices may be, for example, touch screen type Liquid Crystal Displays (LCDs) and touch displays (also referred to as "touch screens" or "touch display screens"). 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), and the user may interact with the GUI by touching finger contacts and/or gestures on the touch-sensitive surface, where the man-machine interaction functions optionally include the following interactions: executable instructions for performing the above-described human-machine interaction functions, such as creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving electronic mail, talking interfaces, playing digital video, playing digital music, and/or web browsing, are configured/stored in a computer program product or readable non-volatile storage medium executable by one or more processors.
Fig. 1 is a flowchart of a test method for a business object to be tested according to an embodiment of the present invention, as shown in fig. 1, the method includes the steps of:
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 the execution of a locking operation on a data table associated with the to-be-tested business object;
step S102, running the database script file, and executing a table locking operation on a data table associated with the business object to be tested;
step S104, repeatedly initiating the service request related to the service object to be tested to the server in the process of executing the lock list operation;
and S106, stopping executing the locking list 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 a locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing a table locking operation on the data table associated with the service object to be tested; repeatedly initiating the 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 locking list operation, 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, and achieving the purpose of testing the service request related to the service object, thereby realizing 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.
Alternatively, the service object to be tested may be any type of software test service object, for example, an attendance flow service, a card punching flow service, a leave application flow service, etc.
It should be noted that, in the embodiment of the present application, the execution body is a client, and tests whether a service request initiated to a server passes a service test, and in the embodiment of the present application, the client may write a database script file, for example, a transaction sql script, of a delay occupation database table by analyzing a data table associated with the service object to be tested.
In an alternative embodiment, fig. 2 is a flowchart of an alternative method for testing a business object to be tested according to an embodiment of the present invention, as shown in fig. 2, the step S102, where 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, the database script file is configured based on the business process data recorded in the main table.
Optionally, the main table is used for recording the business process data of the business object to be tested.
As an alternative embodiment, since in the attendance application process, only 1 leave request can be initiated within the same time, i.e. two vacations cannot be requested at the same time, the following is exemplified by the attendance application service:
firstly, a client determines an attendance main table CUX_wf_LeaveApply associated with an attendance application service from a data table associated with the attendance application service to be tested by analyzing the data table; because the business process data of the attendance application business are all recorded in the attendance main table CUX_wf_LeaveApply, a database script file (e.g. sql script) simulating the database lock table can be written based on the business process data.
In an alternative embodiment, configuring the database script file based on the business process data recorded in the master table includes:
step S302, configuring a to-be-executed lock table operation and a sleep time length corresponding to the to-be-executed lock table operation based on the business process data recorded in the main table, and obtaining the database script file.
The sleep time is used for repeatedly initiating the service request.
Taking the above attendance application service as an example, the client writes a transaction to perform a lock table operation (update operation) on the attendance main table cux_wf_leave apply based on the service flow data recorded in the attendance main table cux_wf_leave_apply, and a sleep time period corresponding to the above lock table operation to be performed (for example, sleep for 1 minute, so that there is enough time to send a repeat request), to obtain a database script file that may be, but is not limited to, as shown in 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 lock table operation can be performed on the attendance main table cux_wf_leave apply, and it should be noted that, the lock table operation is caused by performing the update operation on the database table, which belongs to a lock table mechanism of the database table.
In an alternative embodiment, the method further comprises:
step S402, time information and content information contained in the service request are configured based on the service flow data recorded in the main table.
Optionally, the time information may be a leave-out duration, and the content information may be a leave-out content.
As an optional embodiment, the client repeatedly initiates the service request (WEB request) associated with the service object to be tested to the server during the process of executing the table locking operation.
For example, taking the above-mentioned service of checking-in application as an example, the client side repeatedly submits the request of checking-in application with the time length of asking for leave 2020-07-01:09:00 to 10:00 to the server side by using the same checking-in account. And after repeatedly initiating the service request, the client stops executing the locking table operation, and determines whether the service request passes the service test based on a service processing result corresponding to the service request returned by the server.
In an alternative embodiment, the stopping the execution of the lock table operation includes:
step S502, after the sleep time, performing data rollback to resume executing the service object to be tested.
Optionally, the client stops performing the lock table operation, that is, performs data Rollback after the sleep time period is elapsed, for example, still taking the attendance application service as an example, the client performs data Rollback by running "Rollback Tran" in the database script file.
In the embodiment of the application, the execution of the table locking operation is stopped, namely, the operation of the service is continued, the execution of the service object to be tested is resumed, and the real service scene is simulated.
In an alternative embodiment, determining whether the service request passes the 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 to-be-tested service object, determining that the service request passes the service test;
in step S604, when the service processing result does not meet the service requirement of the to-be-tested service object, it is determined that the service request fails the service test.
In the above alternative embodiment, the client detects whether the sent service request passes the service test, that is, detects whether the service processing result returned by the server meets the service requirement of the to-be-tested service object.
In an alternative embodiment, taking the above-mentioned attendance application service as an example, if one of two leave requests with identical leave times sent by the same attendance account is not submitted successfully by the client, that is, only one attendance application flow is created for two leave requests with identical leave times sent by the same attendance account, it is determined that the service processing result meets the service requirement of the to-be-tested service object, and it is determined that the service request fails the service test.
In another alternative embodiment, taking the above-mentioned attendance application service as an example, if the client side submits both the two leave requests with identical leave times sent by the same attendance account successfully, that is, creates two attendance application flows for the two leave requests with identical leave times sent by the same attendance account, then determines that the service processing result does not meet the service requirement of the to-be-tested service object, and determines that the service request fails the service test.
According to the test scheme of the business object to be tested, which is provided by the embodiment of the application, the problem that other related functions are unstable due to performance test can be avoided, the test time is shortened, the test cost is further reduced, and the uniqueness of test data in a data concurrency scene can be realized.
According to an embodiment of the present invention, there is further provided an embodiment of a device for implementing the method for testing a business object to be tested, and fig. 3 is a schematic structural diagram of a device for testing a business object to be tested according to an embodiment of the present invention, as shown in fig. 3, where the device for testing a business object to be tested includes: an acquisition module 30, a lock table module 32, a request module 34, and a processing module 36, wherein:
the acquiring module 30 is configured to acquire 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; the lock table module 32 is configured to run the database script file, and perform a lock table operation on the data table associated with the service object to be tested; a request module 34, configured to repeatedly initiate, to a server, a service request associated with the service object to be tested in a process of performing a lock table operation; a processing module 36, configured to stop executing the lock table operation, and determine whether the service request passes the service test based on a service processing result corresponding to the service request returned by the server
It should be noted that each of the above modules may be implemented by software or hardware, for example, in the latter case, it may be implemented by: the above modules may be located in the same processor; alternatively, the various modules described above may be located in different processors in any combination.
It should be noted that, the obtaining module 30, the lock table module 32, the requesting 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 examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the method embodiment. It should be noted that the above modules may be run in a computer terminal as part of the apparatus.
It should be noted that, the optional or preferred implementation manner of this embodiment may refer to the related description in the method embodiment, which is not repeated herein.
The test device for the service object to be tested may further include a processor and a memory, where the obtaining module 30, the lock table module 32, the requesting module 34, the processing module 36, and the like are all stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, the kernel fetches corresponding program units from the memory, and one or more of the kernels can be arranged. The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
According to an embodiment of the present application, there is also provided a nonvolatile storage medium embodiment. Optionally, in this embodiment, the nonvolatile storage medium includes a stored program, where when the program runs, the device in which the nonvolatile storage medium is controlled to execute the test method of any one of the to-be-tested service objects.
Alternatively, in this embodiment, the above-mentioned nonvolatile storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network or in any one of the mobile terminals in the mobile terminal group, and the above-mentioned nonvolatile storage medium includes a stored program.
Optionally, the program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating the execution of a locking operation on a data table associated with the to-be-tested business object; running the database script file, and executing a table locking operation on the data table associated with the service object to be tested; repeatedly initiating the service request associated with the service object to be tested to a server in the process of executing the table locking operation; stopping executing the locking list 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.
Optionally, the program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: analyzing the data table associated with the to-be-tested business object, and determining a main table associated with the to-be-tested business object from the data table, wherein the main table is used for recording business flow data of the to-be-tested business object; and configuring the database script file based on the business process data recorded in the main table.
Optionally, the program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: and configuring a to-be-executed lock table operation and a sleep time length 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 sleep time length is used for repeatedly initiating the business request.
Optionally, the program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: 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 program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: and after the sleep time, carrying out data rollback to resume the execution of the business object to be tested.
Optionally, the program controls the device in which the nonvolatile storage medium is located to perform the following functions when running: when the service processing result meets the service requirement of the to-be-tested service object, determining that the service request passes the service test; and when the service processing result does not meet the service requirement of the to-be-tested service object, determining that the service request fails the service test.
According to an embodiment of the present application, there is also provided a processor embodiment. Optionally, in this embodiment, the processor is configured to run a program, where the program runs to execute any one of the test methods of the service object to be tested.
According to an embodiment of the present application, there is further provided an embodiment of an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to execute the method for testing a business object to be tested according to any one of the above.
According to an embodiment of the present application, there is also provided a computer program product embodiment adapted to perform a program initializing the steps of the test method of a business object to be tested as described in any one of the above, when executed on a data processing device.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units may be a logic function division, and there may be another division manner when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable non-volatile storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a non-volatile storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various 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, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (8)

1. A method of testing a business object to be tested, comprising:
acquiring a database script file corresponding to a to-be-tested business object, wherein the database script file is used for simulating the execution of a locking operation on a data table associated with the to-be-tested business object;
running the database script file, and executing a table locking operation on the data table associated with the business 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 lock table operation;
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 step of obtaining the database script file corresponding to the business object to be tested comprises the following steps: analyzing a data table associated with the to-be-tested business object, and determining a main table associated with the to-be-tested business object from the data table, wherein the main table is used for recording business flow data of the to-be-tested business object; configuring the database script file based on the business process data recorded in the main table;
wherein configuring the database script file based on the business process data recorded in the master table includes: and configuring a to-be-executed lock table operation and a sleep time length corresponding to the to-be-executed lock table operation based on the business flow data recorded in the main table to obtain the database script file, wherein the sleep time length is used for repeatedly initiating the business request.
2. The method according to claim 1, wherein the method further comprises:
and configuring time information and content information contained in the service request based on the service flow data recorded in the main table.
3. The method of claim 1, wherein ceasing to perform the lock table operation comprises:
and after the sleep duration is over, performing data rollback to resume execution of the business object to be tested.
4. 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 to-be-tested service object, determining that the service request passes the service test;
and when the service processing result does not meet the service requirement of the to-be-tested service object, determining that the service request fails the service test.
5. A test device for a business object to be tested, comprising:
the acquisition module is used for acquiring a database script file corresponding to the to-be-tested business object, wherein the database script file is used for simulating the execution of a locking operation on a data table associated with the to-be-tested business object;
the table locking module is used for running the database script file and executing table locking operation on the data table associated with the business object to be tested;
the request module is used for repeatedly initiating the service request related to the service object to be tested to the server in the process of executing the lock table operation;
the processing module is used for 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;
wherein, the acquisition module is further used for: analyzing a data table associated with the to-be-tested business object, and determining a main table associated with the to-be-tested business object from the data table, wherein the main table is used for recording business flow data of the to-be-tested business object; configuring the database script file based on the business process data recorded in the main table;
wherein, the acquisition module is used for: and configuring a to-be-executed lock table operation and a sleep time length corresponding to the to-be-executed lock table operation based on the business flow data recorded in the main table to obtain the database script file, wherein the sleep time length is used for repeatedly initiating the business request.
6. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform the test method of the business object to be tested according to any one of claims 1 to 4.
7. A processor for executing a program stored in a memory, wherein the program is run to perform the method of testing a business object to be tested according to any one of claims 1 to 4.
8. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the test method of the business object to be tested according to any of claims 1 to 4.
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 CN112363932A (en) 2021-02-12
CN112363932B true 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)

Families Citing this family (2)

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

Citations (9)

* 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
CN102156928A (en) * 2011-04-29 2011-08-17 浪潮通信信息系统有限公司 Method for system concurrency control through business logic lock
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
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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7406679B2 (en) * 2002-05-10 2008-07-29 International Business Machines Corporation 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
US9367431B2 (en) * 2011-07-01 2016-06-14 Salesforce.Com, Inc. Testing data silo
US9575871B2 (en) * 2012-09-04 2017-02-21 Salesforce.Com, Inc. System and method for dynamically debugging data in a multi-tenant database environment
US9274936B2 (en) * 2013-05-29 2016-03-01 Sap Portals Israel Ltd Database code testing framework

Patent Citations (9)

* 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
CN102156928A (en) * 2011-04-29 2011-08-17 浪潮通信信息系统有限公司 Method for system concurrency control through business logic lock
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

Also Published As

Publication number Publication date
CN112363932A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
CN112363932B (en) Test method and device for business object to be tested and electronic device
CN110704058A (en) Page rendering method and device, storage medium, processor and electronic device
WO2017054510A1 (en) Data communication method, apparatus and system in communication process
CN111666199B (en) Debugging method executed on intelligent terminal and software debugger
CN112689012A (en) Cross-network proxy communication method and device
CN111625313A (en) Resource processing progress display method and device, electronic equipment and storage medium
CN110286981A (en) The display methods and display system of the use state of virtual cloud desktop server
US10503430B2 (en) Method and device for clearing data and electronic device
CN110209557A (en) User's operation records restoring method, device, equipment and readable storage medium storing program for executing
CN111158987B (en) Health check method and device for micro-service architecture
CN113485952A (en) Data batch transmission method and device
CN110166955B (en) Method and equipment for reminding schedule
CN111767558A (en) Data access monitoring method, device and system
US20230035104A1 (en) Verification method, apparatus and device, and storage medium
CN109246077A (en) Distributed concurrent transaction method of calibration, device and computer storage medium
CN106067894B (en) A kind of information acquisition method and electronic equipment
CN109542531B (en) File layout adjustment method and device
CN113852610A (en) Message processing method and device, computer equipment and storage medium
CN113050936A (en) Front-end data processing method and device based on integrated development environment
CN113326186A (en) Software testing method and device, electronic equipment and storage medium
CN113760715A (en) Method and device for testing system
CN110674135A (en) MongoDB-based answer data statistical method and device and storage medium
CN103618996A (en) Position data processing method, client and server
CN110618913A (en) Application use duration segmented statistics method and terminal
CN111831530A (en) Test 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