[go: up one dir, main page]

CN119829469B - Firmware testing method, electronic device, storage medium and program product - Google Patents

Firmware testing method, electronic device, storage medium and program product

Info

Publication number
CN119829469B
CN119829469B CN202510323373.0A CN202510323373A CN119829469B CN 119829469 B CN119829469 B CN 119829469B CN 202510323373 A CN202510323373 A CN 202510323373A CN 119829469 B CN119829469 B CN 119829469B
Authority
CN
China
Prior art keywords
tested
test
functional module
test case
functional
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202510323373.0A
Other languages
Chinese (zh)
Other versions
CN119829469A (en
Inventor
许小明
王璞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202510323373.0A priority Critical patent/CN119829469B/en
Publication of CN119829469A publication Critical patent/CN119829469A/en
Application granted granted Critical
Publication of CN119829469B publication Critical patent/CN119829469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a firmware testing method, electronic equipment, a storage medium and a program product, which relate to the technical field of computers, and the functional testing of firmware to be tested is performed by taking the functional module as a unit through positioning a modified functional module to be tested in the firmware to be tested, and the automatic screening and issuing of target test cases can be realized according to the modified type and attribute characteristics of the functional module to be tested, so that the testing efficiency of the firmware to be tested is improved.

Description

Firmware testing method, electronic device, storage medium and program product
Technical Field
The present application relates to the field of computer technologies, and in particular, to a firmware testing method, an electronic device, a storage medium, and a program product.
Background
With the continuous increase of the service demands of users on products such as storage devices and servers, the firmware of the products is continuously updated in an iterative manner, so that the development work of firmware codes becomes an important work for product development, and a series of functional tests are required to be performed on the firmware before the newly developed firmware is put into use for the products so as to ensure the safety of the firmware.
In the related art, a mode of manually issuing a test case is generally adopted to perform functional test on a firmware code to be tested. However, as the firmware is updated continuously, the functions supported by the firmware are more and more complex, and more test cases need to be issued, and the current test case issuing mode reduces the firmware testing efficiency.
Disclosure of Invention
The application provides a firmware testing method, electronic equipment, storage medium and program product, which at least solve the problem that the firmware testing efficiency is reduced in the related art.
The application provides a firmware testing method, which comprises the following steps:
acquiring the latest development code of the firmware to be tested;
Determining at least one functional module to be tested which is changed according to the latest development code, wherein the firmware to be tested comprises a plurality of functional modules;
Aiming at any function module to be tested, determining a target test case set of the function module to be tested according to the change type and attribute characteristics of the function module to be tested;
Based on the target test case set, performing multiple functional tests on the functional module to be tested to obtain a functional test result of the functional module to be tested.
The application also provides a firmware testing device, which comprises:
the acquisition module is used for acquiring the latest development code of the firmware to be tested;
The first determining module is used for determining at least one functional module to be tested which is changed according to the latest development code, wherein the firmware to be tested comprises a plurality of functional modules;
The second determining module is used for determining a target test case set of the functional module to be tested according to the change type and attribute characteristics of the functional module to be tested aiming at any functional module to be tested;
And the testing module is used for carrying out various functional tests on the functional module to be tested based on the target test case set to obtain a functional test result of the functional module to be tested.
The application also provides an electronic device, which comprises a memory for storing a computer program and a processor for implementing any firmware testing method when executing the computer program.
The application also provides a computer readable storage medium, in which a computer program is stored, wherein the computer program when executed by a processor implements the steps of any of the firmware testing methods described above.
The application also provides a computer program product comprising a computer program which when executed by a processor implements the steps of any of the firmware testing methods described above.
According to the application, the modified functional module to be tested is positioned in the firmware to be tested, so that the functional test of the firmware to be tested is performed by taking the functional module as a unit, and the automatic screening and issuing of the target test case can be realized according to the modification type and attribute characteristics of the functional module to be tested, so that the test efficiency of the firmware to be tested is improved.
Drawings
For a clearer description of embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a schematic diagram of a firmware testing system according to an embodiment of the present application;
fig. 2 is a flow chart of a firmware testing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an overall flow of a firmware testing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a firmware testing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present application.
It should be noted that in the description of the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "first," "second," and the like in this specification are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
In the related art, the manual issuing of test cases has many drawbacks, such as low efficiency, easy error, lack of consistency, difficult tracking and management, high communication cost, lack of automation support, and difficult adaptation to rapid changes, which limit the efficiency, accuracy and consistency of the test.
The embodiment of the application provides a firmware testing method, electronic equipment, storage medium and program product, and the method comprises the steps of obtaining the latest development code of firmware to be tested, determining at least one functional module to be tested which is changed according to the latest development code, determining target test case sets of the functional module to be tested according to the change type and attribute characteristics of any functional module to be tested, and performing multiple functional tests on the functional module to be tested based on the target test case sets to obtain functional test results of the functional module to be tested. According to the method provided by the scheme, the function test of the firmware to be tested is performed by taking the function module as a unit by locating the changed function module to be tested in the firmware to be tested, and the automatic screening and issuing of the target test case can be realized according to the changed type and attribute characteristics of the function module to be tested, so that the test efficiency of the firmware to be tested is improved, and meanwhile, the accuracy and consistency of the function test are ensured.
The present application will be further described in detail below with reference to the drawings and detailed description for the purpose of enabling those skilled in the art to better understand the aspects of the present application.
The specific application environment architecture or specific hardware architecture upon which the execution of the firmware test method depends is described herein.
First, a structure of a firmware test system according to the present application will be described:
The firmware testing method, the electronic device, the storage medium and the program product provided by the embodiment of the application are suitable for functional testing of firmware development codes of products such as a server, the storage device and the like. Fig. 1 is a schematic structural diagram of a firmware testing system according to an embodiment of the present application, which mainly includes a firmware to be tested, a data acquisition device and a firmware testing device. The data acquisition device is used for acquiring the latest development code provided by a developer for perfecting the firmware to be tested, providing the latest development code to the firmware testing device, and carrying out targeted functional model test on the firmware to be tested according to the latest development code.
The embodiment of the application provides a firmware testing method which is used for carrying out functional testing on firmware development codes of products such as a server, storage equipment and the like. The execution subject of the embodiment of the application is electronic equipment such as a server, a desktop computer, a notebook computer, a tablet computer and other electronic equipment which can be used for testing development codes.
Fig. 2 is a flow chart of a firmware testing method according to an embodiment of the present application, where the method includes:
Step 201, obtaining the latest development code of the firmware to be tested.
Specifically, in the continuous integration and continuous delivery (CI/CD) process of firmware, after the developer completes the development of any functional module, the developer submits the development code to the code management tool Gerrit. Through the linkage relation established by the Gerrit and the Jenkins, when the Gerrit code warehouse is updated, the Jenkins automatically pulls the changed code so as to acquire the latest development code of the firmware to be tested. Jenkins is an open source continuous integration and continuous delivery deployment tool.
And 202, determining at least one functional module to be tested, which is changed, according to the latest development code.
The firmware to be tested comprises a plurality of functional modules.
Specifically, the acquired latest development code can be analyzed to determine identification information such as function names in the modified code, and further, according to the identification information in the modified code, it is determined which functions in the firmware to be tested are changed in the latest development code.
Step 203, for any functional module to be tested, determining a target test case set of the functional module to be tested according to the modification type and attribute characteristics of the functional module to be tested.
It should be noted that, the modification types at least include three types of function addition, function modification and function optimization, and the attribute features are used for characterizing which attributes are included in the function module to be tested, where the attributes included in the function module to be tested are functions supported by the function module to be tested, and the attributes include an object access control system (Object Access Control System, abbreviated as OACS), an access control list (Access Control List, abbreviated as ACL), a network performance and security system (Network Performance and Security System, abbreviated as NPSS), and the like.
Specifically, according to the change type and attribute characteristics of the functional module to be tested, a plurality of target test cases meeting the functional test requirements of the functional module to be tested can be screened from a preset test case library so as to obtain a target test case set of the functional module to be tested.
And 204, performing multiple functional tests on the functional module to be tested based on the target test case set to obtain a functional test result of the functional module to be tested.
Specifically, multiple functional tests on the functional module to be tested can be realized by running each target test case in the target test case set, so as to obtain an application case test result corresponding to each target test case, and finally, the functional test result of the functional module to be tested is obtained by summarizing the application case test result of each target test case.
On the basis of the above embodiment, as an implementation manner, in an embodiment, the determining at least one functional module to be tested that is changed according to the latest development code includes:
Step 2021, extracting keywords from the latest development code to obtain a keyword extraction result of the latest development code;
step 2022, determining at least one functional module to be tested which is changed according to the keyword extraction result of the latest development code.
Wherein the keywords comprise attribute names, function names and the like.
Specifically, based on a Spark NLP natural language processing model, extracting keywords such as attribute names and function names from the latest development code to obtain a keyword extraction result of the latest development code, determining which development code of the functional module the latest development code belongs to according to the keyword extraction result, and using the modified functional module as a functional module to be tested.
Specifically, in an embodiment, a main function module which is directly changed can be determined according to a keyword extraction result of a latest development code, a slave function module which has an association relationship with the main function module is determined according to an association relationship between function modules in a firmware to be tested, and the main function module and the slave function module are used as the function modules to be tested.
Specifically, the extracted keywords may be matched with the feature keywords of each predefined functional module, and if the feature keyword of a certain functional module is overlapped with the keywords in the extraction result, it is determined that the functional module is directly modified, and the functional module is used as the main functional module. Since the functional modules are not usually isolated in the firmware to be tested, various association relations, such as calling relations, data dependency relations and the like, exist between the functional modules. Thus, after the master function module is determined, a slave function module associated with the master function module needs to be further found.
Specifically, in the firmware development process, an association relation model between each functional module may be pre-established, where the association relation model is used to record information such as call paths and data flow directions between each functional module. After determining the master function module, the input and output of the master function module, other modules called and the conditions called by the other modules can be analyzed by querying the association relation model to determine the slave function module associated with the master function module. By determining the slave function module and bringing it into test range, potential problems caused by the slave function module being influenced by the modification of the master function module can be avoided from being missed.
Specifically, in an embodiment, the attribute of direct modification can be determined according to the keyword extraction result of the latest development code, and in the case that any attribute of any function module is directly modified, the function module is used as the main function module of direct modification.
Specifically, each functional module is provided with a specific attribute set, the attribute sets jointly define the behavior and the characteristics of the functional module, and when any attribute in the functional module is directly changed, the behavior or the characteristics of the functional module may be changed in the specification, so that the functional module is taken as a main functional module with the direct change.
On the basis of the above embodiment, as an implementation manner, in an embodiment, for any functional module to be tested, determining, according to a modification type and attribute characteristics of the functional module to be tested, a target test case set of the functional module to be tested includes:
step 2031, determining a target test range according to the modification type of the function module to be tested for any function module to be tested;
step 2032, screening test case sets corresponding to all attributes in a preset test case library according to the attribute characteristics of the functional module to be tested;
step 2033, for any attribute, screening at least one target test case in the test case set of the attribute according to the target test range;
Step 2034, determining a target test case set of the functional module to be tested according to at least one target test case corresponding to each attribute.
Wherein the change types at least comprise three types of function addition, function modification and function optimization.
It should be noted that different modification types correspond to different test ranges. For function addition, it is necessary to test whether the basic function of the new function is normal, compatibility with the existing system, etc., for function modification, it is necessary to test the functional correctness of the modified part and whether other related functions are affected, and for function optimization, it is important to test whether the optimized performance index reaches the expectation of optimization.
Specifically, after the target test range is confirmed, at least one target test case of each attribute matched with the target test range can be screened in a preset test case library according to the target test range, so that a target test case set of the functional module to be tested is obtained. The target test range is determined according to the change type, and the test cases are screened according to the attribute characteristics, so that the content to be tested can be accurately positioned, the test of irrelevant content is avoided, the pertinence of the test is improved, and meanwhile, the test efficiency and the comprehensiveness of the test are improved.
Specifically, in an embodiment, attribute characteristics of each functional module of the firmware to be tested can be obtained, multiple test cases are created according to the attribute characteristics of each functional module, corresponding relations among each functional module, attribute and test case are established, and a preset test case library is created according to the corresponding relations among each functional module, attribute and test case.
Specifically, in order to clearly express which attribute of which functional module each test case tests, the embodiment of the application pre-establishes the corresponding relation among the functional module, the attribute and the test case, and can record the corresponding relation in a database or table form, for example, a table is created, wherein a column records the name of the functional module, a column records the attribute name, and a column records the corresponding test case number, and in practical application, all the test cases corresponding to a certain attribute of a certain functional module can be quickly located by querying the table.
Specifically, in one embodiment, a history test record of the firmware to be tested may be obtained, and a modification type of the functional module to be tested may be determined according to the history test record.
Specifically, if the function module is not involved in the previous test in the history test record, that is, the function module to be tested or a certain attribute in the function module to be tested has not been tested before, the change type of the function module to be tested is determined to be function addition. If the last function detection result of the functional module to be detected is not passed in the history test record, the current modification type is determined to be the function modification. If the last function detection result of the functional module to be detected passes in the history test record, determining that the modification type is function optimization.
On the basis of the above embodiment, as an implementation manner, in one embodiment, based on the target test case set, performing multiple functional tests on the functional module to be tested to obtain a functional test result of the functional module to be tested, including:
step 2041, deploying the firmware to be tested to a plurality of test devices;
Step 2042, issuing the target test case set to a plurality of test devices so as to run each target test case in the target test case set based on the test devices, and performing multiple functional tests on the functional module to be tested to obtain an application case test result corresponding to each target test case;
Step 2042, determining the functional test result of the functional module to be tested according to the application test result corresponding to each target test case.
Specifically, by deploying the firmware to be tested on a plurality of test devices, a wider actual use scene can be simulated, so that problems possibly existing in different environments of the firmware to be tested are found. And by adopting a plurality of test devices to execute each target test case in the target test case set in parallel, the running time of the test cases is reduced, and the firmware function test efficiency is further improved.
The method comprises the steps of in an embodiment, classifying a plurality of test devices according to configuration information of the test devices to obtain a plurality of test device pools, determining a target test device pool of a target test case according to a test type of the target test case aiming at any target test case in the target test case set, and when any target test device in the target test device pool is in an idle state, issuing the target test case to the target test device to operate the target test case based on the target test device to obtain a test result of the target test case corresponding to the target test case.
The test types of the test cases are at least divided into two types, namely compatibility test and performance test. The compatibility test mainly focuses on the running condition of the firmware to be tested under different environments to ensure that software can normally work on various configured devices, and the performance test focuses on evaluating performance indexes of the firmware to be tested, such as response time, throughput, resource utilization rate and the like.
It should be noted that, the configuration information of the test device includes hardware configuration information and software configuration information, the hardware configuration information includes a CPU model, a memory size, a hard disk capacity, a graphics card performance, etc., the software configuration information includes an operating system type, a version, etc., and different configurations may affect the running performance of the test device on the test case.
Specifically, for compatibility test cases, the test device can run on a plurality of test device pools with different configurations to cover more software use scenes. For example, testing the compatibility of an application under different operating system and browser combinations may assign test cases to a pool of devices that install different operating systems and browsers. Performance test cases, in turn, typically need to run on a specially configured device pool to ensure accuracy and comparability of test results. For example, to test the upper performance limit of software in a high configuration environment, a higher configured device pool may be selected. In the process of issuing the target test cases, the states of all the devices in the target test device pool can be continuously monitored, whether the devices are in an idle state or not is judged, the idle state means that the devices do not execute other test tasks currently, new test cases can be received, and therefore when any one of the target test devices in the target test device pool is in the idle state, the corresponding target test cases can be issued to the target test device.
In the process of issuing test cases, the issuing sequence of the test cases can be determined according to the priority of each attribute in the functional module to be tested, for example, the test cases related to the core computing service are issued preferentially. The priority of each attribute in the functional module can be determined according to the frequency of service usage by the user and the importance of each attribute in the functional module.
The method comprises the steps of determining the function coverage rate and the code coverage rate of a functional module to be tested of a target test case according to an application case test result corresponding to the target test case in an embodiment, taking the application case test result of the target test case as a test result to be fused when the function coverage rate and the code coverage rate of the functional module to be tested of the target test case reach preset coverage rate thresholds, taking the application case test result of the target test case as an abnormal test result when the function coverage rate or the code coverage rate of the functional module to be tested of the target test case does not reach preset coverage rate thresholds, taking the target test case as a test result to be optimized when the application case test result of the target test case is the abnormal test result, adding a new target test case in a target test case set to replace the test case to be optimized until the obtained application case test result is the test result to be fused, and carrying out fusion processing on the multiple test results to be fused to obtain the function test result of the functional module to be tested.
It should be noted that, the function coverage rate refers to the proportion of the function executed in the functional module to be tested to the total function when a certain target test case is run. For example, there are 10 functions in the functional module under test, and 6 functions are executed when running the target test case, then the coverage of the functions is 60%. The code coverage rate refers to the proportion of the code lines executed in the functional module to be tested to the total code lines when the target test case is run. For example, the functional module to be tested has 100 rows of codes in total, after the test case is executed, 70 rows of codes are executed, and the code coverage rate is 70%. By analyzing the application test results corresponding to the target test cases, the execution information can be collected, so that the function coverage rate and the code coverage rate are calculated. According to the embodiment of the application, the coverage rate of the function and the coverage rate of the code are concerned, so that the test case can cover all parts of the functional module to be tested as much as possible, the occurrence of a test blind area is avoided, and the accuracy of a test result is improved.
Specifically, when the function coverage rate and the code coverage rate of the target test case to the functional module to be tested reach the preset coverage rate threshold, the test case is more comprehensive in testing the functional module, and enough functions and code rows can be covered, so that the test case test result is used as the test result to be fused. For example, the preset function coverage rate threshold value is 90%, the code coverage rate threshold value is 90%, and if the function coverage rate of a certain test case is 95%, the code coverage rate is 95%, the result can be used as the test result to be fused. If the function coverage rate or the code coverage rate of the target test case does not reach the preset coverage rate threshold, which means that the test case does not fully cover the functions or codes of the functional module, there may be a situation that part of the functions are not tested, and the test result of the test case is used as an abnormal test result. When the case test result of the target test case is an abnormal test result, marking the test case as the test case to be optimized. This indicates that the current test case has shortcomings and needs to be improved subsequently.
Specifically, in order to improve the comprehensiveness of the test, a new target test case is added in the target test case set to replace the test case to be optimized. The new test case design will more pay attention to the functions and codes which are not fully tested before, and the test process is repeated until the obtained test case test result is the test result to be fused. And finally, carrying out fusion processing on a plurality of test results to be fused, comprehensively considering the results of all the test cases, and finally obtaining the functional test results of the functional module to be tested. The fusion process can adopt various modes, such as counting the number of passed test cases, analyzing the problems found by different test cases, and the like, so as to comprehensively evaluate whether the function of the functional module is normal.
Specifically, in an embodiment, for a test case to be optimized, artificial intelligence and machine learning techniques may be applied to analyze reasons of low coverage, deep analysis is performed on a code structure and logic of a functional module to be tested, uncovered code regions and functions are mined by means of a code analysis tool, and then a new target test case is automatically and dynamically generated according to the uncovered code regions and functions, so as to improve the coverage of the test case.
On the basis of the above embodiment, as a practical implementation, in an embodiment, the method further includes:
Step 301, generating a corresponding function test report according to a function test result of a function module to be tested;
Step 302, performing risk assessment on a functional module to be tested according to a functional test report to obtain a risk assessment result, wherein the risk assessment result at least comprises code complexity, historical defect rate and functional importance;
And step 303, determining a test case issuing strategy of the functional module to be tested according to the risk assessment result.
Specifically, each target test case generates a log record in the execution process, the log record includes the execution condition of each test step in the target test case, and a functional test report of the functional module to be tested can be generated by summarizing the case test result and the log record of each target test case. The function test result of the function module to be tested comprises a case test result and log records of each target test case.
Specifically, the code structure, logic nesting depth, function call relation and other factors of the functional module can be analyzed through the functional test report, and the complexity of the code can be estimated. Complex codes mean higher maintenance costs and potential error risks. For statistics of the historical defect rate, the historical defect rate can be calculated by referring to the number and types of defects of the functional module in past tests. If a functional module frequently has problems during the previous testing process, the stability is poor and the risk is high. For the evaluation of the functional importance, the functional importance can be determined according to the function of the functional module in the whole system and the influence degree of the functional module on the user experience, and particularly, the functional importance can be determined according to the use frequency of the user on different functional modules. And finally, integrating factors such as code complexity, historical defect rate, functional importance and the like to obtain an integrated risk assessment result. For example, a functional module with high code complexity, high historical defect rate and high functional importance has a high risk assessment result, while a functional module with low code complexity, low historical defect rate and low functional importance has a low risk assessment result.
Specifically, for a functional module with a high risk evaluation result, more comprehensive and stricter test cases can be issued regularly to ensure the stability of the module. For low risk functional modules such as simple auxiliary functional modules, there may be relatively few test cases issued to increase the utilization of the test cases.
Specifically, in an embodiment, the target number of target test cases corresponding to each attribute in the functional module to be tested may be determined according to a test case issuing policy of the functional module to be tested.
It should be noted that, in any functional module of the firmware to be tested, any one attribute corresponds to a plurality of test cases (attribute test case sets), in the step 2033, when screening target test cases, the test cases in each attribute test case set may be ranked in priority according to the target test range of the functional module to be tested, and then according to the target number of target test cases corresponding to each attribute in the functional module to be tested determined previously, the test cases with the target number of target cases with the front priority are extracted from the attribute test case set corresponding to each attribute as the target test cases.
Under the condition of abundant test resources (test equipment), the target quantity of target test cases corresponding to each attribute in the functional module to be tested can be increased appropriately, and under the condition of deficient test resources, the target quantity of target test cases corresponding to each attribute in the functional module to be tested can be reduced appropriately.
For example, as shown in fig. 3, an overall flow chart of the firmware testing method provided by the embodiment of the application is that a firmware code developer such as a research engineer develops a functional module, for example, an Identify functional module, locally according to research requirements. After the local development is completed, the code of the function (the latest development code) is submitted to a code management tool Gerrit and added to a code warehouse of Gerrit. And through the linkage association relation established by the Gerrit and the Jenkins, updating a code warehouse of the Gerrit, automatically triggering the Jenkins to realize the test function aiming at the code, pulling the changed code to the local by the Jenkins, and compiling brand-new firmware by using the code to obtain the firmware to be tested. Then, the functional module is divided and the attribute of the firmware to be tested is analyzed through a firmware binary extractor, and then a mapping database is created to obtain a test case database (a preset test case library). After the functional module to be tested which is changed at this time is determined, automatic distribution of test cases is performed based on a preset test case library, and then a functional test report of the functional module to be tested is obtained by executing the test cases. And if the function test result is failed, generating prompt information to a developer to prompt that the uploaded latest development code fails the function test, and requiring the developer to modify the code again so as to ensure the safety of firmware development.
The firmware testing method provided by the embodiment of the application comprises the steps of obtaining the latest development code of the firmware to be tested, determining at least one functional module to be tested which is changed according to the latest development code, determining a target test case set of the functional module to be tested according to the change type and attribute characteristics of any functional module to be tested, and performing multiple functional tests on the functional module to be tested based on the target test case set to obtain the functional test result of the functional module to be tested. According to the method provided by the scheme, the function test of the firmware to be tested is performed by taking the function module as a unit by locating the changed function module to be tested in the firmware to be tested, and the automatic screening and issuing of the target test case can be realized according to the changed type and attribute characteristics of the function module to be tested, so that the test efficiency of the firmware to be tested is improved, and meanwhile, the accuracy and consistency of the function test are ensured. And the code change is automatically analyzed through the Spark NLP natural language processing model, a mapping table of the function is automatically established according to the code change, a corresponding test case set is inquired through the mapping table, a test plan is automatically generated, the equipment test is directly called, the whole process does not need to be manually participated, a complete CI/CD flow is formed, the test can be accurately performed aiming at the change point, the continuously-changing test requirement is met, the test efficiency is improved, and the effectiveness and the practicability of the test plan are ensured.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment.
The embodiment of the application also provides a firmware testing device which is used for executing the firmware testing method provided by the embodiment.
Fig. 4 is a schematic structural diagram of a firmware testing apparatus according to an embodiment of the present application. The firmware testing apparatus 40 includes an acquisition module 401, a first determination module 402, a second determination module 403, and a testing module 404.
The system comprises an acquisition module, a first determination module, a second determination module and a test module, wherein the acquisition module is used for acquiring the latest development code of a firmware to be tested, the first determination module is used for determining at least one functional module to be tested which is changed according to the latest development code, the firmware to be tested comprises a plurality of functional modules, the second determination module is used for determining a target test case set of the functional module to be tested according to the change type and attribute characteristics of any functional module to be tested, and the test module is used for carrying out multiple functional tests on the functional module to be tested based on the target test case set to obtain the functional test result of the functional module to be tested.
The description of the features in the embodiment corresponding to the firmware testing device may be referred to the related description of the embodiment corresponding to the firmware testing method, which is not described herein in detail.
An embodiment of the present application further provides an electronic device, as shown in fig. 5, which is a schematic structural diagram of the electronic device according to the embodiment of the present application, including a processor 10 and a memory 20, where the memory 20 stores a computer program, and the processor 10 is configured to execute the computer program to perform the steps in any of the firmware testing method embodiments described above.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps of any of the firmware test method embodiments described above when run.
In an exemplary embodiment, the computer readable storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, etc. various media in which a computer program may be stored.
Embodiments of the present application also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the firmware test method embodiments described above.
Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the firmware test method embodiments described above.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The firmware testing method, the electronic device, the storage medium and the program product provided by the application are described in detail above. The principles and embodiments of the present application have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present application and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.

Claims (13)

1.一种固件测试方法,其特征在于,包括:1. A firmware testing method, comprising: 获取待测固件的最新开发代码;Get the latest development code of the firmware to be tested; 根据所述最新开发代码,确定发生改动的至少一个待测功能模块;其中,所述待测固件包括多个功能模块;According to the latest development code, determining at least one functional module to be tested that has been modified; wherein the firmware to be tested includes multiple functional modules; 针对任一所述待测功能模块,根据所述待测功能模块的改动类型和属性特征,确定所述待测功能模块的目标测试用例集;For any of the functional modules to be tested, determining a target test case set for the functional module to be tested according to the modification type and attribute characteristics of the functional module to be tested; 基于所述目标测试用例集,对所述待测功能模块进行多种功能测试,得到所述待测功能模块的功能测试结果;Based on the target test case set, multiple functional tests are performed on the functional module to be tested to obtain functional test results of the functional module to be tested; 针对任一所述待测功能模块,根据所述待测功能模块的改动类型和属性特征,确定所述待测功能模块的目标测试用例集,包括:For any of the functional modules to be tested, determining a target test case set for the functional module to be tested according to the modification type and attribute characteristics of the functional module to be tested includes: 针对任一所述待测功能模块,根据所述待测功能模块的改动类型,确定目标测试范围;For any of the functional modules to be tested, determining a target test range according to the modification type of the functional module to be tested; 根据所述待测功能模块的属性特征,在预设测试用例库中筛选各属性对应的测试用例集;According to the attribute characteristics of the functional module to be tested, the test case set corresponding to each attribute is selected in the preset test case library; 针对任一所述属性,根据所述目标测试范围,在该属性的测试用例集中筛选至少一个目标测试用例;For any of the attributes, according to the target test scope, filter at least one target test case in the test case set of the attribute; 根据各所述属性所对应的至少一个目标测试用例,确定所述待测功能模块的目标测试用例集;Determine a target test case set for the functional module to be tested according to at least one target test case corresponding to each of the attributes; 其中,所述改动类型至少包括功能添加、功能修改和功能优化三种类型;The modification types include at least three types: function addition, function modification and function optimization; 所述基于所述目标测试用例集,对所述待测功能模块进行多种功能测试,得到所述待测功能模块的功能测试结果,包括:The step of performing multiple functional tests on the functional module to be tested based on the target test case set to obtain functional test results of the functional module to be tested includes: 将所述待测固件部署至多个测试设备;Deploy the firmware to be tested to multiple test devices; 将所述目标测试用例集下发至所述多个测试设备,以基于所述测试设备运行所述目标测试用例集中的各个目标测试用例,以对所述待测功能模块进行多种功能测试,得到每个所述目标测试用例对应的用例测试结果;The target test case set is sent to the multiple test devices, so as to run each target test case in the target test case set based on the test device, so as to perform multiple functional tests on the functional module to be tested, and obtain a test case test result corresponding to each target test case; 根据各所述目标测试用例对应的用例测试结果,确定所述待测功能模块的功能测试结果。The functional test results of the functional modules to be tested are determined according to the test case test results corresponding to the target test cases. 2.根据权利要求1所述的固件测试方法,其特征在于,所述根据所述最新开发代码,确定发生改动的至少一个待测功能模块,包括:2. The firmware testing method according to claim 1, wherein determining at least one functional module to be tested that has been modified according to the latest development code comprises: 对所述最新开发代码进行关键词提取,得到所述最新开发代码的关键词提取结果;Perform keyword extraction on the latest developed code to obtain a keyword extraction result of the latest developed code; 根据所述最新开发代码的关键词提取结果,确定发生改动的至少一个待测功能模块。At least one modified function module to be tested is determined according to the keyword extraction result of the latest development code. 3.根据权利要求2所述的固件测试方法,其特征在于,所述根据所述最新开发代码的关键词提取结果,确定发生改动的至少一个待测功能模块,包括:3. The firmware testing method according to claim 2, wherein the step of determining at least one functional module to be tested that has been modified based on the keyword extraction result of the latest development code comprises: 根据所述最新开发代码的关键词提取结果,确定发生直接改动的主功能模块;Determine the main functional module that has been directly modified based on the keyword extraction result of the latest development code; 根据所述待测固件中各所述功能模块之间的关联关系,确定与所述主功能模块存在关联关系的从功能模块;Determine, according to the association relationship between the functional modules in the firmware to be tested, a slave functional module that has an association relationship with the master functional module; 将所述主功能模块和从功能模块作为所述待测功能模块。The master function module and the slave function module are used as the function modules to be tested. 4.根据权利要求3所述的固件测试方法,其特征在于,所述根据所述最新开发代码的关键词提取结果,确定发生直接改动的主功能模块,包括:4. The firmware testing method according to claim 3, characterized in that the step of determining the main functional modules that are directly modified based on the keyword extraction result of the latest development code comprises: 根据所述最新开发代码的关键词提取结果,确定发生直接改动的属性;Determine the attributes that are directly modified based on the keyword extraction results of the latest development code; 在任一所述功能模块的任一属性发生直接改动的情况下,将该功能模块作为发生直接改动的主功能模块。In the case that any attribute of any of the functional modules is directly modified, the functional module is regarded as the main functional module that is directly modified. 5.根据权利要求1所述的固件测试方法,其特征在于,所述方法,还包括:5. The firmware testing method according to claim 1, characterized in that the method further comprises: 获取所述待测固件各个功能模块的属性特征;Obtaining attribute characteristics of each functional module of the firmware to be tested; 根据各所述功能模块的属性特征,创建多种测试用例,并建立各所述功能模块、属性和所述测试用例三者之间的对应关系;According to the attribute characteristics of each of the functional modules, a variety of test cases are created, and a corresponding relationship between each of the functional modules, the attributes and the test cases is established; 根据所述各所述功能模块、属性和所述测试用例三者之间的对应关系,创建所述预设测试用例库。The preset test case library is created according to the correspondence between the functional modules, the attributes and the test cases. 6.根据权利要求1所述的固件测试方法,其特征在于,所述方法,还包括:6. The firmware testing method according to claim 1, characterized in that the method further comprises: 获取所述待测固件的历史测试记录;Obtaining historical test records of the firmware to be tested; 根据所述历史测试记录,确定所述待测功能模块的改动类型。According to the historical test records, the modification type of the functional module to be tested is determined. 7.根据权利要求1所述的固件测试方法,其特征在于,所述将所述目标测试用例集下发至所述多个测试设备,包括:7. The firmware testing method according to claim 1, wherein sending the target test case set to the plurality of test devices comprises: 按照各所述测试设备的配置信息,对所述多个测试设备进行分类,得到多个测试设备池;Classifying the plurality of test devices according to the configuration information of each of the test devices to obtain a plurality of test device pools; 针对所述目标测试用例集中的任一目标测试用例,根据该目标测试用例的测试类型,确定该目标测试用例的目标测试设备池;For any target test case in the target test case set, determining a target test device pool for the target test case according to the test type of the target test case; 当所述目标测试设备池中任一目标测试设备处于空闲状态时,将该目标测试用例下发至所述目标测试设备,以基于所述目标测试设备运行所述目标测试用例,得到该目标测试用例对应的用例测试结果;When any target test device in the target test device pool is in an idle state, the target test case is sent to the target test device, so as to run the target test case based on the target test device to obtain a test result corresponding to the target test case; 其中,测试用例的测试类型至少分为兼容性测试和性能测试两种类型。Among them, the test types of test cases are divided into at least two types: compatibility testing and performance testing. 8.根据权利要求1所述的固件测试方法,其特征在于,所述根据各所述目标测试用例对应的用例测试结果,确定所述待测功能模块的功能测试结果,包括:8. The firmware testing method according to claim 1, characterized in that the step of determining the functional test result of the functional module to be tested according to the test case test results corresponding to each of the target test cases comprises: 针对任一所述目标测试用例,根据该目标测试用例对应的用例测试结果,确定所述目标测试用例对所述待测功能模块的函数覆盖率和代码覆盖率;For any of the target test cases, determine the function coverage and code coverage of the target test case for the functional module to be tested according to the test case test result corresponding to the target test case; 在所述目标测试用例对所述待测功能模块的函数覆盖率和代码覆盖率均达到预设覆盖率阈值的情况下,将该目标测试用例的用例测试结果作为待融合测试结果;When both the function coverage and the code coverage of the target test case on the functional module to be tested reach a preset coverage threshold, the test result of the target test case is used as the test result to be merged; 在所述目标测试用例对所述待测功能模块的函数覆盖率或代码覆盖率未达到预设覆盖率阈值的情况下,将该目标测试用例的用例测试结果作为异常测试结果;When the function coverage or code coverage of the target test case for the functional module to be tested does not reach a preset coverage threshold, the test result of the target test case is regarded as an abnormal test result; 当任一所述目标测试用例的用例测试结果为异常测试结果时,将该目标测试用例作为待优化测试用例,并在所述目标测试用例集中添加新的目标测试用例,以替换所述待优化测试用例,直至得到的用例测试结果为待融合测试结果;When the case test result of any of the target test cases is an abnormal test result, the target test case is used as a test case to be optimized, and a new target test case is added to the target test case set to replace the test case to be optimized, until the obtained case test result is a test result to be integrated; 对多个所述待融合测试结果进行融合处理,得到所述待测功能模块的功能测试结果。The plurality of test results to be merged are merged to obtain the functional test result of the functional module to be tested. 9.根据权利要求1所述的固件测试方法,其特征在于,所述方法,还包括:9. The firmware testing method according to claim 1, characterized in that the method further comprises: 根据所述待测功能模块的功能测试结果,生成对应的功能测试报告;Generate a corresponding functional test report according to the functional test results of the functional module to be tested; 根据所述功能测试报告,对所述待测功能模块进行风险评估,得到风险评估结果;其中,所述风险评估结果至少包括代码复杂度、历史缺陷率和功能重要度;According to the functional test report, risk assessment is performed on the functional module to be tested to obtain a risk assessment result; wherein the risk assessment result at least includes code complexity, historical defect rate and functional importance; 根据所述风险评估结果,确定所述待测功能模块的测试用例下发策略。According to the risk assessment result, a test case delivery strategy for the functional module to be tested is determined. 10.根据权利要求9所述的固件测试方法,其特征在于,所述方法,还包括:10. The firmware testing method according to claim 9, characterized in that the method further comprises: 根据所述待测功能模块的测试用例下发策略,确定所述待测功能模块中每个属性对应的目标测试用例的目标数量。According to the test case sending strategy of the functional module to be tested, a target number of target test cases corresponding to each attribute in the functional module to be tested is determined. 11.一种电子设备,其特征在于,包括:11. An electronic device, comprising: 存储器,用于存储计算机程序;Memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至10任一项所述固件测试方法的步骤。A processor, configured to implement the steps of the firmware testing method according to any one of claims 1 to 10 when executing the computer program. 12.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至10任一项所述固件测试方法的步骤。12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the firmware testing method according to any one of claims 1 to 10 are implemented. 13.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至10任一项所述固件测试方法的步骤。13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the firmware testing method according to any one of claims 1 to 10.
CN202510323373.0A 2025-03-19 2025-03-19 Firmware testing method, electronic device, storage medium and program product Active CN119829469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510323373.0A CN119829469B (en) 2025-03-19 2025-03-19 Firmware testing method, electronic device, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510323373.0A CN119829469B (en) 2025-03-19 2025-03-19 Firmware testing method, electronic device, storage medium and program product

Publications (2)

Publication Number Publication Date
CN119829469A CN119829469A (en) 2025-04-15
CN119829469B true CN119829469B (en) 2025-07-22

Family

ID=95304475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510323373.0A Active CN119829469B (en) 2025-03-19 2025-03-19 Firmware testing method, electronic device, storage medium and program product

Country Status (1)

Country Link
CN (1) CN119829469B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120429238B (en) * 2025-06-25 2025-10-21 苏州元脑智能科技有限公司 Test method, test device, electronic equipment and storage medium
CN120448279A (en) * 2025-06-27 2025-08-08 山东云海国创云计算装备产业创新中心有限公司 A test method, computer program product, device and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941547A (en) * 2019-10-12 2020-03-31 平安普惠企业管理有限公司 Automatic test case library management method, device, medium and electronic equipment
CN113933627A (en) * 2021-10-08 2022-01-14 网易有道信息技术(北京)有限公司 Method for automatically testing and verifying electronic product and related product

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5208635B2 (en) * 2008-09-12 2013-06-12 インターナショナル・ビジネス・マシーンズ・コーポレーション Information processing apparatus, information processing system, programming support method and program for supporting programming
CN106951361A (en) * 2016-01-06 2017-07-14 联发科技(新加坡)私人有限公司 SDK method of testing and its device, test system
CN110221969A (en) * 2019-05-21 2019-09-10 深圳壹账通智能科技有限公司 A kind of page function test method and relevant apparatus
CN114780386A (en) * 2022-03-24 2022-07-22 中国银行股份有限公司 Software testing method, device, equipment and storage medium
CN115422080A (en) * 2022-09-21 2022-12-02 Oppo广东移动通信有限公司 Test case set generation method and device, computer equipment and storage medium
CN117290253B (en) * 2023-11-23 2024-03-01 苏州元脑智能科技有限公司 Code testing method, device, communication equipment and storage medium
CN118567981A (en) * 2024-05-28 2024-08-30 河南昆仑技术有限公司 Automatic testing method of embedded operating system and related products

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941547A (en) * 2019-10-12 2020-03-31 平安普惠企业管理有限公司 Automatic test case library management method, device, medium and electronic equipment
CN113933627A (en) * 2021-10-08 2022-01-14 网易有道信息技术(北京)有限公司 Method for automatically testing and verifying electronic product and related product

Also Published As

Publication number Publication date
CN119829469A (en) 2025-04-15

Similar Documents

Publication Publication Date Title
US10901727B2 (en) Monitoring code sensitivity to cause software build breaks during software project development
CN119829469B (en) Firmware testing method, electronic device, storage medium and program product
US10310968B2 (en) Developing software project plans based on developer sensitivity ratings detected from monitoring developer error patterns
US7895565B1 (en) Integrated system and method for validating the functionality and performance of software applications
CN113946499A (en) Micro-service link tracking and performance analysis method, system, equipment and application
CN119168075B (en) A method and system for real-time processing and analysis of AI big data
CN119415393B (en) A software testing automation platform and intelligent optimization method thereof
EP2113874A1 (en) Method and system for monitoring computer-implemented processes
US8850407B2 (en) Test script generation
CN115952081A (en) Software testing method, device, storage medium and equipment
CN118885390A (en) A spacecraft automated testing method and system based on big data
Ostrand et al. A tool for mining defect-tracking systems to predict fault-prone files
CN116627804A (en) Test method, system, electronic equipment and storage medium based on artificial intelligence
CN118132448B (en) Test case processing method, device, computer equipment and storage medium
CN120123247A (en) Interface testing method, device, electronic equipment and storage medium
CN113282505A (en) Software test progress analysis method, device, equipment and storage medium
CN119201682A (en) Regression testing method, system, computer equipment and storage medium
CN119025415A (en) Detection method and device based on regression testing of application program
CN119166511A (en) Test case generation method and device
CN119201679A (en) A test case optimization method and system based on artificial intelligence
CN112667597A (en) Algorithm model full life cycle management tool system and implementation method thereof
CN118093381B (en) Software testing method and system based on artificial intelligence
Fernandes et al. Impact of non-fitting cases for remaining time prediction in a multi-attribute process-aware method
Fernandes et al. Impact of Non-Fitting Cases for Remaining Time Prediction in a Multi-Attribute Process-Aware Method.
CN120386588B (en) Method and system for adapting trust-based innovation environment based on cloud computing platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant