CN116340172A - Data collection method and device based on test scene and test case detection method - Google Patents

Data collection method and device based on test scene and test case detection method Download PDF

Info

Publication number
CN116340172A
CN116340172A CN202310323526.2A CN202310323526A CN116340172A CN 116340172 A CN116340172 A CN 116340172A CN 202310323526 A CN202310323526 A CN 202310323526A CN 116340172 A CN116340172 A CN 116340172A
Authority
CN
China
Prior art keywords
test
data
scene
test data
scenes
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.)
Pending
Application number
CN202310323526.2A
Other languages
Chinese (zh)
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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202310323526.2A priority Critical patent/CN116340172A/en
Publication of CN116340172A publication Critical patent/CN116340172A/en
Pending legal-status Critical Current

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/368Test management for test version control, e.g. updating test cases to a new software version
    • 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/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to the field of computer technology, and in particular relates to a data collection method and device based on a test scene, a test case detection method, a detection device, electronic equipment and a storage medium. The specific implementation scheme is as follows: acquiring test data of different sources; preprocessing test data; classifying the test data of different data types based on the decision tree rules, classifying each test data into a corresponding test scene, and generating scene data according to a rule expression corresponding to the test scene; and combining one or more scene data according to the test scenes, and storing the combined scene data into a subtest scene database corresponding to the scene database. The automatic collection of test data is realized, and the timeliness of the data is ensured; in addition, the test data of different types are classified, corresponding test scenes are associated, and in the test process, the test data in the corresponding sub-test scene database can be directly called according to the test scenes, so that the test efficiency is improved.

Description

Data collection method and device based on test scene and test case detection method
Technical Field
The disclosure relates to the field of computer technology, and in particular relates to a data collection method and device based on a test scene, a test case detection method, a detection device, electronic equipment and a storage medium.
Background
The test data used in the current test scenario is configuration data obtained by determining a mapping relationship between simulation data (the simulation data includes simulation data for data generated by a target user in a preset production environment) and feature data (the feature data includes definition data for defining the simulation data); determining parsed configuration data in response to a received request for generating test data; based on the analyzed configuration data, acquiring a feature construction rule corresponding to the feature data from a feature database; determining construction data based on the feature construction rules and the parsed configuration data; and generating test data corresponding to the preset production environment according to the construction data. On one hand, the feature database cannot automatically collect test data for automatic updating, and if the feature database is not updated in time, the timeliness and the accuracy of generating the test data cannot be ensured; on the other hand, the collected data is not related to the corresponding test scene, the scene business of the data cannot be verified, and the test efficiency is reduced when the data is used.
Disclosure of Invention
The disclosure provides a data collection method and device based on a test scene, a test case detection method, a detection device, electronic equipment and a storage medium.
According to a first aspect of the present disclosure, there is provided a data collection method based on a test scenario, including:
acquiring test data of different sources;
preprocessing the test data;
classifying the test data with different data types based on decision tree rules, classifying each test data into a corresponding test scene, and generating scene data according to rule expressions corresponding to the test scenes;
and combining one or more scene data according to the test scenes, and storing the combined scene data into a subtest scene database corresponding to the scene database.
Optionally, the preprocessing the test data includes:
selecting a corresponding extraction script based on the data type of the test data, and extracting a corresponding value of the test data according to a field;
and cleaning the data of the corresponding value based on a preset denoising rule.
Optionally, the classifying the test data of different data types based on the decision tree rule, classifying each test data into a corresponding test scene, and generating scene data according to a rule expression corresponding to the test scene includes:
classifying the test data according to the data types corresponding to the test data;
categorizing the test data of each heap into a corresponding test scenario based on a length of the test data;
and generating the scene data according to the rule expression corresponding to the test scene.
Optionally, before the combining one or more of the scene data according to the test scene and storing the combined scene data in the subtest scene database corresponding to the scene database, the method further includes:
confirming whether the test data are successfully classified into the corresponding test scenes or not;
responding to the successful classification of the test data, and outputting a first check result which indicates that the automatic data warehousing is successful;
and responding to the failure of classifying the test data, outputting a second check result which indicates that the automatic data warehouse-in fails, and updating the rule of the decision tree.
According to a second aspect of the present disclosure, there is provided a test case detection method, further including:
acquiring a plurality of test cases written by a tester;
automatically detecting whether a plurality of test cases cover all the test scenes in the scene database according to any one of the technical schemes;
and outputting a detection result representing the abnormality of the test case in response to the test case not being capable of covering a plurality of the test scenes in the scene database.
Optionally, the data processing module includes:
a data extraction unit configured to select a corresponding extraction script based on a data type of the test data, and extract a corresponding value of the test data by field;
and the data cleaning unit is configured to perform data cleaning on the corresponding values based on a preset denoising rule.
Optionally, the data classifying module includes:
the first classification unit is configured to classify the test data by a pile according to the data type corresponding to the test data;
a second classification unit configured to classify the test data of each heap into the corresponding test scenario based on a length of the test data;
and the scene data generating unit is configured to generate the scene data according to the rule expression corresponding to the test scene.
Optionally, the method further comprises:
the warehousing checking module is configured to confirm whether the test data is successfully classified into the corresponding test scene;
the warehouse-in checking module responds to the successful classification of the test data and outputs a first checking result which indicates that the automatic warehouse-in of the data is successful;
the warehousing inspection module responds to the failure of the classification of the test data and outputs a second inspection result which indicates the failure of automatic data warehousing;
an updating module configured to update the decision tree rule based on the second inspection result.
According to a third aspect of the present disclosure, there is provided a test scenario-based data collection apparatus comprising:
the data acquisition module is configured to acquire test data of different sources;
a data processing module configured to pre-process the test data;
the data classifying module is configured to classify the test data of different data types based on decision tree rules, classify each test data into a corresponding test scene, and generate scene data according to a rule expression corresponding to the test scene;
and the data storage module is configured to combine one or more of the scene data according to the test scenes and store the combined scene data into a subtest scene database corresponding to the scene database.
According to a fourth aspect of the present disclosure, there is provided a test case detection apparatus including:
the test case acquisition module is configured to acquire a plurality of test cases written by a tester;
the detection module is configured to automatically detect whether a plurality of test cases cover all the test scenes in the scene database in any one of the technical schemes;
the detection module outputs a detection result representing that the test case is abnormal in response to the fact that the test case cannot cover a plurality of test scenes in the scene database.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the above claims.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to any one of the above-mentioned technical solutions.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method according to any of the above-mentioned technical solutions.
The disclosure provides a data collection method and device based on a test scene, a test case detection method, a detection device, electronic equipment and a storage medium, wherein test data are automatically collected, real-time update of a scene database is realized, and timeliness of the data is ensured; in addition, the test data of different types are classified, corresponding test scenes are associated, the test data under the same test scene are combined and stored in the same sub-test scene database, a service chain corresponding to a plurality of test scenes is formed, and in the test process, the test data in the corresponding sub-test scene database can be directly called according to the test scenes, so that the test efficiency is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic step diagram of a data collection method in an embodiment of the present disclosure;
FIG. 2 is a flow diagram of a decision tree algorithm in an embodiment of the present disclosure;
FIG. 3 is a flow chart of an acknowledgment data binning in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of steps of a test case detection method in an embodiment of the present disclosure;
FIG. 5 is a functional block diagram of a first data collection device in an embodiment of the present disclosure;
FIG. 6 is a functional block diagram of a second data collection device in an embodiment of the present disclosure;
FIG. 7 is a functional block diagram of a test case detection apparatus in an embodiment of the present disclosure;
FIG. 8 is a block diagram of a method of implementing data collection in an embodiment of the present disclosure;
FIG. 9 is a block diagram of implementing test case detection in an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Aiming at the technical problems that test data cannot be automatically collected to update a database and the scene business of the test data cannot be verified in the prior art, the disclosure provides a data collection method based on a test scene, as shown in fig. 1, comprising the following steps:
step S101, test data of different sources is obtained. The manner in which test data is obtained supports both automatic and manual supplementation. The sources of the test data comprise automatically collecting transaction messages in logs, database records, related test documents in test flows and the like, and simultaneously supporting testers to manually fill special channel test data or directly import related files. The collection frequency is real-time, various business scene data are continuously supplemented, and timeliness of the test data is ensured.
Step S102, preprocessing the test data. Since some of the test data obtained through various channels are erroneous, repetitive, and some data are conflicting, these are undesirable data. Therefore, after the data of different channels are obtained, the data needs to be subjected to pretreatment such as data cleaning and denoising.
Step S103, classifying the test data of different data types based on the decision tree rules, classifying each test data into a corresponding test scene, and generating scene data according to a rule expression corresponding to the test scene. For example, the test data includes different data types such as numbers, chinese, english, special characters, etc., the test data only including the numbers can be classified into class 1, the test data of the Chinese is classified into class 2, the test data with the special characters is classified into class 3, and then the test data is associated with the corresponding test scene based on the characteristics of the test data in each class, for example, the identification card number of the test data identified as 18 digits, and the data can be associated with the test scene of financial product transaction.
Step S104, one or more scene data are combined according to the test scenes and stored in a subtest scene database corresponding to the scene database. The test data is usually not used alone, often a plurality of test data are used in combination, for example, under the transaction scene of a financial product, the test data such as an identification card number, a debit card number, a password and the like are required to be used, and the identification card number, the debit card number and the password can be combined and stored in a subtest scene database corresponding to the transaction scene of the financial product. In the testing process, the test data required by the transaction scene of the financial product can be directly obtained from the sub-test scene database, so that the use of a tester is facilitated, and the testing efficiency is improved.
As an optional embodiment, the preprocessing of the test data in step S102 includes:
and selecting a corresponding extraction script based on the data type of the test data, and extracting a corresponding value of the test data according to the field. Firstly, extracting fields of various collected test data, writing different extraction scripts in advance aiming at different channels, extracting corresponding values according to the fields, such as SQL (Structured Query Language) script adopted by a database, file stream reading adopted by a test document, xml parsing adopted by a transaction message and the like.
And cleaning data based on the corresponding value of the preset denoising rule. And (3) cleaning the extracted value, such as scrambling codes or direct cleaning of special characters, so as to ensure the quality of the test data.
As an optional implementation manner, step S103 performs a classification process on test data of different data types based on a decision tree rule, classifies each test data into a corresponding test scene, and generates scene data according to a rule expression corresponding to the test scene, where the step includes:
and classifying the test data according to the data types corresponding to the test data. As shown in fig. 2, the decision tree algorithm flow classifies the test data by pile according to a preset decision tree rule, for example, the test data is equally piled according to the length and character type of the test data. The test data comprises different data types such as numbers, chinese, english, special characters and the like, the test data only comprising the numbers and the English can be classified into a class 1, the test data of the Chinese is classified into a class 2, and the test data with the special characters is classified into a class 3.
The test data for each heap is categorized into a corresponding test scenario based on the length of the test data. After being piled based on data types, the data is classified according to the length of each data pile, for example, when the data length is four bits, the data is classified into a system mark, a code and the like; when the data length is eight bits, classifying the data into a system date, a password and the like; when the data length is eighteen digits, the data is classified as an identity card number, a serial number and the like.
And generating scene data according to the rule expression corresponding to the test scene. For example, the conventional effective identity card class contains 18 digits, 18 digit combinations are judged through decision tree rules, and the beginning region code and the intermediate date are verified to be correct, and meanwhile, the rules are stored according to a data head name-regular expression, for example, the conventional effective identity card comprises six digits of address codes, eight digits of birth date codes, three digits of sequence codes and one digit of check codes. Through the classification, the test data are stored according to the classification of the test scene, and are stored completely according to the regular expression. The different classes of test data are stored in a classified manner (not only correct scenes are stored, but also error scenes are included), and finally scene data completely corresponding to a certain test scene are generated.
As an optional implementation manner, before combining one or more scenario data according to the test scenario and storing the combined scenario data in the subtest scenario database corresponding to the scenario database, step S104 further includes:
confirming whether the test data is successfully classified into the corresponding test scene: responding to the success of the classification of the test data, and outputting a first check result which indicates that the automatic data warehousing is successful; and responding to the failure of classifying the test data, outputting a second check result which indicates the failure of automatic data warehousing, and updating the rule of the decision tree.
As shown in fig. 8, after classifying the data, in order to ensure that the scene data is accurate after classifying, a confirmation operation is performed before the data is put in storage, and the data which is successfully classified is automatically confirmed and the validity of the data is verified. Specifically, as shown in fig. 3, for special data which cannot be determined by the decision tree rule, a tester needs to manually determine and put the special data into a warehouse, such as a newly added complex character set, an ultra-long combined field and the like, and after the warehouse is manually confirmed, new rules are automatically supplemented based on the manually put rules, the decision tree rule is updated, the decision tree rule is continuously updated, and the accuracy of automatic classification of the data is ensured.
The present disclosure also provides a test case detection method, as shown in fig. 4, further including:
step S401, a plurality of test cases written by a tester are obtained;
step S402, automatically detecting whether a plurality of test cases cover all test scenes in a scene database;
step S403, in response to the test case failing to cover the plurality of test scenes in the scene database, outputting a detection result indicating that the test case is abnormal.
In this embodiment, after the test data of each channel is collected by the data collection method in the above embodiment, the test data is categorized, and one or more test data are combined and associated to the test scenario corresponding to the scenario database. The case test can be performed through the scene database, whether the test case written by the tester is abnormal or not is checked, for example, whether the test case is wrong or missing is caused, and the automatic detection of the test case is realized.
The present disclosure provides a data collection device based on a test scenario, as shown in fig. 5, including:
the data acquisition module 501 is configured to acquire test data from different sources. The manner in which test data is obtained supports both automatic and manual supplementation. The sources of the test data comprise automatically collecting transaction messages in logs, database records, related test documents in test flows and the like, and simultaneously supporting testers to manually fill special channel test data or directly import related files. The collection frequency is real-time, various business scene data are continuously supplemented, and timeliness of the test data is ensured.
The data processing module 502 is configured to pre-process the test data. Since some of the test data obtained through various channels are erroneous, repetitive, and some data are conflicting, these are undesirable data. Therefore, after the data of different channels are obtained, the data needs to be subjected to pretreatment such as data cleaning and denoising.
The data classifying module 503 is configured to classify the test data of different data types based on the rule of the decision tree, classify each test data into a corresponding test scene, and generate scene data according to the rule expression corresponding to the test scene. For example, the test data includes different data types such as numbers, chinese, english, special characters, etc., the test data only including the numbers can be classified into class 1, the test data of the Chinese is classified into class 2, the test data with the special characters is classified into class 3, and then the test data is associated with the corresponding test scene based on the characteristics of the test data in each class, for example, the identification card number of the test data identified as 18 digits, and the data can be associated with the test scene of financial product transaction.
The data storage module 504 is configured to combine one or more scenario data according to the test scenario and store the combined scenario data in a subtest scenario database corresponding to the scenario database. The test data is usually not used alone, often a plurality of test data are used in combination, for example, under the transaction scene of a financial product, the test data such as an identification card number, a debit card number, a password and the like are required to be used, and the identification card number, the debit card number and the password can be combined and stored in a subtest scene database corresponding to the transaction scene of the financial product. In the testing process, the test data required by the transaction scene of the financial product can be directly obtained from the sub-test scene database, so that the use of a tester is facilitated, and the testing efficiency is improved.
As an alternative embodiment, the data processing module 502 includes:
and the data extraction unit is configured to select a corresponding extraction script based on the data type of the test data and extract corresponding values of the test data according to the fields. Firstly, extracting fields of various collected test data, writing different extraction scripts in advance aiming at different channels, such as SQL script adopted by a database, file stream reading adopted by a test document, xml analysis adopted by a transaction message and the like, and extracting corresponding values according to the fields.
And the data cleaning unit is configured to perform data cleaning on the corresponding value based on a preset denoising rule. And (3) cleaning the extracted value, such as scrambling codes or direct cleaning of special characters, so as to ensure the quality of the test data.
As an alternative embodiment, the data categorizing module 503 includes:
the first classification unit is configured to classify the test data by pile according to the data type corresponding to the test data. As shown in fig. 2, the decision tree algorithm flow classifies the test data by pile according to a preset decision tree rule, for example, the test data is equally piled according to the length and character type of the test data. The test data comprises different data types such as numbers, chinese, english, special characters and the like, the test data only comprising the numbers and the English can be classified into a class 1, the test data of the Chinese is classified into a class 2, and the test data with the special characters is classified into a class 3.
And a second classification unit configured to classify the test data of each heap into a corresponding test scenario based on a length of the test data. After being piled based on data types, the data is classified according to the length of each data pile, for example, when the data length is four bits, the data is classified into a system mark, a code and the like; when the data length is eight bits, classifying the data into a system date, a password and the like; when the data length is eighteen digits, the data is classified as an identity card number, a serial number and the like.
And the scene data generating unit is configured to generate scene data according to the rule expression corresponding to the test scene. For example, the conventional effective identity card class contains 18 digits, 18 digit combinations are judged through decision tree rules, and the beginning region code and the intermediate date are verified to be correct, and meanwhile, the rules are stored according to a data head name-regular expression, for example, the conventional effective identity card comprises six digits of address codes, eight digits of birth date codes, three digits of sequence codes and one digit of check codes. Through the classification, the test data are stored according to the classification of the test scene, and are stored completely according to the regular expression. The different classes of test data are stored in a classified manner (not only correct scenes are stored, but also error scenes are included), and finally scene data completely corresponding to a certain test scene are generated.
As an alternative embodiment, as shown in fig. 6, the data collecting apparatus further includes:
the binning checking module 505 is configured to confirm whether the test data is successfully categorized into the corresponding test scenario: the warehousing inspection module responds to the success of the classification of the test data and outputs a first inspection result which indicates the success of automatic warehousing of the data; the warehousing inspection module responds to the failure of the classification of the test data and outputs a second inspection result which indicates the failure of automatic warehousing of the data; an updating module 506 configured to update the decision tree rule based on the second inspection result.
As shown in fig. 3, in order to ensure that the scene data after classification is accurate, a confirmation operation is performed before data storage, and data which is successfully classified is automatically confirmed, and for special data which cannot be judged by the rule of the decision tree, a tester needs to manually judge and store the data, such as a newly added complex character set, an ultralong combined field and the like, and after the manual confirmation and storage, new rules are automatically supplemented based on the manually stored rules, the rule of the decision tree is updated, the rule of the decision tree is continuously updated, and the accuracy of automatic data classification is ensured.
The present disclosure provides a test case detection apparatus, as shown in fig. 7, including:
the test case acquisition module 701 is configured to acquire a plurality of test cases written by a tester.
The detection module 702 is configured to automatically detect whether the plurality of test cases cover all test scenarios in the scenario database.
The detection module 702 outputs a detection result representing that the test case is abnormal in response to the test case being unable to cover a plurality of test scenes in the scene database.
In this embodiment, after the test data of each channel is collected by the data collecting device in the foregoing embodiment, the test data is categorized, and one or more test data are combined and associated to a test scenario corresponding to the scenario database. The case test can be performed through the scene database, whether the test case written by the tester is abnormal or not is checked, for example, whether the test case is wrong or missing is caused, and the automatic detection of the test case is realized.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
In particular, electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
The apparatus includes a computing unit that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) or a computer program loaded from a storage unit into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the device may also be stored. The computing unit, ROM and RAM are connected to each other by a bus. An input/output (I/O) interface is also connected to the bus.
A plurality of components in a device are connected to an I/O interface, comprising: an input unit such as a keyboard, a mouse, etc.; an output unit such as various types of displays, speakers, and the like; a storage unit such as a magnetic disk, an optical disk, or the like; and communication units such as network cards, modems, wireless communication transceivers, and the like. The communication unit allows the device to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing units include, but are not limited to, central Processing Units (CPUs), graphics Processing Units (GPUs), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processors, controllers, microcontrollers, and the like. The computing unit performs the respective methods and processes described above, such as the data transmission method in the above-described embodiments. For example, in some embodiments, the data transmission method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device via the ROM and/or the communication unit. One or more steps of the data transmission method described above may be performed when the computer program is loaded into RAM and executed by a computing unit. Alternatively, in other embodiments, the computing unit may be configured to perform the data transmission method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out the data transmission methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (13)

1. A test scenario-based data collection method, comprising:
acquiring test data of different sources;
preprocessing the test data;
classifying the test data with different data types based on decision tree rules, classifying each test data into a corresponding test scene, and generating scene data according to rule expressions corresponding to the test scenes;
and combining one or more scene data according to the test scenes, and storing the combined scene data into a subtest scene database corresponding to the scene database.
2. The method of claim 1, wherein the preprocessing the test data comprises:
selecting a corresponding extraction script based on the data type of the test data, and extracting a corresponding value of the test data according to a field;
and cleaning the data of the corresponding value based on a preset denoising rule.
3. The method of claim 1, wherein the classifying the test data of different data types based on decision tree rules, classifying each of the test data into a corresponding test scenario, and generating scenario data according to a rule expression corresponding to the test scenario comprises:
classifying the test data according to the data types corresponding to the test data;
categorizing the test data of each heap into a corresponding test scenario based on a length of the test data;
and generating the scene data according to the rule expression corresponding to the test scene.
4. A method according to any one of claims 1-3, wherein before said combining one or more of said scene data according to said test scene and storing in a subtest scene database corresponding to a scene database, further comprising:
confirming whether the test data are successfully classified into the corresponding test scenes or not;
responding to the successful classification of the test data, and outputting a first check result which indicates that the automatic data warehousing is successful;
and responding to the failure of classifying the test data, outputting a second check result which indicates that the automatic data warehouse-in fails, and updating the rule of the decision tree.
5. The test case detection method is characterized by further comprising the following steps:
acquiring a plurality of test cases written by a tester;
automatically detecting whether a plurality of said test cases overlay all of said test scenes in the scene database of any of claims 1-4;
and outputting a detection result representing the abnormality of the test case in response to the test case not being capable of covering a plurality of the test scenes in the scene database.
6. A test scenario-based data collection device, comprising:
the data acquisition module is configured to acquire test data of different sources;
a data processing module configured to pre-process the test data;
the data classifying module is configured to classify the test data of different data types based on decision tree rules, classify each test data into a corresponding test scene, and generate scene data according to a rule expression corresponding to the test scene;
and the data storage module is configured to combine one or more of the scene data according to the test scenes and store the combined scene data into a subtest scene database corresponding to the scene database.
7. The apparatus of claim 6, wherein the data processing module comprises:
a data extraction unit configured to select a corresponding extraction script based on a data type of the test data, and extract a corresponding value of the test data by field;
and the data cleaning unit is configured to perform data cleaning on the corresponding values based on a preset denoising rule.
8. The apparatus of claim 6, wherein the data categorization module comprises:
the first classification unit is configured to classify the test data by a pile according to the data type corresponding to the test data;
a second classification unit configured to classify the test data of each heap into the corresponding test scenario based on a length of the test data;
and the scene data generating unit is configured to generate the scene data according to the rule expression corresponding to the test scene.
9. The apparatus of any of claims 6-8, further comprising:
the warehousing checking module is configured to confirm whether the test data is successfully classified into the corresponding test scene;
the warehouse-in checking module responds to the successful classification of the test data and outputs a first checking result which indicates that the automatic warehouse-in of the data is successful;
the warehousing inspection module responds to the failure of the classification of the test data and outputs a second inspection result which indicates the failure of automatic data warehousing;
an updating module configured to update the decision tree rule based on the second inspection result.
10. A test case detection apparatus, comprising:
the test case acquisition module is configured to acquire a plurality of test cases written by a tester;
a detection module configured to automatically detect whether a plurality of said test cases cover all of said test scenes in the scene database of any of claims 6-9;
the detection module outputs a detection result representing that the test case is abnormal in response to the fact that the test case cannot cover a plurality of test scenes in the scene database.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
CN202310323526.2A 2023-03-29 2023-03-29 Data collection method and device based on test scene and test case detection method Pending CN116340172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310323526.2A CN116340172A (en) 2023-03-29 2023-03-29 Data collection method and device based on test scene and test case detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310323526.2A CN116340172A (en) 2023-03-29 2023-03-29 Data collection method and device based on test scene and test case detection method

Publications (1)

Publication Number Publication Date
CN116340172A true CN116340172A (en) 2023-06-27

Family

ID=86875867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310323526.2A Pending CN116340172A (en) 2023-03-29 2023-03-29 Data collection method and device based on test scene and test case detection method

Country Status (1)

Country Link
CN (1) CN116340172A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117933393A (en) * 2024-01-25 2024-04-26 山东浪潮科学研究院有限公司 Unsupervised small sample content creation model training method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117933393A (en) * 2024-01-25 2024-04-26 山东浪潮科学研究院有限公司 Unsupervised small sample content creation model training method and system

Similar Documents

Publication Publication Date Title
US11650579B2 (en) Information processing device, production facility monitoring method, and computer-readable recording medium recording production facility monitoring program
CN114428677B (en) Task processing method, processing device, electronic equipment and storage medium
CN109872230B (en) Test method and device of financial data analysis system, medium and electronic equipment
CN115146282A (en) AST-based source code anomaly detection method and device
CN105630656A (en) Log model based system robustness analysis method and apparatus
CN112612664A (en) Electronic equipment testing method and device, electronic equipment and storage medium
CN113657088A (en) Interface document analysis method and device, electronic equipment and storage medium
CN116340172A (en) Data collection method and device based on test scene and test case detection method
CN115687406B (en) Sampling method, device, equipment and storage medium for call chain data
CN115470034A (en) Log analysis method, device and storage medium
CN114693116A (en) Method and device for detecting code review validity and electronic equipment
CN114546799A (en) Point burying log checking method and device, electronic equipment, storage medium and product
CN113868137A (en) Method, device and system for processing buried point data and server
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN116383834B (en) Detection method for source code vulnerability detection tool abnormality and related equipment
CN111881128B (en) Big data regression verification method and big data regression verification device
CN114528215A (en) Interactive page testing method and element template generating method and device
CN114328242A (en) Form testing method and device, electronic equipment and medium
CN114693115A (en) Method and device for detecting code review validity and electronic equipment
CN114924987A (en) Method, device, equipment and medium for detecting script input instruction
CN116089308A (en) Method, device, equipment and medium for generating software test case
CN115470149A (en) Database preprocessing function testing method, device, equipment and storage medium
CN117312123A (en) Bug processing method and device, electronic equipment and storage medium
CN115240026A (en) Training sample generation method, device, equipment, storage medium and program product
CN118069208A (en) Analysis method and related equipment for potential performance influence caused by system change

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