Testing Method, Device, Equipment and Storage Medium of Software
By obtaining time information and database rules in the quantitative strategy trading program, aligning and calibration of historical data, and calculating transaction results using the test model, the problems of long software testing cycles and difficult to trace back are solved, and more efficient software testing and optimization are achieved.
Patent Information
- Application Number
- CN202111535031.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, the software testing cycle of quantitative strategy trading programs is long and difficult to backtrack, resulting in software tools that can only be backtested through actual transactions, which is inefficient.
By obtaining time information, selecting calculation rules in the database, performing time alignment and calibration of discrete historical data, and using a pre-trained test model to calculate transaction test results, including monitoring parameters and early warning thresholds to calibrate risk data.
It improves the controllability, accuracy and reliability of software testing, reduces the dependence on actual transactions, and enhances the stability and efficiency of software operations.
Smart Images

Figure CN114281686B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and particularly to a software testing method, device, medium and equipment. Background Art
[0002] Currently, there are diverse fixed-income business products, and there are complex trading relationships among various financial products. The quantitative strategy trading program is a product developed to assist traders in automated trading, and the quantitative strategy trading program often contains many strategy parameters. Continuous parameter tuning is required to maximize the calculation accuracy of the quantitative strategy trading program and avoid trading losses caused by incorrect parameter configurations.
[0003] However, in the prior art, there is a lack of effective backtesting means for quantitative strategy trading programs, resulting in that new quantitative strategy trading program software tools can only be backtested through actual trading. Therefore, there are problems such as a long software testing cycle and difficulty in backtracking. Summary of the Invention
[0004] The main object of this application is to provide a software testing method, device, medium and equipment, aiming to solve the technical problems of a long testing cycle and difficulty in backtracking of trading software in the prior art.
[0005] To achieve the above object of the invention, this application proposes a software testing method, and the method includes:
[0006] In response to a software test instruction, obtain time information, and select a pre-stored calculation rule in the database according to the time information;
[0007] Obtain discrete historical data according to the time information, and perform time alignment on the discrete historical data to obtain a historical volatility dataset;
[0008] Parse initial transaction data from the software test instruction, and calibrate the initial transaction data according to the historical volatility dataset to obtain target transaction data;
[0009] Based on a pre-trained test model, calculate a trading test result corresponding to the target transaction data through the calculation rule.
[0010] Further, the calibrating the initial transaction data according to the historical volatility dataset to obtain target transaction data includes:
[0011] Calculate a monitoring parameter according to the historical volatility dataset;
[0012] Calculate the difference between the initial transaction data and the monitoring parameter;
[0013] Obtain the warning threshold parameter, and when the absolute value of the difference is greater than the warning threshold parameter, mark the initial transaction data as risk data;
[0014] Calibrate the risk data and remove the risk mark to obtain the target transaction data.
[0015] Further, the time alignment of the discrete historical data includes:
[0016] Obtain the log information of each piece of discrete historical data;
[0017] Calibrate reference points in each piece of log information at a preset time interval;
[0018] Read the time corresponding to each reference point, and align the reference points with the same time in each piece of discrete historical data.
[0019] Further, the obtaining of discrete historical data according to the time information includes:
[0020] When a market custom instruction is obtained, obtain the custom data corresponding to the time information in the market custom instruction, and use the custom data as the discrete historical data;
[0021] When no market custom instruction is obtained, obtain the discrete historical data from the database.
[0022] Further, the responding to the software test instruction, obtaining time information, and selecting a pre-stored calculation rule from the database according to the time information includes:
[0023] Identify the number of time information included in the received software test instruction;
[0024] According to the number of time information, establish an independent test instance for each piece of time information;
[0025] According to the time information, select the calculation rule for each test instance respectively.
[0026] Further, before obtaining the discrete historical data according to the time information, it further includes:
[0027] Identify whether the discrete historical data corresponding to the time information in the database is empty;
[0028] If so, generate a first time range corresponding to the time information, obtain several groups of historical data within the first time range according to a preset obtaining rule, and combine the historical data to obtain the discrete historical data.
[0029] Further, selecting the calculation rule for each of the test instances according to the time information includes:
[0030] Setting a buried point mark for each of the test instances;
[0031] Obtaining the calculation rule corresponding to the time information of the test instance, and triggering the buried point mark when the calculation rule is obtained, generating and storing the buried point data corresponding to the test instance;
[0032] After calculating the transaction test result corresponding to the target transaction data through the calculation rule, it further includes:
[0033] When the transaction test result is abnormal, verifying whether the test instance is abnormal through the buried point data.
[0034] This application also proposes a software test device, including:
[0035] An information acquisition module, configured to acquire time information in response to a software test instruction, and select a pre-stored calculation rule in a database according to the time information;
[0036] A data alignment module, configured to acquire discrete historical data according to the time information, and perform time alignment on the discrete historical data to obtain a historical fluctuation data set;
[0037] A data calibration module, configured to parse initial transaction data from the software test instruction, and calibrate the initial transaction data according to the historical fluctuation data set to obtain target transaction data;
[0038] A transaction test module, configured to calculate a transaction test result corresponding to the target transaction data through the calculation rule based on a pre-trained test model.
[0039] This application also proposes a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method described in any one of the above when executing the computer program.
[0040] This application also proposes a computer-readable storage medium, on which a computer program is stored, and the computer program implements the steps of the method described in any one of the above when executed by a processor.
[0041] The testing method, device, medium and equipment for the software of the present application receive a software testing instruction containing time information and retrieve the corresponding calculation rules from the database, so as to test transaction data under different dates and different rules, improving the controllability and effectiveness of the testing process; by obtaining the corresponding discrete historical data according to the time information, the accuracy of the testing is improved, and by performing time alignment on the discrete historical data, a historical volatility dataset that can more comprehensively reflect the market conditions under the time information is obtained for data reference and calibration; by calibrating the initial transaction data in the software testing instruction with the historical volatility dataset, target transaction data that conforms to the historical market conditions is obtained, thereby improving the reliability and authenticity of the testing; by obtaining the transaction test results through the test model, it is convenient to evaluate the state of the software under test according to the transaction test results, so as to maintain or optimize the software under test, avoiding the problem that the software can only be maintained during the actual transaction process and improving the stability of the software operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic flow chart of the testing method for the software according to an embodiment of the present application;
[0043] Figure 2 is a schematic structural block diagram of the testing device for the software according to an embodiment of the present application;
[0044] Figure 3 is a schematic structural block diagram of a computer device according to an embodiment of the present application.
[0045] The realization, functional features and advantages of the object of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] In order to make the object, technical solution and advantages of the present application more clear, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] Referring to Figure 1 , in order to achieve the above-mentioned invention object, this embodiment proposes a testing method for software, and the method includes:
[0048] S1: In response to a software testing instruction, obtain time information and select a pre-stored calculation rule from the database according to the time information;
[0049] S2: Obtain discrete historical data according to the time information and perform time alignment on the discrete historical data to obtain a historical volatility dataset;
[0050] S3: Parse the initial transaction data from the software test instruction, and calibrate the initial transaction data according to the historical volatility dataset to obtain the target transaction data;
[0051] S4: Based on the pre-trained test model, calculate the transaction test result corresponding to the target transaction data through the calculation rule.
[0052] In this embodiment, by receiving a software test instruction containing time information and retrieving the corresponding calculation rule from the database, it is convenient to test transaction data under different dates and different rules, improving the controllability and effectiveness of the test process; by obtaining the corresponding discrete historical data according to the time information, the accuracy of the test is improved, and by performing time alignment on the discrete historical data, a historical volatility dataset that can more comprehensively reflect the market condition under this time information is obtained, facilitating data reference and calibration; by calibrating the initial transaction data in the software test instruction with the historical volatility dataset, the target transaction data that conforms to the historical market conditions is obtained, thereby improving the reliability and authenticity of the test; by obtaining the transaction test result through the test model, it is convenient to evaluate the state of the software under test according to the transaction test result, so as to maintain or optimize the software under test, avoiding the problem that the software can only be maintained during the actual trading process and improving the stability of software operation.
[0053] For step S1, this embodiment is applied to software test processing, especially in the test application of securities trading software. It can select and match the calculation rules in the database based on artificial intelligence technology and calculate the corresponding transaction test results. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. The above software can be a financial trading software. When the user needs to test the accuracy of the software, the current trading day can be specified as any day in history, that is, a software test instruction containing time information is sent to the software. The above time information is usually date information containing year, month and day; the above calculation rules can include all the processing logics related to the trading days corresponding to this time information in the strategy trading verification framework. In this embodiment, by receiving a software test instruction containing time information and retrieving the corresponding calculation rule from the database, it is convenient to test transaction data under different dates and different rules, improving the controllability and effectiveness of the test process.
[0054] For step S2, due to the influence of the market environment and the trading behaviors of different users, it can be considered that the market information of each day is different. Therefore, the same historical data cannot be used to calculate the test results for different trading dates. In a specific implementation, the discrete historical data may include order prices, transaction prices, material prices, etc. The above discrete historical data can be obtained from the trading big database, and then the obtained discrete historical data is time-aligned through a playback tool, so that the order prices, transaction prices, material prices, etc. corresponding to different moments can be read simultaneously in the same time coordinate system, and then a historical volatility dataset that can reflect the historical market state on that trading day is obtained. In this embodiment, by obtaining the corresponding discrete historical data according to the time information, the accuracy of the test is improved, and by time-aligning the discrete historical data, a historical volatility dataset that can more comprehensively reflect the market state under this time information is obtained, which is convenient for data reference and calibration.
[0055] For step S3, since the strategy trading depends on the reference quotation, and the reference quotations at different times often vary greatly. To improve the reliability of the data during the test, in this embodiment, the data is calibrated through the historical volatility dataset. Specifically, assume that under the current simulated trading day, the highest transaction price per piece in the historical volatility dataset is 3,200, and the lowest transaction price per piece is 1,500. If there are transaction prices per piece of 600 and 4,800 in the initial transaction data of the software test instruction received, it is obviously not in line with the historical market conditions. Therefore, at this time, it is necessary to calibrate such initial transaction data that is unreasonable compared with the historical volatility dataset. Specifically, the initial transaction data exceeding the range of the historical volatility dataset can be weighted, or a preset value, such as 500, can be added or subtracted from it. If the calibrated data still does not meet the requirements of the historical volatility dataset, it can be calibrated again until the requirements are met, and finally the calibrated data is used as the above target transaction data. In this embodiment, the initial transaction data in the software test instruction is calibrated through the historical volatility dataset, and the target transaction data that conforms to the historical market conditions is obtained, thereby improving the reliability and authenticity of the test.
[0056] For step S4, the above test model may include an order processing module and a transaction simulation matcher, which are used to execute a complete trading process based on the above calculation rules and target transaction data, and finally obtain transaction information such as the transaction status and transaction price of the target transaction data, that is, the above transaction test results. In this embodiment, the transaction test results are obtained through the test model, so as to evaluate the state of the software under test according to the transaction test results, thereby maintaining or optimizing the software under test, avoiding the problem that the software can only be maintained during the actual trading process, and improving the stability of the software operation.
[0057] In one embodiment, the calibration of the initial transaction data according to the historical fluctuation data set to obtain the target transaction data includes:
[0058] S31: Calculate the monitoring parameter according to the historical fluctuation data set;
[0059] S32: Calculate the difference between the initial transaction data and the monitoring parameter;
[0060] S33: Obtain the warning threshold parameter. When the absolute value of the difference is greater than the warning threshold parameter, mark the initial transaction data as risk data;
[0061] S34: Calibrate the risk data and delete the risk mark to obtain the target transaction data.
[0062] In this embodiment, by calculating the difference between the initial transaction data and the preset monitoring parameter and performing risk monitoring on the difference according to the warning threshold parameter, the risk data is calibrated, thereby improving the reliability of the test result.
[0063] For step S31, abnormal quotation monitoring needs to be performed on the data before the test, and the above monitoring parameter can be obtained by calculating the average value of the historical fluctuation data set.
[0064] For step S33, the above warning threshold parameter can be set to k times the monitoring parameter, and k < 1. Exemplarily, when the monitoring parameter is 1000 and k is equal to 0.2, the warning threshold parameter is 200, so as to set the threshold based on the monitoring parameter and improve the accuracy of abnormal data monitoring.
[0065] For step S34, the calibration of the risk data can be to replace the risk data with the corresponding warning threshold parameter, or to calculate the first average value between the initial transaction data and the monitoring parameter and determine whether the first average value is not greater than the warning threshold parameter. If it is not greater than, it is considered that the calibration is successful. If it is greater than, calculate the second average value between the first average value and the monitoring parameter again and perform risk judgment again through the warning threshold parameter until the average value obtained n times is not greater than the warning threshold parameter.
[0066] In one embodiment, the time alignment of the discrete historical data includes:
[0067] S21: Obtain the log information of each discrete historical data;
[0068] S22: Calibrate the reference point in each log information at a preset time interval;
[0069] S23: Read the time corresponding to each of the reference points, and align in time the reference points with the same time in each of the discrete historical data.
[0070] In this embodiment, the reference points are calibrated by the time interval, and time alignment is performed according to each reference point, so as to obtain the historical fluctuation data set, which improves the accuracy of data alignment and realizes the adjustment of data precision at the same time.
[0071] For step S22, in a specific implementation, the time interval can be divided according to the length of each trading day being 24 hours. The above time interval can be 1 hour or 10 minutes, and its specific length can be set according to the accuracy requirements of the user.
[0072] For step S23, taking the time interval of 1 hour as an example in this embodiment, 24 reference points corresponding to the 0 to 23 moments can be obtained for each trading day. At this time, align and merge the data with the time of 0 o'clock in each discrete historical data, then align and merge the data with the time of 1 o'clock for the next moment, and repeat the above operation until the data of 24 moments are all merged. Finally, the historical fluctuation data set corresponding to the time is obtained. At this time, query a certain moment in the historical fluctuation data set, and the trading data of each category at this moment can be obtained, so as to complete data alignment and data precision adjustment.
[0073] In one embodiment, the obtaining discrete historical data according to the time information includes:
[0074] S24: When a market custom instruction is obtained, obtain the custom data corresponding to the time information in the market custom instruction, and use the custom data as the discrete historical data;
[0075] S25: When no market custom instruction is obtained, obtain the discrete historical data in the database.
[0076] In this embodiment, by judging the market custom instruction and using the corresponding custom data as the discrete historical data when the market custom instruction is obtained, the controllability of the test is improved.
[0077] For step S24, in a specific implementation, although the probability of extreme scenarios appearing in the historical market conditions is small, the software still needs to test extreme scenarios to improve the risk resistance of the software. Custom market conditions edited manually can be added to help verify the processing effect of the special extreme scenario strategy module.
[0078] In one embodiment, the responding to the software test instruction, obtaining the time information, and selecting a pre-stored calculation rule in the database according to the time information includes:
[0079] S11: Identify the number of time information included in the received software test instruction;
[0080] S12: According to the number of the time information, respectively establish an independent test instance for each piece of the time information;
[0081] S13: According to the time information, respectively select the calculation rule for each of the test instances.
[0082] In this embodiment, by establishing an independent test instance for each piece of time information, parallel testing is performed, thereby improving the test efficiency.
[0083] For step S12, when the number of time information is 1, only one test instance needs to be established. When the number of time information is greater than 1, multiple parallel test instances corresponding to the number of time information can be established. Each test instance is used to start a test process for one piece of time information, and each test instance is tested according to the corresponding time information, so as to realize that multiple market quotes are simultaneously matched and traced back according to the historical market time, thereby improving the overall test efficiency.
[0084] In one embodiment, before obtaining the discrete historical data according to the time information, it further includes:
[0085] S201: Identify whether the discrete historical data corresponding to the time information in the database is empty;
[0086] S202: If so, generate a first time range corresponding to the time information, obtain several groups of historical data within the first time range according to a preset acquisition rule, and combine the historical data to obtain the discrete historical data.
[0087] In this embodiment, when the discrete historical data corresponding to the time information is empty, data selection and filling are performed based on the time information, so as to avoid the problem that software testing cannot be performed due to data loss.
[0088] For step S202, if the data corresponding to a certain time information in the database is lost, it is recognized that the discrete historical data corresponding to the time information is empty. Since the data fluctuations in the trading market are relatively small in the case of adjacent time, in order to avoid the interruption of software testing caused by data loss, this embodiment uses the data of the dates near the time information for filling. Specifically, the time information can be used as a benchmark, and the k days before and after it are used as the first time range. Different groups of historical data are randomly selected within the first time range, and the groups of historical data are combined as the discrete historical data of the above time information; where k is a positive integer. In order to avoid too large an error in data due to too large a first time range, k can be taken as 2 in this embodiment.
[0089] In one embodiment, selecting the calculation rule S13 for each of the test instances according to the time information includes:
[0090] S131: Set a buried point mark for each of the test instances respectively;
[0091] S132: Obtain the calculation rule corresponding to the time information of the test instance, and when the calculation rule is obtained, trigger the buried point mark to generate and store the buried point data corresponding to the test instance;
[0092] After calculating the transaction test result corresponding to the target transaction data through the calculation rule, it further includes:
[0093] S41: When the transaction test result is abnormal, verify whether the test instance is abnormal through the buried point data.
[0094] In this embodiment, each test instance is buried point, which is convenient for data traceability in case of subsequent abnormalities and improves the controllability of the test.
[0095] For step S132, the above-mentioned buried point data includes the number, test environment and test code of the test instance. When the calculation rule is obtained, it is considered that the test instance officially enters the parallel test stage. At this time, the buried point mark is triggered to generate and store the buried point data for tracing its test environment and code.
[0096] Refer to Figure 2 , this application also proposes a test device for software, including:
[0097] An information acquisition module 100, configured to obtain time information in response to a software test instruction, and select a pre-stored calculation rule in a database according to the time information;
[0098] A data alignment module 200, configured to obtain discrete historical data according to the time information and perform time alignment on the discrete historical data to obtain a historical fluctuation data set;
[0099] A data calibration module 300, configured to parse initial transaction data from the software test instruction and calibrate the initial transaction data according to the historical fluctuation data set to obtain target transaction data;
[0100] A transaction test module 400, configured to calculate a transaction test result corresponding to the target transaction data through the calculation rule based on a pre-trained test model.
[0101] In this embodiment, by receiving a software test instruction containing time information and retrieving the corresponding calculation rule from the database, it is convenient to test transaction data under different dates and different rules, improving the controllability and effectiveness of the test process; by obtaining the corresponding discrete historical data according to the time information, the accuracy of the test is improved, and by performing time alignment on the discrete historical data, a historical volatility dataset that can more comprehensively reflect the market condition under this time information is obtained, facilitating data reference and calibration; by calibrating the initial transaction data in the software test instruction with the historical volatility dataset, target transaction data that conforms to the historical market condition is obtained, thereby improving the reliability and authenticity of the test; by obtaining the transaction test result through the test model, it is convenient to evaluate the state of the software under test according to the transaction test result, thereby maintaining or optimizing the software under test, avoiding the problem that the software can only be maintained during the actual transaction process, and improving the stability of the software operation.
[0102] In one embodiment, the data calibration module 300 is specifically configured to:
[0103] Calculate a monitoring parameter according to the historical volatility dataset;
[0104] Calculate the difference between the initial transaction data and the monitoring parameter;
[0105] Obtain an early warning threshold parameter, and when the absolute value of the difference is greater than the early warning threshold parameter, mark the initial transaction data as risk data;
[0106] Calibrate the risk data and delete the risk mark to obtain the target transaction data.
[0107] In one embodiment, the data alignment module 200 is specifically configured to:
[0108] Obtain the log information of each discrete historical data;
[0109] Mark a reference point in each log information at a preset time interval;
[0110] Read the moment corresponding to each reference point, and align the reference points with the same moment in each discrete historical data in terms of time.
[0111] In one embodiment, the data alignment module 200 is specifically configured to:
[0112] When a market custom instruction is obtained, obtain the custom data corresponding to the time information in the market custom instruction, and use the custom data as the discrete historical data;
[0113] When a market custom instruction is not obtained, obtain the discrete historical data from the database.
[0114] In one embodiment, the information acquisition module 100 is specifically configured to:
[0115] Identify the number of time information included in the received software test instruction;
[0116] According to the number of the time information, establish an independent test instance for each of the time information;
[0117] According to the time information, select the calculation rule for each of the test instances respectively.
[0118] In one embodiment, the data alignment module 200 is further configured to:
[0119] Identify whether the discrete historical data corresponding to the time information in the database is empty;
[0120] If so, generate a first time range corresponding to the time information, obtain a plurality of groups of historical data within the first time range according to a preset acquisition rule, and combine the historical data to obtain the discrete historical data.
[0121] In one embodiment, the information acquisition module 100 is specifically configured to:
[0122] Set a buried point mark for each of the test instances respectively;
[0123] Obtain a calculation rule corresponding to the time information of the test instance, and when the calculation rule is obtained, trigger the buried point mark to generate and store buried point data corresponding to the test instance;
[0124] The transaction test module 400 is further configured to:
[0125] When the transaction test result is abnormal, verify whether the test instance is abnormal through the buried point data.
[0126] Refer to Figure 3 , in the embodiment of the present application, a computer device is further provided. The computer device may be a server, and its internal structure may be as Figure 3As shown. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Among them, the processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the test method of the software. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a test method for software. The test method for the software includes: in response to a software test instruction, obtaining time information, and selecting a pre-stored calculation rule in the database according to the time information; obtaining discrete historical data according to the time information, and performing time alignment on the discrete historical data to obtain a historical fluctuation data set; parsing initial transaction data from the software test instruction, and calibrating the initial transaction data according to the historical fluctuation data set to obtain target transaction data; based on a pre-trained test model, calculating a transaction test result corresponding to the target transaction data through the calculation rule.
[0127] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a test method for software, including the steps of: in response to a software test instruction, obtaining time information, and selecting a pre-stored calculation rule in the database according to the time information; obtaining discrete historical data according to the time information, and performing time alignment on the discrete historical data to obtain a historical fluctuation data set; parsing initial transaction data from the software test instruction, and calibrating the initial transaction data according to the historical fluctuation data set to obtain target transaction data; based on a pre-trained test model, calculating a transaction test result corresponding to the target transaction data through the calculation rule.
[0128] The testing method for the above-executed software receives a software testing instruction containing time information and retrieves the corresponding calculation rules from the database to test transaction data under different dates and different rules, improving the controllability and effectiveness of the testing process; obtains the corresponding discrete historical data according to the time information, improving the accuracy of the testing, and obtains a historical volatility dataset that can comprehensively reflect the market condition under this time information through time alignment of the discrete historical data for data reference and calibration; calibrates the initial transaction data in the software testing instruction through the historical volatility dataset to obtain target transaction data that conforms to the historical market conditions, thereby improving the reliability and authenticity of the testing; obtains the transaction test results through the test model to evaluate the state of the software under test according to the transaction test results, so as to maintain or optimize the software under test, avoiding the problem that the software can only be maintained during the actual transaction process and improving the stability of the software operation.
[0129] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium provided in the present application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0130] It should be noted that in this text, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, apparatus, article or method comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, apparatus, article or method comprising such element.
[0131] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A software testing method, characterized in that The method includes: In response to a software test instruction, obtain time information, and select a pre-stored calculation rule in a database according to the time information; Obtain discrete historical data according to the time information, and perform time alignment on the discrete historical data to obtain a historical fluctuation data set; Parse initial transaction data from the software test instruction, and calibrate the initial transaction data according to the historical fluctuation data set to obtain target transaction data; Based on a pre-trained test model, calculate a transaction test result corresponding to the target transaction data through the calculation rule; The calibrating the initial transaction data according to the historical fluctuation data set to obtain target transaction data includes: Calculate a monitoring parameter according to the historical fluctuation data set; Calculate the difference between the initial transaction data and the monitoring parameter; Obtain an early warning threshold parameter, and when the absolute value of the difference is greater than the early warning threshold parameter, mark the initial transaction data as risk data; Calibrate the risk data and delete the risk mark to obtain the target transaction data; The performing time alignment on the discrete historical data includes: Obtain the log information of each discrete historical data; Calibrate a reference point in each log information at a preset time interval; Read the moment corresponding to each reference point, and perform time alignment on the reference points with the same moment in each discrete historical data; The obtaining discrete historical data according to the time information includes: When a market custom instruction is obtained, obtain custom data corresponding to the time information in the market custom instruction, and use the custom data as the discrete historical data; When a market custom instruction is not obtained, obtain the discrete historical data in the database; The responding to a software test instruction, obtaining time information, and selecting a pre-stored calculation rule in a database according to the time information includes: Identify the number of time information included in the received software test instruction; According to the number of time information, establish an independent test instance for each time information; According to the time information, select the calculation rule for each test instance respectively.
2. The software testing method according to claim 1, wherein Before obtaining the discrete historical data according to the time information, it further includes: Identify whether the discrete historical data corresponding to the time information in the database is empty; If so, generate a first time range corresponding to the time information, obtain several groups of historical data within the first time range according to a preset obtaining rule, and combine the historical data to obtain the discrete historical data.
3. The software testing method according to claim 1, characterized in that The selecting the calculation rule for each test instance respectively according to the time information includes: Set a buried point mark for each test instance respectively; Obtain a calculation rule corresponding to the time information of the test instance, and when the calculation rule is obtained, trigger the buried point mark to generate and store buried point data corresponding to the test instance; After calculating the transaction test result corresponding to the target transaction data through the calculation rule, it further includes: When the transaction test result is abnormal, verify whether the test instance is abnormal through the buried point data.
4. A testing device for software, characterized in that, Including: An information acquisition module, configured to respond to a software test instruction, acquire time information, and select a pre-stored calculation rule in a database according to the time information; A data alignment module, configured to acquire discrete historical data according to the time information, and perform time alignment on the discrete historical data to obtain a historical fluctuation data set; A data calibration module, configured to parse initial transaction data from the software test instruction, and calibrate the initial transaction data according to the historical fluctuation data set to obtain target transaction data; A transaction test module, configured to calculate a transaction test result corresponding to the target transaction data based on a pre-trained test model through the calculation rule; The calibrating the initial transaction data according to the historical fluctuation data set to obtain target transaction data includes: Calculating a monitoring parameter according to the historical fluctuation data set; Calculating a difference between the initial transaction data and the monitoring parameter; Obtaining an early warning threshold parameter, and when the absolute value of the difference is greater than the early warning threshold parameter, marking the initial transaction data as risk data; Calibrating the risk data and deleting the risk mark to obtain the target transaction data; the performing time alignment on the discrete historical data includes: Obtaining log information of each of the discrete historical data; Calibrating a reference point in each of the log information at a preset time interval; Reading a moment corresponding to each of the reference points, and performing time alignment on the reference points with the same moment in each of the discrete historical data; the acquiring discrete historical data according to the time information includes: When a market custom instruction is acquired, acquiring custom data corresponding to the time information in the market custom instruction, and using the custom data as the discrete historical data; When the market custom instruction is not acquired, acquiring the discrete historical data in the database; the responding to a software test instruction, acquiring time information, and selecting a pre-stored calculation rule in a database according to the time information includes: Identifying the number of time information included in the received software test instruction; Establishing an independent test instance for each of the time information according to the number of the time information; Selecting the calculation rule for each of the test instances according to the time information.
5. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Test method and device and readable storage medium
CN110334019A
System testing method and device, computer equipment and storage medium
CN110413507A