Method and device for automatically generating and sending test report, computer equipment and readable storage medium
Through the jira API and flask B/S framework, the problem of inefficiency of traditional manual operations is solved and efficient and accurate test report generation and sending is achieved.
Patent Information
- Application Number
- CN202510539282.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-15
AI Technical Summary
The generation and sending of traditional software test reports rely on manual operations, which are inefficient and error-prone, and are difficult to guarantee data accuracy and real-time, and it is difficult to meet the needs of rapid iteration of projects.
Listen to the project version through the jira API, create test parameters, generate test case templates based on the flask B/S framework, obtain visual information of test progress and results, and display it on the front end and send it to the email address.
It realizes an automated process from test preparation to report sending, improves test work efficiency and data accuracy, and meets the needs of rapid iteration of projects.
Smart Images

Figure CN120492330A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software testing, and in particular to a method, device, computer equipment and readable storage medium for automatically generating and sending a test report. Background Art
[0002] Generating and sending test reports is a crucial step in software development projects. Traditionally, creating test tasks and generating test case templates relies heavily on manual operations, which are inefficient and prone to errors. Retrieving data from project management tools is also inconvenient, making it difficult to ensure data accuracy and real-time performance. Furthermore, synchronizing test progress and generating and sending test reports are often cumbersome, labor-intensive, and time-consuming, making them difficult to meet the demands of rapidly iterating projects. Therefore, a highly automated, efficient, and accurate method for generating and sending test reports is urgently needed. Summary of the Invention
[0003] The object of the present invention is to provide a method, apparatus, computer equipment and readable storage medium for automatically generating and sending a test report.
[0004] In a first aspect, an embodiment of the present invention provides a method for automatically generating and sending a test report, comprising:
[0005] Monitor project versions through the Jira API and create test parameters;
[0006] Based on the flask B / S framework, combine the test parameters to form a test case template for the project version in the preset document tool interface;
[0007] Obtain the test progress of the test case template execution;
[0008] Synchronize the test progress to the preset work communication group based on the flask B / S framework;
[0009] Obtaining visual information corresponding to the test results of the test case template execution;
[0010] Based on the flask B / S framework, project test related information, content sending options and visual information corresponding to the test results are displayed on the preset front end;
[0011] In response to the user's selection of the project test related information, the sending content option, and the test result visualization information, a test report is generated and sent to a corresponding email address.
[0012] In one possible implementation, monitoring the project version through the JIRA API and creating test parameters includes:
[0013] Monitor the project version through the Jira API and create test tasks, test filters, and test dashboards as the test parameters.
[0014] In a possible implementation, the test case template for the project version is formed in a preset document tool interface based on the flask B / S framework and in combination with the test parameters, including:
[0015] Based on the flask B / S framework, the test task, the test filter and the test dashboard are combined as the test parameters;
[0016] A test case template for the project version is formed in a preset Excel document based on the test tasks, the test filters, and the test dashboard.
[0017] In a possible implementation, obtaining the test progress of the test case template includes:
[0018] Use the jira module of the python jira library using jql syntax to obtain bug descriptions, the number of bugs in each version, and the number of pending bugs in jira, and then calculate the total number of bugs, the number of bugs in different modules, and the number of bugs on each terminal, and obtain the bug-related data.
[0019] Count the number of cases, case execution rounds, and number of executed cases to obtain case-related data;
[0020] The bug-related data and the case-related data are stored based on the dict format to obtain the test progress of the test case template execution.
[0021] In a possible implementation, the project test related information is obtained by:
[0022] Use jira module of python jira library to obtain test-related jira data in jira using jql syntax;
[0023] Use regular matching to obtain the description field in the test-related JIRA data. The description field includes the test time, tester, test content, and test risk related to each project version. The description field is saved as a string type.
[0024] The test time, testers, test content and test risks related to each project version are used as the project test related information.
[0025] In a possible implementation, obtaining visual information corresponding to the test result of executing the test case template includes:
[0026] Based on pyecharts, the number of bugs in different modules, the number of bugs found by different testers, and the number of bugs on each end are plotted into bar charts, and the proportion of different types of bugs and the proportion of bugs in different project versions are plotted into pie charts.
[0027] Use HTML to draw unresolved bugs and pending bugs into a table;
[0028] The bar chart, the pie chart, and the table are used as the visualization information.
[0029] In one possible implementation, the method further includes:
[0030] Analyzing the test risk level using a preset algorithm based on the visual information corresponding to the test results;
[0031] Generate a test risk warning report based on the test risk level and send a warning notification through a preset work communication group;
[0032] The test risk warning report is associated with the test report and stored, and a historical risk report query function is provided through the flask B / S framework.
[0033] In a second aspect, an embodiment of the present invention provides a device for automatically generating and sending a test report, comprising:
[0034] The test module is used to monitor the project version through the Jira API and create test parameters; based on the Flask B / S framework, it combines the test parameters to form a test case template for the project version in the preset document tool interface; and obtain the test progress of the test case template execution;
[0035] A sending module is used to synchronize the test progress to a preset work communication group based on the flask B / S framework; obtain visual information corresponding to the test results executed by the test case template; display project test related information, sending content options and visual information corresponding to the test results on a preset front end based on the flask B / S framework; and generate a test report and send it to a corresponding email address in response to the user's check operation for the project test related information, the sending content options and the test result visual information.
[0036] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the method described in the first aspect.
[0037] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method described in the first aspect.
[0038] Compared with the existing technology, the beneficial effects provided by the present invention include: using the method, device, computer equipment and readable storage medium disclosed in the present invention to automatically generate and send test reports, monitor the project version and create test parameters through the jira API, and generate a test case template based on the flask B / S framework and the test parameters. Obtain the test progress and synchronize it to the work communication group, obtain visual information of the test results, and display relevant information and options on the front end. In response to the user's check operation, generate a test report and send it to the email address. An automated process from test preparation to report sending is realized, which improves the test work efficiency and data accuracy, and effectively solves the processing efficiency problem in the traditional test report generation and sending process. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly describes the drawings required for use in the embodiments. It should be understood that the following drawings illustrate only certain embodiments of the present invention and should not be construed as limiting the scope of the present invention. Those skilled in the art can, without inventive effort, derive other relevant drawings from these drawings.
[0040] Figure 1 A schematic flow chart of the steps of a method for automatically generating and sending a test report provided in an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of the framework of the test report automatic generation and sending process provided by an embodiment of the present invention;
[0042] Figure 3 A schematic block diagram of the structure of an apparatus for automatically generating and sending a test report provided in an embodiment of the present invention;
[0043] Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the embodiments of the present invention. It should be understood that the described embodiments are only a portion of the embodiments of the present invention, not all of them. Generally, the components of the embodiments of the present invention described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations.
[0045] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0046] In order to solve the technical problems in the above background technology, Figure 1 This is a flow chart of a method for automatically generating and sending a test report provided in an embodiment of the present disclosure. The method for automatically generating and sending a test report is introduced in detail below.
[0047] Step S201: Monitor the project version through the Jira API and create test parameters;
[0048] Step S202: Based on the flask B / S framework, a test case template for the project version is generated in a preset document tool interface in combination with the test parameters;
[0049] Step S203, obtaining the test progress of the test case template execution;
[0050] Step S204: Synchronize the test progress to a preset work communication group based on the flask B / S framework;
[0051] Step S205, obtaining visual information corresponding to the test result of executing the test case template;
[0052] Step S206: Displaying project test related information, content sending options, and visual information corresponding to the test results on a preset front end based on the flask B / S framework;
[0053] Step S207 : In response to the user selecting the project test related information, the sending content option, and the test result visualization information, a test report is generated and sent to a corresponding email address.
[0054] In this embodiment of the present invention, the server, as the initiator of the entire process, monitors the dynamic changes of the project version through the Jira API. In this e-commerce platform app project, the development team continuously releases new versions to optimize features, fix vulnerabilities, etc. For example, when the development team is preparing to release version 10.5.0 of the app, the server monitors the update information of the project version.
[0055] The server then immediately created a series of test parameters through the Jira API. The first step was to create test tasks. The server generated multiple test tasks for version 10.5.0 in the Jira system, including functional testing tasks covering functional modules such as product browsing, ordering, and payment processes; compatibility testing tasks, including testing the app's operation on mobile devices of different brands and models; and performance testing tasks, testing performance indicators such as the app's response speed and loading time. Each test task clearly defined key information such as the task name, description, and responsible person to facilitate subsequent work by testers.
[0056] Next, the server creates a test filter. Considering the need to filter different types of data during testing, the server sets filters based on conditions such as project version and test task type. For example, a filter specifically designed to filter bugs related to the functional testing of version 10.5.0 could be created with the project version set to 10.5.0 and the test task type set to functional testing. This allows testers and project managers to quickly retrieve the required data when reviewing bug information later.
[0057] Finally, the server created a test dashboard. In Jira, a visual test dashboard was generated for version 10.5.0. This dashboard displays key information such as the progress of testing tasks, the number and distribution of discovered bugs, and the execution status of test cases. For example, progress bars are used to display the completion progress of each test task, while bar charts are used to present the number of bugs in different functional modules. Through this dashboard, project team members can intuitively understand the overall status of the project testing.
[0058] The server is based on the Flask B / S framework and uses the test parameters created in the previous step to generate a test case template for APP version 10.5.0 in the preset Excel document interface (taking Dingding Excel as an example).
[0059] The server first defines the basic information for the test case in the test case template based on the test task requirements. For example, for a product browsing function test task, the template generates fields such as the test case number (e.g., APP-10.5.0-001), the test case name (e.g., "Testing the normal loading of the product list"), the project (e-commerce platform app), the version (10.5.0), and the priority (high, medium, or low depending on the function's importance; here, medium).
[0060] Next, write the test objectives in the template based on the description of the test task. For example, in the test case for the product browsing function above, the test objective is to "verify whether the product list page can load and display product information normally in app version 10.5.0."
[0061] The server then lists the test steps in detail. For a product browsing test case, the test steps might include: opening the app and entering the product category page; clicking on a specific product category (such as the mobile phone category); checking whether the product list displays product images, names, prices, and other information properly; scrolling through the page to check whether the product list scrolls smoothly. At the same time, the template specifies the expected results: the product list loads normally, all information is displayed completely and accurately, and scrolling smoothly without lag.
[0062] If a test requires specific data input, the server will also indicate the test data in the test case template. For example, when testing the product search function, the test data may be a specific product keyword (such as "Apple phone"). In addition, the server will also indicate the test environment, such as requiring testing on a Huawei P40 phone running Android 11.
[0063] Through the above steps, the server formed a complete set of test case templates for APP version 10.5.0 in the Excel document, providing detailed testing guidance for testers.
[0064] The server begins to retrieve the test progress of the test case template. First, using the JIRA module in the Python JIRA library and jQuery (JQL) syntax, it retrieves information from the JIRA system, including the bug description, the number of bugs per version, and the number of pending bugs. During the testing of app version 10.5.0, suppose a tester discovered a bug while testing the product ordering feature. The bug description states, "No response after clicking the Submit button on the order submission page." The server retrieves the bug description, counts the number of bugs discovered in version 10.5.0, and determines that the bug is currently unresolved (pending).
[0065] The server further counts the number of bugs in different modules. For example, the product browsing module has 3 bugs, the ordering module has 2 bugs, and so on, calculating the total number of bugs to 5. The server also counts the number of cases, the number of case execution rounds, and the number of executed cases. Assume that a total of 50 test cases (number of cases) were designed for app version 10.5.0. One round of testing has already been executed (case execution round 1), and 40 of these cases (number of executed cases 40) have been successfully executed.
[0066] The server stores these bug-related data and case-related data in dict format, forming data with the following structure:
[0067]
[0068] Use this data as the test progress for executing the test case template.
[0069] The server, based on the Flask B / S framework, synchronizes the acquired test progress to a pre-set WeChat work group. In the WeChat group, the server sends a message similar to the following: "[E-commerce Platform App Version 10.5.0 Test Progress] Test Progress: One round of testing has been completed, with a total of 50 test cases, 40 of which have been successfully executed. Five bugs have been found, including three in the product browsing module and two in the ordering module. One bug is pending."
[0070] In this way, project team members, including developers, testers, product managers, etc., can obtain the test progress information of APP version 10.5.0 in a timely manner in WeChat for Business, which helps them understand the project testing status. Developers can arrange repair work in a timely manner according to the bug situation, and product managers can evaluate whether the project can be launched on time.
[0071] The server begins to obtain visualization information corresponding to the test results of the test case template. Based on the pyecharts library, the server plots the number of bugs in different modules into a bar chart. For example, with the module name (product browsing, order purchase, payment process, etc.) as the horizontal axis and the number of bugs as the vertical axis, a bar chart is generated to intuitively display the bug distribution of each module. The figure clearly shows that the product browsing module has a relatively high number of bugs, which may require the development team's attention.
[0072] The server also plots the number of bugs found by different testers into a bar chart, with the tester's name as the horizontal axis and the number of bugs as the vertical axis, making it easier to understand each tester's work output. At the same time, the number of bugs found by each end (such as the front-end and back-end) is also plotted into a bar chart to help the team assess the quality status of different ends.
[0073] In addition, the server plots the percentage of different bug types into a pie chart. Assuming bug types are categorized as functional, UI, performance, and so on, the server calculates the percentage of each type of bug in the total number of bugs and then generates a pie chart, allowing team members to quickly understand the main types of issues in the project. Similarly, the pie charts plot the percentage of bugs in different project versions to compare quality differences between them.
[0074] For unresolved and pending bugs, the server uses HTML to render a table. The table lists detailed information such as the bug number, description, module, severity, and discovery time, making it easier for relevant personnel to review and track these bugs in a specific status.
[0075] The server uses the generated bar charts, pie charts, and tables as visual information to provide data support for subsequent front-end presentation.
[0076] The server is based on the flask B / S framework and displays project test-related information, content sending options, and visual information corresponding to test results on the preset front-end page.
[0077] In terms of displaying project test-related information, the server displays information obtained through the jira module of the python jira library using jql syntax and processed by regular matching, such as the test time related to each project version (such as the test time of APP version 10.5.0 is from May 1 to May 10, 2024), testers (tester include Zhang San, Li Si, etc.), test content (covering functional tests such as product browsing and ordering), and test risks (such as some functions may have compatibility risks on specific models).
[0078] For the content sending option, the server provides a series of contents for users to check, such as test time, tester, test content, risk identification, test questions, etc. Users can select the content to be included in the test report according to actual needs.
[0079] At the same time, the server displays visual information corresponding to the test results on the front end, namely the previously generated bar chart, pie chart, and HTML table. Users can intuitively see the bug distribution of each module, the proportion of different bug types, and other information, providing a more comprehensive understanding of the test results.
[0080] After the user completes the check operation on the project test related information, sending content options and test result visualization information on the front-end page, the server receives the user's operation instructions.
[0081] The server first generates a test report based on the user's selected information, integrating it with relevant information. For example, if the user selects test time, tester, test content, and visualization of the number of bugs in different modules, the server organizes and formats this information. The beginning of the test report indicates that the test project is the e-commerce platform app version 10.5.0, the testing period is May 1st to May 10th, 2024, and the testers are Zhang San, Li Si, etc.
[0082] Next, list the test content in detail, including product browsing and ordering functionality. Then, insert a bar chart showing the number of bugs in different modules to visually display the distribution of bugs in modules like product browsing and ordering.
[0083] The server saves the generated test report in an appropriate format (such as PDF). It then sends the test report to the corresponding email address based on pre-configured email addresses (the email addresses of relevant personnel have been configured during the project management process). For example, the test report can be sent to the email addresses of relevant personnel such as the development team leader, product manager, and project manager, allowing them to review the test report in a timely manner, understand the project's testing status, and provide a basis for subsequent decision-making and work arrangements.
[0084] By executing the above detailed steps, the server realizes the entire automated process from monitoring the project version to finally generating and sending the test report, providing efficient and accurate support for the test management of the e-commerce platform APP project.
[0085] In the embodiment of the present invention, monitoring the project version through the JIRA API and creating test parameters can be implemented through the following example.
[0086] Monitor the project version through the Jira API and create test tasks, test filters, and test dashboards as the test parameters.
[0087] In an embodiment of the present invention, for example, in a software development project of an online education platform, the server undertakes the important task of monitoring the project version through the Jira API and creating test parameters.
[0088] The server continuously monitors project versions using the Jira API. When the development team progressed to version 5.2.0 of the online education platform app, the server was quick to detect the update.
[0089] Immediately, the server began to create test tasks. For the new features of version 5.2.0, such as the newly added live interactive session, the server generated a "live interactive function test task" in the jira system. This task detailed the task name, task description (to verify the stability and smoothness of the teacher-student interaction function during the live broadcast, including chat sending, raising hands to answer, voting and other functions), expected start and end time, task leader (designated test team member Wang Wu) and other information. For the platform's original course playback function, due to performance optimization in this version, the server created a "course playback performance test task", which clearly stated that the loading speed and playback smoothness of the course under different network environments must be tested, and the relevant task attributes are also set.
[0090] Next, the server creates a test filter. Taking into account the subsequent need for test data filtering, the server uses the project version and test task type as filtering conditions. For example, create a filter specifically for filtering bugs related to the live interactive function test in version 5.2.0, and set the filtering conditions to project version equal to 5.2.0 and the test task name contains "live interactive function test". In this way, when testers are looking for bugs related to the live interactive function test, they can use this filter to quickly obtain the required data. For example, the filter created for the course playback performance test can set the filtering conditions to project version 5.2.0 and task type to course playback performance test, which facilitates accurate filtering of data related to the task.
[0091] Finally, the server creates a test dashboard. In the JIRA system, a dedicated test dashboard is generated for version 5.2.0 of the online education platform app. Key information is presented visually on the dashboard: a progress bar is used to display the completion progress of the "live interactive function test task" and the "course playback performance test task." If the current completion rate is 30%, the progress bar will be displayed accordingly. A bar chart is used to display the distribution of the number of bugs in different functional modules (live interactive, course playback, etc.). If 5 bugs have been found in the live interactive module and 3 bugs have been found in the course playback module, the bar chart will intuitively show this difference. The execution status of the test cases will also be displayed, such as a total of 80 test cases designed and 30 executed. Through this test dashboard, project team members, whether developers, testers, or managers, can clearly understand the overall status of the 5.2.0 version testing work, providing a clear reference basis for subsequent work arrangements and decision-making.
[0092] In an embodiment of the present invention, the test case template for the project version is formed in a preset document tool interface based on the flask B / S framework and combined with the test parameters, which can be implemented through the following examples.
[0093] Based on the flask B / S framework, the test task, the test filter and the test dashboard are combined as the test parameters;
[0094] A test case template for the project version is formed in a preset Excel document based on the test tasks, the test filters, and the test dashboard.
[0095] In an embodiment of the present invention, for example, in the above-mentioned online education platform software development project, the server is based on the flask B / S framework and uses the created test parameters to generate a test case template for the APP 5.2.0 version in a preset Excel document.
[0096] First, the server determines the basic framework of the test case template based on the test task. Taking the "live interactive function test task" as an example, the template generates fields such as the use case number (such as APP-5.2.0-001), use case name ("live chat message sending test"), project (online education platform APP), version (5.2.0) and priority (given the importance of the chat function in live interaction, it is set to high). For the "course playback performance test task", the corresponding use case number (such as APP-5.2.0-002), use case name ("course loading speed test in a weak network environment") and other information are generated.
[0097] Next, the server writes the test objectives, referring to the detailed description of the test task. For example, the test objective for the "Live Chat Message Sending Test" use case is to verify that chat messages can be sent and displayed normally during live broadcasts in app version 5.2.0. The test objective for the "Course Loading Speed Test in Weak Network Environments" use case is to test whether courses can load within an acceptable timeframe in a weak network environment.
[0098] The server then uses the test steps outlined in the test task to detail the specific operations in the template. For the "Live Chat Message Sending Test," the test steps are: enter the live course interface; enter a text message in the chat input box; click the Send button; and check whether the message is displayed normally in the chat window. For the "Course Loading Speed Test in a Weak Network Environment," the steps include: simulate a weak network environment (such as a 3G network); open a course; and record the time from the start of the course loading to the complete display of the course content.
[0099] During this process, test filters also provide insights into data screening for template refinement. For example, based on a filter for bugs related to live interactive testing, the server can reference past bugs encountered in similar functional tests in the expected results section of the template, adding possible exception scenarios and corresponding expected results, such as "If a message fails to send, a clear error message should pop up on the interface."
[0100] The test dashboard also provides a reference for overall test progress and status when adjusting template content. If the dashboard shows slow progress in testing the live interactive feature, this may indicate significant uncertainty. The server can then add edge case testing scenarios to the template, such as test steps and expected results for sending multiple messages simultaneously or in rapid succession.
[0101] Finally, the server created a complete and targeted test case template for APP version 5.2.0 in a preset Excel document, which included detailed test cases corresponding to each test task, providing clear and comprehensive guidance for testers to carry out actual testing work.
[0102] In the embodiment of the present invention, obtaining the test progress of the test case template execution can be implemented through the following example.
[0103] Use the jira module of the python jira library using jql syntax to obtain bug descriptions, the number of bugs in each version, and the number of pending bugs in jira, and then calculate the total number of bugs, the number of bugs in different modules, and the number of bugs on each terminal, and obtain the bug-related data.
[0104] Count the number of cases, case execution rounds, and number of executed cases to obtain case-related data;
[0105] The bug-related data and the case-related data are stored based on the dict format to obtain the test progress of the test case template execution.
[0106] In an embodiment of the present invention, exemplarily, during the testing process of the online education platform APP version 5.2.0, the server begins to obtain the test progress of the test case template execution.
[0107] First, the server uses the jira module of the Python jira library, employing jQuery (JQL) syntax, to retrieve bug-related information from the Jira system. After a period of testing, the server retrieved several bug descriptions. For example, one description read, "During a live interaction, the system becomes unresponsive after clicking the raise your hand button," and another read, "The video occasionally freezes during course playback." The server also counts the number of bugs for each version, determining the number of bugs discovered in the current version 5.2.0, assuming there are eight. Three pending bugs, or unresolved bugs, were found. For example, the aforementioned live broadcast issue with unresponsive raise your hand button was marked as pending due to complex backend logic.
[0108] Next, the server further classified and counted the bugs to obtain the number of bugs in different modules and the number of bugs on each end. In terms of modules, there were 5 bugs in the live interactive module and 3 bugs in the course playback module. From the perspective of the end, 4 bugs were found on the front end, mainly concentrated in the interface display and interactive operations, such as abnormal button click effects; there were 4 bugs on the back end, most of which were related to data transmission and processing, such as abnormal data loading during course playback. The server aggregated these data and obtained bug-related data, including a total of 8 bugs, 5 live interactive modules, 3 course playback modules, 4 front-ends, 4 back-ends, and 3 hanging bugs.
[0109] The server then began to compile case-related data. The total number of pre-designed test cases for version 5.2.0 was 100, determined during the test preparation phase based on functional points and requirements. As testing progressed, two rounds of testing had already been completed, representing two case execution rounds. In these two rounds, 70 cases were successfully executed, while 30 cases remained unexecuted for various reasons (such as temporary failures in the test environment or pending fixes for pre-existing issues). The server compiled this information, including the number of cases, the number of rounds executed, and the number of executed cases, to generate case-related data.
[0110] Finally, the server stores the bug-related data and case-related data in dict format. The storage structure is similar to the following:
[0111]
[0112] Through this storage method, the server obtains the test progress of the test case template execution, clearly reflecting the status of the current test work in terms of bug discovery and use case execution, and providing accurate data support for subsequent test progress synchronization, test result analysis, and test report generation.
[0113] In an embodiment of the present invention, the project test related information is obtained in the following manner, which can be implemented through the following examples.
[0114] Use jira module of python jira library to obtain test-related jira data in jira using jql syntax;
[0115] Use regular matching to obtain the description field in the test-related JIRA data. The description field includes the test time, tester, test content, and test risk related to each project version. The description field is saved as a string type.
[0116] The test time, testers, test content and test risks related to each project version are used as the project test related information.
[0117] In an embodiment of the present invention, exemplarily, during the testing of the online education platform APP version 5.2.0, the server proceeds to obtain project test related information.
[0118] First, the server uses the JIRA module of the Python JIRA library and jQuery (JQL) syntax to retrieve test-related JIRA data from the JIRA system. As the central hub for project management and test information storage, the JIRA system records a large amount of test-related data. After executing the query, the server retrieves a series of data records containing project test content. These records contain a wealth of information, including details of bugs discovered during testing and a description of the overall project testing status.
[0119] The server then further processes the acquired test-related JIRA data. Using regular expression matching technology, the description field is accurately extracted from this data. In the JIRA system records, the description field for the testing of version 5.2.0 clearly states the testing period as "June 15, 2024 - June 25, 2024." This represents the time span of the entire version testing effort, from test plan development to test execution. The tester information is displayed as "Zhang San, Li Si, and Wang Wu," indicating that these test team members participated in the testing of this version. The test content details "live interactive function testing, including chat sending, hand-raising and answering, and voting; course playback function testing, covering loading speed and playback smoothness in different network environments," clearly outlining the specific testing scope for this version. The description field also mentions the testing risks as "possible compatibility issues with some older devices, and the potential impact on course loading speed in weak network environments." These are potential risks identified before testing based on project characteristics and past experience.
[0120] The server saves the extracted description field information as a string. For example, the test time is saved as "June 15, 2024 - June 25, 2024," the testers are saved as "Zhang San, Li Si, Wang Wu," the test content is saved as "Live interactive function testing, including chat sending, raising hands to answer questions, voting, and other functions; course playback function testing, covering loading speed and playback smoothness testing in different network environments," and the test risk is saved as "Some older devices may have compatibility issues, and course loading speed may be affected in weak network environments."
[0121] Finally, the server stores the test time, testers, test content, and test risks for each project version as string data, which serves as project test-related information. This information comprehensively and in detail reflects the basic status and key elements of the online education platform app version 5.2.0 testing. It will be displayed to relevant personnel on the front end and may serve as a key component of the test report, providing strong support for the project team to understand the overall testing process, assess test quality, and make decisions.
[0122] In the embodiment of the present invention, the obtaining of the visual information corresponding to the test result of the test case template execution can be implemented through the following example.
[0123] Based on pyecharts, the number of bugs in different modules, the number of bugs found by different testers, and the number of bugs on each end are plotted into bar charts, and the proportion of different types of bugs and the proportion of bugs in different project versions are plotted into pie charts.
[0124] Use HTML to draw unresolved bugs and pending bugs into a table;
[0125] The bar chart, the pie chart, and the table are used as the visualization information.
[0126] In an embodiment of the present invention, exemplarily, after the testing of the online education platform APP version 5.2.0 is completed, the server starts to obtain visual information corresponding to the test results executed by the test case template.
[0127] First, the server draws a bar chart based on the pyecharts library. The server obtains information about the number of bugs in different modules from previously collected bug data. Given that the live interactive module has five bugs and the course playback module has three bugs, the server generates a bar chart with the module names "live interactive" and "course playback" as the horizontal axis and the number of bugs as the vertical axis. In the chart, the bar representing the live interactive module is significantly longer than that representing the course playback module, intuitively demonstrating that the live interactive module encountered relatively more issues in this test.
[0128] Next, based on the number of bugs found by different testers, let's say Zhang San found 3 bugs, Li Si found 2 bugs, and Wang Wu found 3 bugs. The server also plots a bar chart with the tester's name as the horizontal axis and the number of bugs as the vertical axis. This bar chart clearly shows the work output of each tester during the test.
[0129] Then, for the number of bugs on each end, there are 4 bugs on the front end and 4 bugs on the back end. The server draws a bar chart to display it, which helps the team understand the quality status of different ends.
[0130] The server then used pyecharts to draw a pie chart. Regarding the percentage of different bug types, assuming there were 6 functional bugs and 2 interface bugs, the server calculated that functional bugs accounted for 75% and interface bugs accounted for 25%, and used this information to draw the pie chart. The pie chart clearly shows that functional issues account for a large proportion of all bugs. Regarding the percentage of bugs in different project versions, since only version 5.2.0 was tested, assuming that version 4.8.0 had 10 bugs and version 5.2.0 had 8 bugs, the server calculated that version 5.2.0 accounted for approximately 44% of bugs and version 4.8.0 accounted for approximately 56%. A pie chart was drawn to show the comparison between the two versions.
[0131] The server also uses HTML to display unresolved and pending bugs in a table. For example, if there are currently three unresolved and three pending bugs, the table details each bug's number, description, module, severity, and discovery time. For example, bug number BUG-001 has a description of "No response to raising your hand to answer during live interaction," belongs to the Live Interaction module, has a severity of High, and was discovered on June 18, 2024. This table allows project team members to easily access and track bugs in specific states.
[0132] Finally, the server generates bar charts, pie charts, and tables as visualizations. These visualizations present test results in an intuitive manner, providing rich and clear data presentation for subsequent front-end display and test report generation. This helps project team members quickly understand the distribution and status of issues discovered during testing, enabling better problem analysis and decision-making.
[0133] In the embodiments of the present invention, the following implementation modes are also provided.
[0134] Analyzing the test risk level using a preset algorithm based on the visual information corresponding to the test results;
[0135] Generate a test risk warning report based on the test risk level and send a warning notification through a preset work communication group;
[0136] The test risk warning report is associated with the test report and stored, and a historical risk report query function is provided through the flask B / S framework.
[0137] In an embodiment of the present invention, exemplarily, after the testing of the online education platform APP version 5.2.0 is completed, the server continues to perform subsequent operations related to test risk processing.
[0138] First, the server analyzes the test risk level through a preset algorithm based on the visual information corresponding to the test results. From the previously generated visual information, the server obtains key data such as the number of bugs in different modules and the proportion of different types of bugs. For example, the live interactive module has 5 bugs, which accounts for a high proportion of the total number of bugs (8), and most of them are functional bugs. There are also some unresolved high-severity bugs. The preset algorithm will comprehensively consider these factors, such as the number of bugs, severity, and importance of the functions involved. Since live interactive is one of the core functions of the platform, its large number of bugs and high-severity problems will increase the risk weight of this module. After algorithm calculation, the server determines that the overall risk level of this test is "medium-high risk".
[0139] Then, based on the resulting test risk level, the server generates a test risk warning report. The report details the basis for determining a "medium-high risk" risk level and lists specific issues with the live interactive module, such as "no response to raising your hand to answer during live interaction, occasional delays in sending chat messages," and the impact these issues may have on user experience and platform operations, such as poor classroom interaction and affecting students' enthusiasm for learning. The server also proposes some preliminary recommended measures in the report, such as suggesting that the development team prioritize handling high-severity bugs in the live interactive module and increase test coverage for this module.
[0140] The server then sends an early warning notification through a pre-set WeChat work group. The notification briefly summarizes the test risk level and key risk points, such as "[Online Education Platform App Version 5.2.0 Test Risk Warning] The test risk level is medium-to-high. The main risk is concentrated in the live interactive module. There are issues such as no response to the "raise your hand" prompt. Please pay attention." This way, project team members, including developers, product managers, and project managers, can receive timely notifications and understand the project's risks.
[0141] Finally, the server associates and stores the test risk warning report with the test report. In the server's storage system, a corresponding relationship between the two is established to facilitate subsequent queries and management. At the same time, the server provides a historical risk report query function through the flask B / S framework. Project team members can log in to the preset front-end interface and enter relevant conditions in the query bar, such as project name, version number, time range, etc., to retrieve historical test risk warning reports. For example, when the product manager subsequently evaluates the direction of platform function improvement, he can query the test risk warning report of APP version 5.2.0 to understand the problems and risks that existed at the time and provide a reference for formulating product plans. Through this series of operations, the server effectively manages and tracks test risks, providing strong support for the smooth progress of the project.
[0142] In order to more clearly describe the solution provided by the embodiment of the present invention, a relatively complete implementation method is proposed below. Figure 2 , Figure 2 A schematic diagram of the architecture of the test report automatic generation and sending process provided by an embodiment of the present invention.
[0143] Step 01: Automatically create test tasks, filters, and dashboards in Jira through the interface;
[0144] Step 02: Based on the Flask B / S framework, select the project and version, and automatically generate a test case template in the Dingding Excel document;
[0145] Step 03: Based on the flask B / S framework, the front-end displays the data needed to send emails and corporate WeChat:
[0146] Fill in or check the data you want to send;
[0147] Step 04: Get the data source:
[0148] Use the JIRA module of the python jira library and jql syntax to obtain the bug description, number of bugs in each version, number of pending bugs and other data in jira, calculate the total number of bugs, number of bugs in different modules, number of bugs on each end, etc., and aggregate the data into a dict type
[0149] After obtaining the JIRA data, the regular expression is matched against the description field in JIRA. The data stored in this field contains the test time, tester, test content, test risk and other contents related to each version, and it is saved as a string type.
[0150] By selecting the sending group, you can control whether to send to the test group (debugging data enterprise WeChat group) or the official group (official report sending enterprise WeChat group)
[0151] Step 05: Test progress and the recipient and cc parts are text input parts;
[0152] Step 06: Select the image and text to draw the chart in real time:
[0153] Use jira to read the calculated and stored data, draw bar charts, pie charts, and tables based on pyecharts, save them in a folder on the server, and save them in image format. Unresolved bugs and pending bugs are used to draw tables in html.
[0154] Step 07: Send the selected content to the backend via an Ajax request;
[0155] Step 08: The data selected by the front-end is transmitted to the back-end. After receiving the data, the back-end generates the client to be sent to email and enterprise WeChat according to the algorithm encapsulated in steps 02, 03, and 04 and the saved data;
[0156] Step 09: Send the content to the relevant WeChat users who need to receive it via HTTPS;
[0157] Step 10: Send the content to the recipients via SMTP.
[0158] In summary, the solution provided by the embodiment of the present invention can automatically create test tasks, filters, and dashboards in jira through the interface, and can also automatically generate test case templates in dingding excel documents, which greatly saves manual operation time and improves accuracy; with the help of the jira interface, data is automatically acquired, and while ensuring accuracy, it is saved in dict after calculation using an algorithm, making the data presentation clearer; after acquiring the jira data, the required content is accurately extracted through regular matching, and the regular matching is encapsulated for convenient calling; the data is stored in mysql for future calling and aggregation; pyecharts is used to draw charts, which presents data clearly and beautifully, facilitating the analysis of version issues; the front-end trigger mechanism increases functional availability, allowing people without source code to use it; sending data makes it convenient for relevant personnel to view the results, and comprehensively optimizes the test process and the experience of data processing, display and use.
[0159] This solution provides an innovative approach, covering aspects such as case calculation, JIRA data statistics, regular matching to store data, and sending data. It can automatically and accurately generate data such as bugs, requirement descriptions, and test time in JIRA, and automatically complete the summary and send data reports. It uses the Python language to request the JIRA interface, which can automatically traverse and generate data, effectively solving the problem of data errors that are difficult to find. At the same time, it ensures that the data sent each time is the latest data obtained in real time. At the end of the testing work, the tool will count the number of bugs, requirement content, test progress, pending bugs, testers, test time and other information in real time, and automatically send it to relevant personnel in real time, significantly improving the timeliness and accuracy of the previous manual summary statistics and sending them via email and corporate WeChat.
[0160] Please refer to Figure 3 , Figure 3 An embodiment of the present invention provides a device 110 for automatically generating and sending a test report, including:
[0161] The test module 1101 is used to monitor the project version through the Jira API and create test parameters; based on the Flask B / S framework, combine the test parameters to form a test case template for the project version in the preset document tool interface; and obtain the test progress of the test case template;
[0162] The sending module 1102 is used to synchronize the test progress to a preset work communication group based on the flask B / S framework; obtain visual information corresponding to the test results executed by the test case template; display project test related information, sending content options and visual information corresponding to the test results on a preset front end based on the flask B / S framework; generate a test report and send it to the corresponding email address in response to the user's check operation for the project test related information, the sending content options and the test result visual information.
[0163] It should be noted that the implementation principles of the aforementioned automatic test report generation and transmission device 110 can be referenced from the implementation principles of the aforementioned automatic test report generation and transmission method, and will not be elaborated upon here. It should be understood that the division of the various modules of the aforementioned device is merely a division of logical functions. In actual implementation, they may be fully or partially integrated into a single physical entity, or physically separated. Furthermore, these modules may be implemented entirely in software invoked by a processing element, or entirely in hardware. Alternatively, some modules may be implemented in software invoked by a processing element, while others may be implemented in hardware. For example, the automatic test report generation and transmission device 110 may be a separate processing element, or integrated into a chip of the aforementioned device. Furthermore, it may be stored in the form of program code in the memory of the aforementioned device, invoked by a processing element of the aforementioned device, and perform the functions of the automatic test report generation and transmission device 110. The implementation of the other modules is similar. Furthermore, these modules may be fully or partially integrated together, or implemented independently. The processing element described herein may be an integrated circuit with signal processing capabilities. During implementation, the steps of the aforementioned method or the modules above may be performed by hardware integrated logic circuits within a processor element, or by software instructions.
[0164] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code on a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0165] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the aforementioned test report automatic generation and sending device 110. Figure 4 As shown, Figure 4This is a structural block diagram of a computer device 100 provided in an embodiment of the present invention. The computer device 100 includes a test report automatic generation and sending device 110, a memory 111, a processor 112 and a communication unit 113.
[0166] In order to realize the transmission or interaction of data, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, the electrical connection between these components can be realized through one or more communication buses or signal lines. The test report automatic generation and sending device 110 includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or solidified in the operating system (OS) of the computer device 100. The processor 112 is used to execute the test report automatic generation and sending device 110 stored in the memory 111, such as the software function modules and computer programs included in the test report automatic generation and sending device 110.
[0167] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the aforementioned test report automatic generation and sending device 110.
[0168] For illustrative purposes, the foregoing description has been made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise forms disclosed. Numerous modifications and variations are possible in light of the above teachings. These embodiments have been selected and described in order to best illustrate the principles of the present disclosure and its practical application, thereby enabling those skilled in the art to best utilize the present disclosure and to utilize various embodiments with various modifications as appropriate for the specific application contemplated.
Claims
1. A method for automatically generating and sending a test report, characterized in that: include: Monitor project versions through the Jira API and create test parameters; Based on the flask B / S framework, combine the test parameters to form a test case template for the project version in the preset document tool interface; Obtain the test progress of the test case template execution; Synchronize the test progress to the preset work communication group based on the flask B / S framework; Obtaining visual information corresponding to the test results of the test case template execution; Based on the flask B / S framework, project test related information, content sending options and visual information corresponding to the test results are displayed on the preset front end; In response to the user's selection of the project test related information, the sending content option, and the test result visualization information, a test report is generated and sent to a corresponding email address.
2. The method according to claim 1, characterized in that The project version is monitored through the Jira API and test parameters are created, including: Monitor the project version through the Jira API and create test tasks, test filters, and test dashboards as the test parameters.
3. The method according to claim 2, characterized in that The test case template for the project version is formed based on the flask B / S framework and combined with the test parameters in the preset document tool interface, including: Based on the flask B / S framework, the test task, the test filter and the test dashboard are combined as the test parameters; A test case template for the project version is formed in a preset Excel document based on the test tasks, the test filters, and the test dashboard.
4. The method according to claim 1, wherein Obtain the test progress of the test case template execution, including: Use the jira module of the python jira library using jql syntax to obtain bug descriptions, the number of bugs in each version, and the number of pending bugs in jira, and then calculate the total number of bugs, the number of bugs in different modules, and the number of bugs on each terminal, and obtain the bug-related data. Count the number of cases, case execution rounds, and number of executed cases to obtain case-related data; The bug-related data and the case-related data are stored based on the dict format to obtain the test progress of the test case template execution.
5. The method according to claim 1, wherein The project test related information is obtained through the following methods, including: Use jira module of python jira library to obtain test-related jira data in jira using jql syntax; Use regular matching to obtain the description field in the test-related JIRA data. The description field includes the test time, tester, test content, and test risk related to each project version. The description field is saved as a string type. The test time, testers, test content and test risks related to each project version are used as the project test related information.
6. The method according to claim 1, characterized in that The obtaining of visual information corresponding to the test result of the test case template execution includes: Based on pyecharts, the number of bugs in different modules, the number of bugs found by different testers, and the number of bugs on each end are plotted into bar charts, and the proportion of different types of bugs and the proportion of bugs in different project versions are plotted into pie charts. Use HTML to draw unresolved bugs and pending bugs into a table; The bar chart, the pie chart, and the table are used as the visualization information.
7. The method according to claim 1, characterized in that The method further comprises: Analyzing the test risk level using a preset algorithm based on the visual information corresponding to the test results; Generate a test risk warning report based on the test risk level and send a warning notification through a preset work communication group; The test risk warning report is associated with the test report and stored, and a historical risk report query function is provided through the flask B / S framework.
8. A device for automatically generating and sending a test report, characterized in that: include: The test module is used to monitor the project version through the Jira API and create test parameters; Based on the flask B / S framework, combine the test parameters to form a test case template for the project version in the preset document tool interface; obtain the test progress of the test case template execution; A sending module is used to synchronize the test progress to a preset work communication group based on the flask B / S framework; Obtain visual information corresponding to the test results executed by the test case template; display project test related information, sending content options and visual information corresponding to the test results on the preset front end based on the flask B / S framework; In response to the user's selection of the project test related information, the sending content option, and the test result visualization information, a test report is generated and sent to a corresponding email address.
9. A computer device, characterized in that: The computer device includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.