CN113157586A - Financial market unit test case generation method and device - Google Patents

Financial market unit test case generation method and device Download PDF

Info

Publication number
CN113157586A
CN113157586A CN202110479859.5A CN202110479859A CN113157586A CN 113157586 A CN113157586 A CN 113157586A CN 202110479859 A CN202110479859 A CN 202110479859A CN 113157586 A CN113157586 A CN 113157586A
Authority
CN
China
Prior art keywords
algorithm
test case
unit test
financial market
service interface
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
CN202110479859.5A
Other languages
Chinese (zh)
Other versions
CN113157586B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110479859.5A priority Critical patent/CN113157586B/en
Publication of CN113157586A publication Critical patent/CN113157586A/en
Application granted granted Critical
Publication of CN113157586B publication Critical patent/CN113157586B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for generating a test case of a financial market unit, which can be applied to the financial field, wherein the method comprises the following steps: acquiring preset service interface parameters and preset algorithm influence factors; distributing the proportion of each test case according to the service interface parameters and the algorithm influence factors; and generating executable unit test codes according to the distribution result. By introducing the parameter of the algorithm influence factor, the proportion of each test case is determined for different algorithms according to the influence factor, so that the generated test cases are more close to the reality and more reasonable, the problem of great error with the actual result caused by the average distribution proportion of each test case is solved, the test cases can be automatically generated without manual design, the test cases can be accurately and efficiently generated and tested, the dependence of the design of the test cases on the experience accumulation and the technical capability of testers is remarkably reduced, and the labor input in the design process of the test cases is effectively reduced.

Description

Financial market unit test case generation method and device
Technical Field
The application belongs to the technical field of testing, and particularly relates to a financial market unit test case generation method and device.
Background
In the field of financial markets, products relate to a plurality of service interfaces, and in order to ensure the quality of codes, code developers are generally required to ensure the quality of service codes through writing unit tests. The financial market business service interface generally relates to more business elements as service parameters, and certain incidence relation exists between the business elements, and in addition, developers are not good at business case design, so that case design is not professional, unit test cost is high, but a guard effect is poor.
Writing unit test generally has two types of technical schemes, one of which is that a code developer manually designs a case through experience and manually writes unit test codes. This solution is costly and inefficient, relying on the personal experience of the code developer. The second is to automatically generate cases for a certain test method. The scheme has a single form, supports few types and cannot meet the characteristics of financial market service interfaces.
Disclosure of Invention
The application provides a financial market unit test case generation method and device, which at least solve the problems that the existing test case generation mode is high in cost, dependent on personal experience of code developers and low in efficiency.
According to a first aspect of the application, there is provided a financial market unit test case generation method, comprising:
acquiring preset service interface parameters and preset algorithm influence factors;
distributing the proportion of each test case according to the service interface parameters and the algorithm influence factors;
and generating executable unit test codes according to the distribution result.
In one embodiment, the financial market unit test case generation method further comprises:
and executing the generated unit test code and storing an execution result.
In one embodiment, the method for generating the test cases of the financial market unit distributes the specific gravity of each type of test case according to the service interface parameters and the algorithm influence factors, and comprises the following steps:
analyzing the service interface parameters;
extracting an algorithm type field from the analyzed service interface parameters;
and distributing the proportion of each type of test case according to the extracted algorithm type and the algorithm influence factor.
In one embodiment, the assigning the specific gravity of each type of test case according to the extracted algorithm type and algorithm influence factor includes:
calling different case algorithms according to the extracted algorithm types;
searching an algorithm influence factor corresponding to the case algorithm from preset algorithm influence factors;
case data are distributed according to corresponding algorithm impact factors.
In one embodiment, the financial market unit test case generation method further comprises:
and executing the generated unit test code and storing an execution result.
In one embodiment, the financial market unit test case generation method further comprises:
and monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
In one embodiment, the financial market unit test case generation method further comprises:
and executing the generated unit test code and storing an execution result.
According to a second aspect of the present application, there is also provided a financial market unit test case generating apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring preset service interface parameters and preset algorithm influence factors;
the proportion distribution unit is used for distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors;
and the execution unit is used for generating executable unit test codes according to the distribution result.
In one embodiment, the specific gravity distribution unit includes:
the analysis module is used for analyzing the service interface parameters;
the algorithm type extraction module is used for extracting an algorithm type field from the analyzed service interface parameters;
and the proportion distribution module is used for distributing the proportion of each type of test case according to the extracted algorithm type and the algorithm influence factor.
In one embodiment, the specific gravity distribution module includes:
the calling module is used for calling different case algorithms according to the extracted algorithm types;
the searching module is used for searching the algorithm influence factor corresponding to the case algorithm from the preset algorithm influence factors;
and the distribution module is used for distributing the case data according to the corresponding algorithm influence factors.
In one embodiment, the financial market unit test case generating apparatus further comprises:
and the early warning module is used for monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
According to a third aspect of the present application, there is also provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the financial market unit test case generation method when executing the program.
According to a fourth aspect of the present application, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the financial market unit test case generation method.
According to the technical scheme, the application provides a financial market unit test case generation method and device, and the method comprises the following steps: acquiring preset service interface parameters and preset algorithm influence factors; distributing the proportion of each test case according to the service interface parameters and the algorithm influence factors; and generating executable unit test codes according to the distribution result. By introducing the parameter of the algorithm influence factor, the proportion of each test case is determined for different algorithms according to the influence factor, so that the generated test cases are more close to the reality and more reasonable, the problem of great error with the actual result caused by the average distribution proportion of each test case is solved, the test cases can be automatically generated without manual design, the test cases can be accurately and efficiently generated and tested, the dependence of the design of the test cases on the experience accumulation and the technical capability of testers is remarkably reduced, and the labor input in the design process of the test cases is effectively reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a financial market unit test case generation method provided by the present application.
Fig. 2 is a flowchart of a method for assigning specific gravities of various types of test cases in the embodiment of the present application.
Fig. 3 is a flowchart illustrating the assignment of the specific gravity of each type of test case according to the extracted algorithm type and the algorithm impact factor in the embodiment of the present application.
Fig. 4 is a block diagram illustrating a structure of a test case generating apparatus of a financial market unit according to the present application.
Fig. 5 is a block diagram of a specific gravity distribution unit in the embodiment of the present application.
Fig. 6 is a block diagram of a specific gravity distribution module in the embodiment of the present application.
Fig. 7 is a specific implementation of an electronic device in an embodiment of the present application.
Detailed Description
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 method and the device for generating the test case of the financial market unit disclosed in the present application can be used in the financial technology field, and can also be used in any field except the financial technology field.
The financial market business service interface generally relates to more business elements as service parameters, and certain incidence relation exists between the business elements, and in addition, developers are not good at business case design, so that case design is not professional, unit test cost is high, but a guard effect is poor. Writing unit test generally has two types of technical schemes, one of which is that a code developer manually designs a case through experience and manually writes unit test codes. This solution is costly and inefficient, relying on the personal experience of the code developer. The second is to automatically generate cases for a certain test method. The scheme has a single form, supports few types and cannot meet the characteristics of financial market service interfaces.
Based on the above problems, the present application provides a financial market unit test case generation method and apparatus, the method includes: acquiring preset service interface parameters and preset algorithm influence factors; distributing the proportion of each test case according to the service interface parameters and the algorithm influence factors; and generating executable unit test codes according to the distribution result. By introducing the parameter of the algorithm influence factor, the proportion of each test case is determined for different algorithms according to the influence factor, so that the generated test cases are more close to the reality and more reasonable, the problem of great error with the actual result caused by the average distribution proportion of each test case is solved, the test cases can be automatically generated without manual design, the test cases can be accurately and efficiently generated and tested, the dependence of the design of the test cases on the experience accumulation and the technical capability of testers is remarkably reduced, and the labor input in the design process of the test cases is effectively reduced.
Based on the above, the present application further provides a financial market unit test case generating device for implementing the financial market unit test case generating method provided in one or more embodiments of the present application, where the financial market unit test case generating device may be in communication connection with client devices by itself or through a third-party server, so as to receive test requests respectively initiated by the client devices, and then trigger a program in the device for implementing the financial market unit test case generating method provided in one or more embodiments of the present application to execute a test case generating step and a test case executing step.
It is understood that the client devices may include smart phones, tablet electronic devices, network set-top boxes, portable computers, desktop computers, Personal Digital Assistants (PDAs), in-vehicle devices, smart wearable devices, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In another practical application scenario, the aforementioned part of the financial market unit test case generation performed by the financial market unit test case generation apparatus may be performed in the server as described above, or all operations may be performed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. If all the operations are completed in the client device, the client device may further include a processor for performing a specific process of automatic fault diagnosis in the batch service process.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
The server and the client device may communicate using any suitable network protocol, including network protocols not yet developed at the filing date of this application. The network protocol may include, for example, a TCP/IP protocol, a UDP/IP protocol, an HTTP protocol, an HTTPS protocol, or the like. Of course, the network Protocol may also include, for example, an RPC Protocol (Remote Procedure Call Protocol), a REST Protocol (Representational State Transfer Protocol), and the like used above the above Protocol.
The following embodiments and application examples are specifically and individually described in detail.
In order to design test cases and implement tests more accurately and efficiently, the application provides a financial market unit test case generation method, as shown in fig. 1, including:
s101: and acquiring preset service interface parameters and preset algorithm influence factors.
S102: and distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors.
S103: and generating executable unit test codes according to the distribution result.
In one embodiment, the main implementation of the method shown in fig. 1 is an adaptive intelligent algorithm-based financial market unit test case generation apparatus, which includes: the system comprises a data access analysis device, a test case algorithm device, a case generation device, a unit test code generation device and a case execution result display device.
Specifically, the device performs the following steps:
step 1): importing service interface parameters (supporting Excel), accessing system operation data into an analysis device, and analyzing interface parameters and algorithm influence factors configured by a user by the device.
Step 2): the test case algorithm device distributes the proportion of each type of test case through a self-adaptive algorithm according to the information acquired in the step 1).
Step 3): and the case generation device triggers the case automatic device to operate to generate case cases meeting requirements under the conditions of the algorithm, the specific gravity and the like acquired in the step 2).
Step 4): the unit test code generation device acquires the generated case in the step 3) and triggers and generates the executable unit test code.
Step 5): the case execution result display device acquires the execution result in the step 4) and triggers the execution result to enter the database.
In one embodiment, the financial market unit test case generation method further comprises:
and executing the generated unit test code and storing an execution result.
In one embodiment, the case execution result presentation device is used for executing the test cases and storing the execution result data into the database.
In an embodiment, the method for generating the test cases of the financial market unit allocates the specific gravity of each type of test case according to the service interface parameters and the algorithm impact factors, as shown in fig. 2, including:
s201: and analyzing the service interface parameters.
S202: and extracting an algorithm type field from the analyzed service interface parameters.
S203: and distributing the proportion of each type of test case according to the extracted algorithm type and the algorithm influence factor.
In one embodiment, assigning the specific gravity of each type of test case according to the extracted algorithm type and algorithm impact factor, as shown in fig. 3, includes:
s301: and calling different case algorithms according to the extracted algorithm types.
S302: and searching the algorithm influence factor corresponding to the case algorithm from the preset algorithm influence factors.
S303: case data are distributed according to corresponding algorithm impact factors.
In one embodiment, the financial market unit test case generation method further comprises:
and monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
In one embodiment, the present application provides an apparatus for generating a financial market unit test case based on an adaptive intelligent algorithm, including: the system comprises a data access analysis device, a test case algorithm device, a case generation device, a unit test code generation device and a case execution result display device. Wherein the data access analysis device is connected with the test case algorithm device; the test case algorithm device is connected with the case generation device; the case generation device is connected with the unit test code generation device; the unit test code generating device is connected with the case execution result display device.
The data access analysis device is used for preparing interface document parameters and test algorithm influence factor configuration parameter data before the system is started, and after the system is started, the data access analysis device starts to process the interface document parameters and the test algorithm influence factor configuration parameter data.
The test case algorithm device is used for receiving the streaming data analyzed by the data access analysis device 1 after the device is started, and calling different case algorithm abstract classes according to a type (algorithm type) field to realize the data taking.
The case generating device is used for receiving data from the test case algorithm device 2 after the device is started, distributing case data in a self-adaptive mode according to an algorithm Factor value, and sending related case data to the unit test code generating device 4.
The unit test code generation device is used for automatically producing executable unit test Java codes based on a Java code reflection idea according to unit test cases and algorithm types after the device is started.
The case execution result display device can store the execution result data into the database through the execution test cases.
In order to better explain the scheme provided by the present application, the following describes a specific workflow of the financial market unit test case generating device for executing the financial market unit test case generating method provided by the present application:
s1: application system start-up
S2: and starting the data access analysis device, and starting to process the interface parameters and the configuration of the influence factors.
S3: and automatically starting the test case algorithm device, and calling different abstract classes to realize case algorithms according to the type field after the access device takes the data.
S4: and the case generating device is used for generating unit test cases of different test methods according to the configuration of the influence factors.
S5: and starting the unit test code generating device according to the generated test case, and automatically generating the executable unit test code.
S6: the system is started, and the case execution result is automatically stored in the database.
The execution main body of the method shown in fig. 1 to fig. 3 is a financial market unit test case generation device, specifically, a PC, a server, and the like, and by introducing a parameter of an algorithm influence factor, the specific gravity of each test case is determined according to the influence factor for different algorithms, so that the generated test cases are more practical and reasonable, and the problem of a very large error from an actual result due to the average distribution of the specific gravity of each test case is not caused.
Based on the same inventive concept, the embodiment of the present application further provides a financial market unit test case generating device, which can be used to implement the method described in the above embodiment, as described in the following embodiments. The principle of solving the problems of the financial market unit test case generating device is similar to that of the financial market unit test case generating method, so the implementation of the financial market unit test case generating device can be referred to the implementation of the financial market unit test case generating method. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
As shown in fig. 4, a block diagram of a financial market unit test case generating apparatus provided in the present application includes:
an obtaining unit 401, configured to obtain a preset service interface parameter and a preset algorithm impact factor;
a proportion distribution unit 402, configured to distribute proportions of various test cases according to the service interface parameters and the algorithm impact factors;
and an execution unit 403, configured to generate an executable unit test code according to the allocation result.
In one embodiment, the present application provides an apparatus for generating a financial market unit test case based on an adaptive intelligent algorithm, the apparatus comprising: the system comprises a data access analysis device, a test case algorithm device, a case generation device, a unit test code generation device and a case execution result display device.
Specifically, the device performs the following steps:
step 1): importing service interface parameters (supporting Excel), accessing system operation data into an analysis device, and analyzing interface parameters and algorithm influence factors configured by a user by the device.
Step 2): the test case algorithm device distributes the proportion of each type of test case through a self-adaptive algorithm according to the information acquired in the step 1).
Step 3): and the case generation device triggers the case automatic device to operate to generate case cases meeting requirements under the conditions of the algorithm, the specific gravity and the like acquired in the step 2).
Step 4): the unit test code generation device acquires the generated case in the step 3) and triggers and generates the executable unit test code.
Step 5): the case execution result display device acquires the execution result in the step 4) and triggers the execution result to enter the database.
In one embodiment, as shown in fig. 5, the specific gravity distribution unit 402 includes:
the analysis module 501 is used for analyzing the service interface parameters;
an algorithm type extraction module 502, configured to extract an algorithm type field from the parsed service interface parameters;
and the proportion distribution module 503 is configured to distribute the proportions of the various types of test cases according to the extracted algorithm type and the algorithm influence factor.
In one embodiment, as shown in fig. 6, the specific gravity distribution module 503 includes:
a calling module 601, configured to call different case algorithms according to the extracted algorithm types;
the searching module 602 is configured to search for an algorithm influence factor corresponding to a case algorithm from preset algorithm influence factors;
an assigning module 603, configured to assign case data according to the corresponding algorithm impact factor.
In one embodiment, the financial market unit test case generating apparatus further comprises:
and the early warning module is used for monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
In one embodiment, the present application provides an apparatus for generating a financial market unit test case based on an adaptive intelligent algorithm, including: the system comprises a data access analysis device, a test case algorithm device, a case generation device, a unit test code generation device and a case execution result display device. Wherein the data access analysis device is connected with the test case algorithm device; the test case algorithm device is connected with the case generation device; the case generation device is connected with the unit test code generation device; the unit test code generating device is connected with the case execution result display device.
The data access analysis device is used for preparing interface document parameters and test algorithm influence factor configuration parameter data before the system is started, and after the system is started, the data access analysis device starts to process the interface document parameters and the test algorithm influence factor configuration parameter data.
The test case algorithm device is used for receiving the streaming data analyzed by the data access analysis device 1 after the device is started, and calling different case algorithm abstract classes according to a type (algorithm type) field to realize the data taking.
The case generating device is used for receiving data from the test case algorithm device 2 after the device is started, distributing case data in a self-adaptive mode according to an algorithm Factor value, and sending related case data to the unit test code generating device 4.
The unit test code generation device is used for automatically producing executable unit test Java codes based on a Java code reflection idea according to unit test cases and algorithm types after the device is started.
The case execution result display device can store the execution result data into the database through the execution test cases.
In order to better explain the scheme provided by the present application, the following describes a specific workflow of the financial market unit test case generating device for executing the financial market unit test case generating method provided by the present application:
s1: application system start-up
S2: and starting the data access analysis device, and starting to process the interface parameters and the configuration of the influence factors.
S3: and automatically starting the test case algorithm device, and calling different abstract classes to realize case algorithms according to the type field after the access device takes the data.
S4: and the case generating device is used for generating unit test cases of different test methods according to the configuration of the influence factors.
S5: and starting the unit test code generating device according to the generated test case, and automatically generating the executable unit test code.
S6: the system is started, and the case execution result is automatically stored in the database.
According to the technical scheme, the application provides a financial market unit test case generation method and device, and the method comprises the following steps: acquiring preset service interface parameters and preset algorithm influence factors; distributing the proportion of each test case according to the service interface parameters and the algorithm influence factors; and generating executable unit test codes according to the distribution result. By introducing the parameter of the algorithm influence factor, the proportion of each test case is determined for different algorithms according to the influence factor, so that the generated test cases are closer to the reality and more reasonable, the problem of large error with the actual result caused by the average distribution proportion of each test case is avoided, moreover, the method can automatically generate the test case, does not need manual design, can accurately and efficiently generate the test case and carry out the test, obviously reduces the dependence of the design of the test case on experience accumulation and technical capability of testers, effectively reduces the labor input in the design process of the test case, does not need manual input of enumerated values of parameter fields by users, can reduce the time of field manufacture number, shortens the period, and the case generation is based on the adaptive algorithm, different testing methods are comprehensively applied, the specialization and the effectiveness are achieved, and the unit testing effect is greatly improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
An embodiment of the present application further provides a specific implementation manner of an electronic device capable of implementing all steps in the method in the foregoing embodiment, and referring to fig. 7, the electronic device specifically includes the following contents:
a processor (processor)701, a memory 702, a communication Interface 703, a bus 704, and a nonvolatile memory 705;
the processor 701, the memory 702 and the communication interface 703 complete mutual communication through the bus 704;
the processor 701 is configured to call the computer programs in the memory 702 and the nonvolatile memory 705, and when the processor executes the computer programs, the processor implements all the steps in the method in the foregoing embodiments, for example, when the processor executes the computer programs, the processor implements the following steps:
s101: and acquiring preset service interface parameters and preset algorithm influence factors.
S102: and distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors.
S103: and generating executable unit test codes according to the distribution result.
Embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments, where the computer-readable storage medium stores thereon a computer program, and the computer program when executed by a processor implements all the steps of the method in the above embodiments, for example, the processor implements the following steps when executing the computer program:
s101: and acquiring preset service interface parameters and preset algorithm influence factors.
S102: and distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors.
S103: and generating executable unit test codes according to the distribution result.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the hardware + program class embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment. Although embodiments of the present description provide method steps as described in embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the embodiments of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, and the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or 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, devices or units, and may be in an electrical, mechanical or other form. The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein. The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of an embodiment of the specification.
In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction. The above description is only an example of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure. Various modifications and variations to the embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present specification should be included in the scope of the claims of the embodiments of the present specification.

Claims (14)

1. A financial market unit test case generation method is characterized by comprising the following steps:
acquiring preset service interface parameters and preset algorithm influence factors;
distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors;
and generating executable unit test codes according to the distribution result.
2. The financial market unit test case generation method of claim 1, further comprising:
and executing the generated unit test code, and storing an execution result.
3. The method as claimed in claim 1, wherein said assigning the specific gravity of each type of test case according to the service interface parameters and the algorithm impact factors comprises:
analyzing the service interface parameters;
extracting an algorithm type field from the analyzed service interface parameters;
and distributing the proportion of each type of test case according to the extracted algorithm type and the algorithm influence factor.
4. The financial market unit test case generation method of claim 3, wherein assigning the specific gravity of each type of test case according to the extracted algorithm type and the algorithm impact factor comprises:
calling different case algorithms according to the extracted algorithm types;
searching an algorithm influence factor corresponding to the case algorithm from preset algorithm influence factors;
case data are distributed according to corresponding algorithm impact factors.
5. The financial market unit test case generation method of claim 4, further comprising:
and executing the generated unit test code, and storing an execution result.
6. The financial market unit test case generation method of claim 5, further comprising:
and monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
7. The financial market unit test case generation method of claim 6, further comprising:
and executing the generated unit test code, and storing an execution result.
8. A financial market unit test case generation apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring preset service interface parameters and preset algorithm influence factors;
the proportion distribution unit is used for distributing the proportion of each type of test case according to the service interface parameters and the algorithm influence factors;
and the execution unit is used for generating executable unit test codes according to the distribution result.
9. The financial market unit test case generation apparatus of claim 8, further comprising:
and the execution storage unit is used for executing the generated unit test code and storing an execution result.
10. The financial market unit test case generating apparatus of claim 8, wherein the specific gravity distribution unit comprises:
the analysis module is used for analyzing the service interface parameters;
the algorithm type extraction module is used for extracting an algorithm type field from the analyzed service interface parameters;
and the proportion distribution module is used for distributing the proportion of each type of test case according to the extracted algorithm type and the algorithm influence factor.
11. The financial market unit test case generating apparatus of claim 10, wherein the specific gravity distribution module comprises:
the calling module is used for calling different case algorithms according to the extracted algorithm types;
the searching module is used for searching the algorithm influence factor corresponding to the case algorithm from the preset algorithm influence factors;
and the distribution module is used for distributing the case data according to the corresponding algorithm influence factors.
12. The financial market unit test case generation apparatus of claim 11, further comprising:
and the early warning module is used for monitoring abnormal conditions occurring in the execution result in real time and sending early warning information to the terminal.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the financial market unit test case generation method of any one of claims 1 to 7 are implemented when the program is executed by the processor.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the financial market unit test case generation method according to any one of claims 1 to 7.
CN202110479859.5A 2021-04-30 2021-04-30 Financial market unit test case generation method and device Active CN113157586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110479859.5A CN113157586B (en) 2021-04-30 2021-04-30 Financial market unit test case generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110479859.5A CN113157586B (en) 2021-04-30 2021-04-30 Financial market unit test case generation method and device

Publications (2)

Publication Number Publication Date
CN113157586A true CN113157586A (en) 2021-07-23
CN113157586B CN113157586B (en) 2024-04-05

Family

ID=76873070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110479859.5A Active CN113157586B (en) 2021-04-30 2021-04-30 Financial market unit test case generation method and device

Country Status (1)

Country Link
CN (1) CN113157586B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190460A (en) * 2021-05-25 2021-07-30 中国工商银行股份有限公司 Method and device for automatically generating test cases

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN111026338A (en) * 2019-11-14 2020-04-17 用友网络科技股份有限公司 Printing method, printing device and storage medium based on editable template
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device
CN112699042A (en) * 2021-01-05 2021-04-23 中国工商银行股份有限公司 Method and device for generating unit test case

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347596A (en) * 2019-07-02 2019-10-18 腾讯科技(深圳)有限公司 A kind of test method, device, system, electronic equipment and medium
CN111026338A (en) * 2019-11-14 2020-04-17 用友网络科技股份有限公司 Printing method, printing device and storage medium based on editable template
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device
CN112699042A (en) * 2021-01-05 2021-04-23 中国工商银行股份有限公司 Method and device for generating unit test case

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190460A (en) * 2021-05-25 2021-07-30 中国工商银行股份有限公司 Method and device for automatically generating test cases
CN113190460B (en) * 2021-05-25 2024-03-15 中国工商银行股份有限公司 Automatic test case generation method and device

Also Published As

Publication number Publication date
CN113157586B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN107733708B (en) Equipment parameter configuration method and device, computer equipment and storage medium
US8606905B1 (en) Automated determination of system scalability and scalability constraint factors
CN110209569B (en) Interface test method, interface test device and storage medium
CN113157577A (en) PaaS cloud platform fault testing method and device
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN110597564A (en) Installation package construction and service component loading method, device and terminal equipment
CN111159046A (en) Test method, test device, electronic equipment, test system and storage medium
CN111881471A (en) Non-intrusive log data desensitization method, device and system
CN113157586B (en) Financial market unit test case generation method and device
CN109102200B (en) Timed task processing method and device
CN113343654A (en) General configuration method and device for information filling form
CN107092556B (en) Test method, device and equipment
CN113885971A (en) State management method and device based on self-adaptive platform system
CN109873731B (en) Test method, device and system
CN113032281A (en) Method and device for acquiring code coverage rate in real time
CN111949536B (en) JAVA application program testing method and system based on byte code technology
CN107193749B (en) Test method, device and equipment
CN110807058B (en) Method and system for exporting data
CN111008143A (en) Coverage rate scheduling test method, terminal device and computer readable storage medium
CN111046010A (en) Log storage method, device, system, electronic equipment and computer readable medium
CN109462491B (en) System, method and apparatus for testing server functionality
CN113485942A (en) Automatic testing method and device based on independent module
CN113360182B (en) Method and apparatus for system performance diagnostics
CN113656046A (en) Application deployment method and device
CN109151007B (en) Data processing method, core server and transmission server for application scheduling

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