Statistical method and device of test case information, electronic equipment and storage medium

By obtaining and counting test case information, the low accuracy problem caused by frequent updates of test instances is solved, and automated test case information statistics are realized, improving the accuracy and efficiency of tests.

CN119759788APending Publication Date: 2025-04-04TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411954900.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Due to frequent updates of test instances, the test accuracy is low, and the existing technology lacks effective solutions.

Method used

By obtaining multiple target report files and multiple initial file test cases, the test case information is extracted according to the target parsing rules, and the information is counted to ensure the accuracy and efficiency of the test case.

Benefits of technology

It realizes automated statistics of test case information, improves the accuracy and efficiency of tests, and solves the problem of low accuracy caused by frequent updates of test instances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759788A_ABST
    Figure CN119759788A_ABST
Patent Text Reader

Abstract

The invention discloses a statistical method and device for test case information, electronic equipment and a storage medium, and the statistical method for the test case information comprises the steps: obtaining a plurality of target report files and a plurality of initial file test cases; first test case information is extracted from the multiple target report files according to the target analysis rule, and the first test case information is parameter information of the multiple initial file test cases; second test case information is determined according to the multiple initial file test cases, and the second test case information is submission information of the multiple initial file test cases; the first test case information and the second test case information are counted, a statistical result is obtained, and the statistical result is used for testing the multiple file test cases. The technical problem that in the prior art, due to the fact that test examples are updated frequently, the test accuracy is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a statistical method, device, electronic equipment and storage medium for test case information. Background Art

[0002] In the modern software development process, automated testing is one of the important means to ensure software quality. As the software development cycle continues to shorten, rapid iteration and frequent releases have become the norm, and manual testing can no longer meet the needs of efficient and comprehensive quality assurance. Therefore, automated testing tools have emerged. Cucumber, as a widely used automated testing tool, describes the expected behavior of software functions through feature files (script files) written in the Gherkin language, thereby achieving automated testing. The Gherkin language is a domain-specific language that is mainly used in behavior-driven development. Especially in the Cucumber test framework, the Gherkin language has the characteristics of natural language, which enables non-technical personnel to understand the description of test cases and facilitate communication and collaboration. However, as the scale of the project expands, the management and analysis of feature files and test results become more and more complex, bringing many challenges to the development and testing teams.

[0003] First, in a large project, the number of feature files may be very large, and the number of report files generated for each test run will also increase accordingly. Manually managing these files is not only time-consuming and labor-intensive, but also prone to errors. In addition, feature files are frequently updated, and test instances need to be parsed and updated in a timely manner to ensure the real-time and accuracy of the tests. Without an automated statistical tool, this process will be very inefficient and may even cause problems in the execution and statistics of test cases, making it impossible to ensure the quality of the software.

[0004] To address the above problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a statistical method, device, electronic device and storage medium for test case information, so as to at least solve the technical problem in the prior art that the test accuracy is low due to the frequent update of the test instance.

[0006] According to one embodiment of the present invention, a method for counting test case information is provided, comprising: obtaining multiple target report files and multiple initial file test cases; extracting first test case information from the multiple target report files according to a target parsing rule, wherein the first test case information is parameter information of the multiple initial file test cases; determining second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases; counting the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test the multiple file test cases.

[0007] Optionally, the statistical method of test case information also includes: obtaining multiple target file test cases; comparing the multiple target file test cases with multiple initial file test cases based on the target command to obtain comparison results; parsing the comparison results to obtain target test case modification information.

[0008] Optionally, the test case information statistics method further includes: the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information and the number of modified instances.

[0009] Optionally, the statistical method for test case information further includes: performing a traversal operation on the code repository to obtain a plurality of target report files and a plurality of initial file test cases.

[0010] Optionally, the statistical method for test case information further includes: extracting at least one target keyword from multiple initial file test cases based on the target grammar; and determining second test case information according to the at least one target keyword.

[0011] Optionally, the method for counting test case information also includes: merging the first test case information and the second test case information based on a target resource identifier to obtain target test case information; and counting the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0012] Optionally, the statistical method of test case information also includes: converting target test case information into target structured information; generating a target zipper table according to the target structured information; and storing the target zipper table in a target database.

[0013] According to one embodiment of the present invention, there is also provided a statistical device for test case information, comprising: a first acquisition module, used to acquire multiple target report files and multiple initial file test cases; an extraction module, used to extract first test case information from the multiple target report files according to a target parsing rule, wherein the first test case information is parameter information of the multiple initial file test cases; a determination module, used to determine second test case information based on the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases; a statistical module, used to perform statistics on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test the multiple file test cases.

[0014] Optionally, the statistical device for test case information also includes: a second acquisition module, used to acquire multiple target file test cases; a comparison module, used to compare the multiple target file test cases with the multiple initial file test cases based on the target command to obtain a comparison result; and a parsing module, used to parse the comparison result to obtain target test case modification information.

[0015] Optionally, the statistical device for test case information further includes: the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information and the number of modified instances.

[0016] Optionally, the first acquisition module includes: a traversal unit, used to perform a traversal operation on the code repository to obtain multiple target report files and multiple initial file test cases.

[0017] Optionally, the determination module includes: an extraction unit, used to extract at least one target keyword from multiple initial file test cases based on the target syntax; and a determination unit, used to determine the second test case information according to the at least one target keyword.

[0018] Optionally, the statistical module includes: a merging unit, used to merge the first test case information and the second test case information based on the target resource identifier to obtain target test case information; and a statistical unit, used to count the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0019] Optionally, the statistical module also includes: a conversion unit, used to convert the target test case information into target structured information; a generation unit, used to generate a target zipper table according to the target structured information; and a storage unit, used to store the target zipper table in a target database.

[0020] According to one embodiment of the present invention, there is also provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above-mentioned statistical methods for test case information.

[0021] According to one embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned statistical methods for test case information when running.

[0022] In an embodiment of the present invention, a plurality of target report files and a plurality of initial file test cases are obtained, and first test case information is extracted from the plurality of target report files according to a target parsing rule, wherein the first test case information is parameter information of the plurality of initial file test cases, thereby achieving the purpose of determining the second test case information according to the plurality of initial file test cases, wherein the second test case information is submission information of the plurality of initial file test cases, and achieving the technical effect of statistics on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test the plurality of file test cases, thereby solving the technical problem in the prior art of low test accuracy due to frequent updates of test instances. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0024] Figure 1 is a flow chart of a statistical method for test case information according to one embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of a test case information statistics system according to one embodiment of the present invention;

[0026] Figure 3 It is a structural block diagram of a statistical device for test case information according to one embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] According to an embodiment of the present invention, an embodiment of a statistical method for test case information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system containing at least one set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] The method embodiment may also be performed in an electronic device, a similar control device or an electronic device including a memory and a processor. Taking an electronic device as an example, the electronic device may include one or more processors and a memory for storing data. Optionally, the electronic device may also include a communication device and a display device for communication functions. It will be understood by those skilled in the art that the above structural description is only illustrative and does not limit the structure of the above electronic device. For example, the electronic device may also include more or fewer components than the above structural description, or have a configuration different from the above structural description.

[0031] The processor may include one or more processing units. For example, the processor may include a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a field-programmable gate array (FPGA), a neural-network processing unit (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, and other processing devices. Among them, different processing units may be independent components or integrated into one or more processors. In some instances, the electronic device may also include one or more processors.

[0032] The memory can be used to store computer programs, such as computer programs corresponding to the statistical methods for test case information in the embodiments of the present invention, and the processor implements the statistical methods for the test case information by running the computer programs stored in the memory. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic device via a grid. Examples of the above-mentioned grid include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0033] The communication device is used to receive or send data via a grid. The specific examples of the above-mentioned grid may include a wireless grid provided by a communication provider of the mobile terminal. In one example, the communication device includes a grid adapter (network interface controller, NIC), which can be connected to other grid devices through a base station so as to communicate with the Internet. In one example, the communication device can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly. In some embodiments of the present solution, the communication device is used to connect to mobile devices such as mobile phones and tablets, and instructions can be sent to the vehicle-mounted terminal through the mobile device.

[0034] The display device may be a touch screen type liquid crystal display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the vehicle-mounted terminal. In some embodiments, the vehicle-mounted terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contact and / or gestures on a touch-sensitive surface. The human-computer interaction function here may include a vehicle gear shifting function, and executable instructions for executing the human-computer interaction function are configured / stored in a computer program product or a readable storage medium executable by one or more processors.

[0035] There are some professional terms in the present invention, which are explained here:

[0036] 1) Cucumber: Cucumber is a behavior-driven development (BDD) tool that allows software development teams to create executable specification documents to describe software functions. By using specification documents written in natural language, Cucumber testing software can help teams perform automated testing and generate easy-to-understand test reports. Teams can use Cucumber to write test cases, run tests, analyze test results, and promptly discover and fix bugs in the software;

[0037] 2) Feature file: Feature file is a file format used to describe software functional requirements, that is, a file containing test case definitions, usually used in behavior-driven development (BDD). It is usually written in Gherkin language and contains information such as use cases, scenarios, and steps to help the team better understand and communicate software functional requirements.

[0038] 3) Gherkin syntax: Gherkin is a natural language syntax used to describe software behavior. It is a format similar to natural language, used to write test cases to describe the behavior and functionality of the software. Gherkin syntax is often used in behavior-driven development (BDD) and test-driven development (TDD), which can help teams better communicate and understand software requirements. Gherkin syntax includes keywords (such as Feature, Scenario, Given, When, Then, etc.) and parameterized functions (such as tables, data tables, etc.), making test cases easier to write and read. Test cases written in Gherkin syntax can be parsed and executed by automated testing tools (such as Cucumber), thereby achieving automated testing;

[0039] 4)Feature URI: The path of the Feature file.

[0040] Figure 1 is a flow chart of a statistical method for test case information according to one embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0041] Step S102, obtaining multiple target report files and multiple initial file test cases.

[0042] Optionally, the execution subject of this embodiment is a test case information statistics system. It should be noted that other electronic devices and processors can also serve as execution subjects, and no further limitations are given here.

[0043] Specifically, Figure 2 As shown in the figure, the module structure of the test case information statistics system can be divided into a processing layer and a storage layer. Each layer includes multiple sub-modules, each responsible for different functions, ensuring that the entire system can efficiently and accurately parse, store and count test instance information. The following is a detailed description of each module:

[0044] 1) Processing layer: The processing layer includes Cucumber report instance parsing module, Feature file instance parsing module, Feature file instance change parsing module, instance information merging module, instance information statistics module and log recording module.

[0045] Cucumber report instance parsing module: responsible for parsing Cucumber report files, extracting instance test result information in the report and storing it in the database;

[0046] Feature file instance parsing module: parses the test case definition in the feature file, extracts the instance information and file submission information in the file and stores them in the database;

[0047] Feature file instance change analysis module: compares the content before and after the file is submitted, analyzes the lines where the changes are located and the lines where the change instances are located, and thus determines the number of modified instances;

[0048] Instance information merging module: matches and merges the instance information in the Cucumber report instance and feature file to generate a complete feature information record;

[0049] Instance information statistics module: performs statistical analysis on the merged instance information and generates detailed statistical reports as required;

[0050] Logging module: The logging layer records all log information generated during the processing, including file parsing logs, data merging logs, and statistical analysis logs, to facilitate later review and troubleshooting.

[0051] 2) Storage layer: The storage layer includes source files and databases.

[0052] Source files: Source files are external data sources, including Cucumber report files and Feature files;

[0053] Database: Store the parsed and statistical data in the database for subsequent query and analysis.

[0054] In the technical solution provided in the above step S102 of the present invention, in order to perform statistics on multiple test cases, the test case information statistics system needs to first obtain target report files and multiple initial file test cases corresponding to the multiple test cases.

[0055] Specifically, the test case information statistics system can obtain the target report file (Cucumber report file) and multiple test case files (Feature files) that need to be counted by traversing the code repository.

[0056] Optionally, a code repository is a place to store and manage source code, usually for team collaboration and version control. A code repository can contain the code of one or more projects, as well as related documents, configuration files, etc. Common code repository management tools include Git, SVN, etc. Through the code repository, team members can share code, perform version control, collaborate on development, etc. Common code repository platforms include GitHub, GitLab, Bitbucket, etc.

[0057] Step S104: extracting first test case information from multiple target report files according to the target parsing rule, wherein the first test case information is parameter information of multiple initial file test cases.

[0058] In the technical solution provided in the above step S104 of the present invention, the Cucumber report instance parsing module in the test case information statistics system can extract parameter information of multiple initial file test cases from multiple Cucumber report files according to the target parsing rules. The parameter information includes but is not limited to key information such as the name, background, steps, execution results, and execution time of the test case.

[0059] Specifically, the target parsing rules refer to a set of rules or algorithms for parsing and processing target report files, aiming to extract the first test case information from these files. The target parsing rules can adapt to report files of different formats to ensure the accuracy and completeness of the extracted information.

[0060] It should be noted that in large software projects, due to the distributed nature of code repositories, testing will be performed in multiple repositories, generating multiple target report files. Therefore, the system needs to traverse all relevant repositories, find and locate Cucumber report files, and then apply target parsing rules to parse each file.

[0061] Step S106, determining second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases.

[0062] Specifically, the initial file test cases mainly refer to the scenario descriptions of the Feature files. These scenarios are defined by Gherkin syntax and contain the expected behaviors and steps of the test.

[0063] Specifically, the second test case information is the submission information of multiple initial file test cases, including but not limited to: submission time (the time when the Feature file was last modified), the most recent submitter (the developer who last modified the Feature file), and the reason for submission (the purpose or background of modifying the Feature file).

[0064] Exemplarily, the second test case information can be determined by the following steps: traverse all relevant code repositories and locate Feature files; for each located Feature file, call the Git API or use the Git command to obtain the submission history of the file; from the obtained submission history, extract the most recent submission information, including submission time, submitter, and submission reason; organize the extracted submission information into a structured data format, such as JSON or XML, and store it in a database for further processing and analysis.

[0065] Step S108, statistics are collected on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

[0066] Specifically, the first test case information (such as test results, execution times, etc.) extracted from the Cucumber report file is associated with the second test case information (such as submitter, submission time, etc.) extracted from the Feature file. This association is usually based on the URI of the Feature file to ensure that the data of each test case corresponds to its version control information.

[0067] Specifically, determine the dimensions for statistics, including but not limited to: time dimension (such as daily, weekly, monthly), personnel dimension (by submitter, test executor), repository dimension (by code repository), test result dimension (pass rate, failure rate), etc. Statistics in different dimensions help to understand the status and changes of test cases from different perspectives.

[0068] Specifically, determine the statistical indicators, which include but are not limited to: execution count statistics (recording the number of times each test case is run within a specified time range), success rate statistics (calculating the proportion of successful execution of each test case within a specific time range), submission activity statistics (counting the modification frequency of Feature files by submitter and analyzing the update status of test cases), and instance number change statistics (by comparing Feature files at different time points, counting the addition, deletion and modification of test instances).

[0069] Specifically, all calculated statistical indicators are summarized to form statistical results in the form of tables or charts.

[0070] The aggregated statistical results are presented to the test and development teams, so that they can quickly understand the test status and trends. Analyzing the statistical results, finding patterns with low test case pass rates, identifying frequently modified feature files and team members who actively participate in test updates, helps optimize test strategies and strengthen team collaboration.

[0071] From the above steps S102 to S108, it can be known that in the present invention, multiple target report files and multiple initial file test cases are obtained, and first test case information is extracted from the multiple target report files according to the target parsing rules, wherein the first test case information is parameter information of the multiple initial file test cases, thereby achieving the purpose of determining the second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases, and achieving the technical effect of statistics on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases, thereby solving the technical problem of low test accuracy due to frequent updates of test instances in the prior art.

[0072] The above method of this embodiment is further described in detail below.

[0073] Optionally, the statistical method of test case information also includes: obtaining multiple target file test cases; comparing the multiple target file test cases with multiple initial file test cases based on the target command to obtain comparison results; parsing the comparison results to obtain target test case modification information.

[0074] Specifically, the target file test case refers to the test case in the feature file of the current version or the latest version. The system needs to traverse the code repository, identify all feature files, and read the contents of these files.

[0075] Exemplarily, the target command may be a git diff command of a version control system or an API with similar functions.

[0076] Specifically, by comparing the content of the Feature files between the two versions, the comparison results are obtained. The comparison results include the modified line number, modification type (addition, deletion, modification) and the specific content of the modification. The comparison results are parsed to obtain the target test case modification information. The purpose of parsing the comparison results is to determine which specific test cases or steps have been changed.

[0077] Optionally, the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information, and the number of modified instances.

[0078] Specifically, the target test instance row modification information records in detail the original content of the row, the modified content, the modification type (addition, deletion or modification), and the row number where the modification occurs.

[0079] Specifically, when a feature file contains multiple test cases with the same structure but different parameters, the modification will affect the rows of multiple instances. For example, if the column header in the example table is modified, it will affect all rows in the table, that is, the parameters of all instances. The modification information of multiple test instance rows will record the row number range, modification type and modification content of this group of instances, helping to analyze how many instances are affected.

[0080] Specifically, modifying the number of instances includes adding new instances, deleting instances, and modifying instances, which helps the team understand the overall change trend and scope of test cases.

[0081] Optionally, obtaining multiple target report files and multiple initial file test cases includes: performing a traversal operation on a code repository to obtain multiple target report files and multiple initial file test cases.

[0082] Specifically, determine the list of code repositories to be traversed. In large software projects, test cases are distributed in multiple repositories. The system obtains the list of these repositories and the corresponding access information from the configuration file or database, including the URL of the repository, authentication information (if necessary), etc.

[0083] Specifically, for each code repository, perform a traversal operation to search and locate the target report file (i.e., Cucumber report file) and the initial file test case (i.e., Feature file). The traversal operation is implemented by accessing the file system of the repository or using the API of the version control system (such as Git). The traversal logic includes: locating the Cucumber report file: usually in the / target / cucumber-report.json or / target / cucumber / json / cucumber.json path of the repository; searching for Feature files: traverse all files in the repository and look for files with the extension .feature, which are test case files in the Gherkin syntax format; handling multi-module repositories: in large projects, the repository contains multiple modules, each of which may contain its own test report and Feature files. The traversal operation needs to be able to recursively enter each module directory to ensure that all relevant files are found.

[0084] Specifically, after locating the target report file and feature file, read the contents of these files. For Cucumber reports, it involves parsing data in JSON format; for feature files, it is necessary to read text content and parse Gherkin syntax. For example, standard JSON parsing libraries (such as Jackson, Gson, etc.) and text processing tools (such as regular expressions) can be used to implement this.

[0085] Optionally, determining the second test case information according to the multiple initial file test cases includes: extracting at least one target keyword from the multiple initial file test cases based on the target grammar; and determining the second test case information according to the at least one target keyword.

[0086] Specifically, the target syntax in this application refers to the Gherkin language, which is the syntax for defining test cases in Feature files. The target keywords include specific keywords in the Gherkin language, such as Feature, Scenario, Scenario Outline, Examples, Given, When, Then, etc. These keywords are used to describe structured test cases.

[0087] Specifically, read all Feature files in the repository and parse the file contents based on Gherkin syntax. This involves using regular expressions or specialized Gherkin parsing libraries to identify and extract target keywords. For example, use the regular expression Scenario\s\w to match all test scenario descriptions, or use a Gherkin parsing library (such as Cucumber's Java parser) to more accurately identify keywords and their corresponding test steps and data.

[0088] Specifically, based on the extracted target keywords, metadata related to the test case is determined, including but not limited to: the name and description of the scenario or step: determined by Scenario, Scenario Outline and corresponding Given, When, Then keywords; the number of instances: for Scenario Outline, the number of rows in the table under the Examples keyword is used to determine the number of instances; commit information: the commit information is determined by calling Git API or commands (such as git log).

[0089] Optionally, statistics are performed on the first test case information and the second test case information to obtain statistical results, including: merging the first test case information and the second test case information based on a target resource identifier to obtain target test case information; and statistics are performed on the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0090] Specifically, the target resource identifier (Feature URI) is the unique identifier of the Feature file and is used to establish a connection between the Cucumber report file and the Feature file.

[0091] Specifically, the specific process of merging the first test case information and the second test case information based on the target resource identifier includes: reading the first test case information and the second test case information stored in the database; for each piece of the first test case information, finding the corresponding second test case information based on the Feature URI; combining the test result (such as pass, fail, skip, etc.) in the first test case information with the test case definition (such as scenario name, step description, number of instances, etc.) in the second test case information to form the target test case information, which includes associating the execution status and execution times of the test case with the definition and change history information of the test case.

[0092] Specifically, statistics are collected on the target test case information from multiple dimensions of the target test case information, wherein the multiple dimensions include but are not limited to: a time dimension, a personnel dimension, a warehouse dimension, an instance dimension, and a change dimension.

[0093] Specifically, after determining the statistical dimensions, extract the fields that need to be counted from the merged target test case information, such as test results, execution time, modifier, modification time, etc. According to the defined dimensions, use SQL query (Structured Query Language), pivot table or statistical functions to group and aggregate the data. For example, use the SQL GROUP BY statement to group by submitter and calculate the total number of test cases modified by each submitter, or use a pivot table to group by time and count the daily test case pass rate. Generate the final statistical results in the form of tables, charts, and reports to help team members quickly understand the execution status and change trends of test cases.

[0094] Optionally, multiple dimensions can be combined for statistics, such as combining the time dimension, personnel dimension, and warehouse dimension. Statistics items include the number of instances, the number of instance additions, the number of successful instances, the number of successful instance additions, the number of failed instances, the number of failed instance additions, the instance success rate, the instance success rate, and the instance success rate. In the instance statistics process, different dimensions and statistical items are selected for display and explanation according to different needs.

[0095] Optionally, the statistical method of test case information also includes: converting target test case information into target structured information; generating a target zipper table according to the target structured information; and storing the target zipper table in a target database.

[0096] Specifically, before storing the target test case information in the database, it is necessary to convert the target test case information into a structured data format. This step usually includes: data cleaning and preprocessing to ensure data consistency and integrity; data structure conversion, converting the original data format into a data structure supported by the database; field mapping, defining the mapping relationship between data fields and columns in the database table to ensure that data can be correctly stored in the corresponding fields.

[0097] Specifically, in the scenario of test case information statistics, the zipper table can record the history of the number of test case instances changing over time, ensuring the uniqueness and validity of the data at any point in time. The process of generating the target zipper table includes defining the zipper table structure (designing the database table structure, usually including fields such as feature_file (feature file name), commit_id (commit ID), feature_num (feature instance number), start_date (valid start date) and end_date (valid end date)) and processing data changes (when new test case information arrives, the valid date range in the zipper table needs to be updated).

[0098] Optionally, the Cucumber report file, Feature file, and merged target test case information are stored in the form of a zipper table.

[0099] Using zipper tables for storage can significantly improve the system's ability to manage feature file instance information or other files. By setting the start_date and end_date fields, zipper tables can ensure the integrity, consistency, and traceability of data while supporting complex analysis of the time dimension. It can easily count the changes in the number of instances within a certain period of time.

[0100] Specifically, storing the target zipper table in the target database includes the following steps: selecting a suitable database type (such as a relational database, a time series database, etc.) according to the data volume, query frequency and performance requirements, and performing corresponding configuration; inserting the generated target zipper table data into the database, and processing the existing update operations to ensure the accuracy and completeness of the data; designing reasonable indexes and query logic to support efficient data query.

[0101] In this embodiment, a statistical device for test case information is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0102] Figure 3 is a structural block diagram of a statistical device 300 for test case information according to one embodiment of the present invention. Figure 3 As shown, the device includes: a first acquisition module 301, an extraction module 302, a determination module 303 and a statistics module 304.

[0103] The first acquisition module 301 is used to acquire multiple target report files and multiple initial file test cases;

[0104] An extraction module 302 is used to extract first test case information from multiple target report files according to a target parsing rule, wherein the first test case information is parameter information of multiple initial file test cases;

[0105] A determination module 303 is used to determine second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases;

[0106] The statistical module 304 is used to collect statistics on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

[0107] Optionally, the test case information statistics device 300 also includes: a second acquisition module, used to acquire multiple target file test cases; a comparison module, used to compare the multiple target file test cases with the multiple initial file test cases based on the target command to obtain a comparison result; and a parsing module, used to parse the comparison result to obtain target test case modification information.

[0108] Optionally, the test case information statistics device 300 further includes: the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information and the number of modified instances.

[0109] Optionally, the first acquisition module 301 includes: a traversal unit, configured to perform a traversal operation on the code repository to obtain a plurality of target report files and a plurality of initial file test cases.

[0110] Optionally, the determination module 303 includes: an extraction unit, configured to extract at least one target keyword from a plurality of initial file test cases based on a target grammar; and a determination unit, configured to determine second test case information according to the at least one target keyword.

[0111] Optionally, the statistical module 304 includes: a merging unit, used to merge the first test case information and the second test case information based on the target resource identifier to obtain target test case information; and a statistical unit, used to count the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0112] Optionally, the statistics module 304 also includes: a conversion unit, used to convert the target test case information into target structured information; a generation unit, used to generate a target zipper table according to the target structured information; and a storage unit, used to store the target zipper table in a target database.

[0113] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the above-mentioned statistical method for test case information.

[0114] Optionally, in this embodiment, the electronic device may be configured to store a computer program for performing the following steps:

[0115] Step S102, obtaining multiple target report files and multiple initial file test cases;

[0116] Step S104, extracting first test case information from multiple target report files according to the target parsing rule, wherein the first test case information is parameter information of multiple initial file test cases;

[0117] Step S106, determining second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases;

[0118] Step S108, statistics are collected on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

[0119] Optionally, when executing the program, the processor also implements the following steps: obtaining multiple target file test cases; comparing the multiple target file test cases with the multiple initial file test cases based on the target command to obtain comparison results; parsing the comparison results to obtain target test case modification information.

[0120] Optionally, when the processor executes the program, the following steps are further implemented: the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information and the number of modified instances.

[0121] Optionally, when executing the program, the processor further implements the following steps: performing a traversal operation on the code repository to obtain multiple target report files and multiple initial file test cases.

[0122] Optionally, when the processor executes the program, the following steps are further implemented: extracting at least one target keyword from multiple initial file test cases based on the target syntax; and determining second test case information based on the at least one target keyword.

[0123] Optionally, when the processor executes the program, the following steps are also implemented: merging the first test case information and the second test case information based on the target resource identifier to obtain target test case information; and performing statistics on the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0124] Optionally, when executing the program, the processor further implements the following steps: converting the target test case information into target structured information; generating a target zipper table according to the target structured information; and storing the target zipper table in a target database.

[0125] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned substation environment analysis method when running on a computer or a processor.

[0126] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0127] Step S102, obtaining multiple target report files and multiple initial file test cases;

[0128] Step S104, extracting first test case information from multiple target report files according to the target parsing rule, wherein the first test case information is parameter information of multiple initial file test cases;

[0129] Step S106, determining second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases;

[0130] Step S108, statistics are collected on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

[0131] Optionally, the storage medium is configured to store program code for executing the following steps: obtaining multiple target file test cases; comparing the multiple target file test cases with multiple initial file test cases based on a target command to obtain comparison results; and parsing the comparison results to obtain target test case modification information.

[0132] Optionally, the storage medium is configured to store program code for executing the following steps: the target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information, and the number of modified instances.

[0133] Optionally, the storage medium is configured to store program codes for executing the following steps: performing a traversal operation on a code repository to obtain a plurality of target report files and a plurality of initial file test cases.

[0134] Optionally, the storage medium is configured to store program code for executing the following steps: extracting at least one target keyword from multiple initial file test cases based on the target grammar; and determining second test case information based on the at least one target keyword.

[0135] Optionally, the storage medium is configured to store program code for performing the following steps: merging the first test case information and the second test case information based on a target resource identifier to obtain target test case information; and performing statistics on the target test case information from multiple dimensions of the target test case information to obtain statistical results.

[0136] Optionally, the storage medium is configured to store program codes for executing the following steps: converting target test case information into target structured information; generating a target zipper table based on the target structured information; and storing the target zipper table in a target database.

[0137] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0138] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0139] In some embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0141] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a grid device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., which can store program codes.

[0143] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A statistical method for test case information, characterized in that: include: Get multiple target report files and multiple initial file test cases; Extracting first test case information from the multiple target report files according to a target parsing rule, wherein the first test case information is parameter information of the multiple initial file test cases; Determine second test case information according to the multiple initial file test cases, wherein the second test case information is submission information of the multiple initial file test cases; Statistics are collected on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

2. The statistical method for test case information according to claim 1, characterized in that: The method further comprises: Get multiple target file test cases; Comparing the multiple target file test cases with the multiple initial file test cases based on the target command to obtain a comparison result; The comparison result is parsed to obtain target test case modification information.

3. The statistical method for test case information according to claim 2, characterized in that: The target test case modification information includes at least one of the following: target test instance row modification information, multiple test instance row modification information, and the number of modified instances.

4. The statistical method for test case information according to claim 1, characterized in that: Acquiring the plurality of target report files and the plurality of initial file test cases comprises: A traversal operation is performed on the code repository to obtain the multiple target report files and the multiple initial file test cases.

5. The statistical method for test case information according to claim 1, characterized in that: Determining the second test case information according to the multiple initial file test cases includes: extracting at least one target keyword from the plurality of initial file test cases based on a target grammar; The second test case information is determined according to the at least one target keyword.

6. The statistical method for test case information according to claim 1, characterized in that: The statistical result obtained by performing statistics on the first test case information and the second test case information includes: Merging the first test case information and the second test case information based on a target resource identifier to obtain target test case information; The target test case information is statistically analyzed from multiple dimensions of the target test case information to obtain the statistical results.

7. The statistical method for test case information according to claim 6, characterized in that: The method further comprises: Converting the target test case information into target structured information; generating a target zipper table according to the target structured information; The target zipper table is stored in a target database.

8. A statistical device for test case information, characterized in that: include: A first acquisition module is used to acquire multiple target report files and multiple initial file test cases; An extraction module, configured to extract first test case information from the plurality of target report files according to a target parsing rule, wherein the first test case information is parameter information of the plurality of initial file test cases; A determination module, configured to determine second test case information according to the plurality of initial file test cases, wherein the second test case information is submission information of the plurality of initial file test cases; A statistical module is used to perform statistics on the first test case information and the second test case information to obtain statistical results, wherein the statistical results are used to test multiple file test cases.

9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the statistical method for test case information described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the statistical method for test case information described in any one of claims 1 to 7 when running on a computer or a processor.