The present disclosure pertains to information handling systems and resources and, more specifically, automated regression testing of firmware following changes.
As the value and use of information continues to increase, individuals and businesses seek additional ways to process and store information. One option available to users is information handling systems. An information handling system generally processes, compiles, stores, and/or communicates information or data for business, personal, or other purposes thereby allowing users to take advantage of the value of the information. Because technology and information handling needs and requirements vary between different users or applications, information handling systems may also vary regarding what information is handled, how the information is handled, how much information is processed, stored, or communicated, and how quickly and efficiently the information may be processed, stored, or communicated. The variations in information handling systems allow for information handling systems to be general or configured for a specific user or specific use such as financial transaction processing, airline reservations, enterprise data storage, or global communications. In addition, information handling systems may include a variety of hardware, software, and firmware components that may be configured to process, store, and communicate information and may include one or more computer systems, data storage systems, and networking systems.
Automated regression testing is a known approach for ensuring that approved firmware continues to function as expected whenever the firmware is updated, revised, or otherwise modified. Each new version or release of firmware typically includes one or more added features, one or more bug fixes, or both. Regression testing is performed to detect errors or other unintended issues that revised firmware might cause or exhibit. While it may be theoretically possible to test every possible combination of firmware state and input/output (I/O) event, time and cost considerations typically impose appreciable constraints on the total number of test cases that can be performed. In addition, because failures are always predictably reproducible, it is frequently necessary or highly desirable to execute test cases two or more times, potentially under two or more different test configurations to diagnosis root causes of failures accurately. Thus, it is important to select test cases wisely to achieve an effective balance between coverage and efficiency.
Generally, however, it is difficult to quantify how many code changes are covered by a black box test case. Those experienced and skilled in regression testing and familiar with a particular piece of firmware may be able to select suitable tests manually, but manual test case selection is imprecise and may fail to reveal one or more issues. Test cases may be selected based on code coverage data, e.g., statement/line coverage, branch/edge coverage, but coverage driven test selection can result in drift over time. In addition, code coverage tools typically consume considerable central processing unit (CPU), memory, and storage resources, which may impact the software's behavior and is not suitable for embedded and other resource-scarce environments.
Common problems associated with selecting test cases for regression testing are addressed by disclosed systems and methods for improving test efficiency and test correctness. Disclosed solutions may be implemented advantageously in numerous applications and environments including, as a non-limiting example, a quick, interactive qualification cycle.
In at least one aspect, subject matter included below discloses methods and systems for selecting test cases in which differences between first and second versions of firmware or another type of software are determined. In some cases, the first version corresponds to a version currently in use while the second version represent an update to the first version, including one or more bug fixes and/or additional features. Based at least in part on the differences between the two versions, one or more functions most likely to be impacted by the update are identified. These functions are referred to herein as impacted functions. Disclosed methods and system may then modify binary code for the second firmware version to cause the one or more impacted functions, when called, to return unconditionally a predetermined error value. With the firmware thus modified, a plurality of test cases are executed one time. Any test cases failing with the appropriate error value are identified as selected test cases and included within a group of target test cases for performing regression testing of the second version.
The test cases selection operations may further include accessing mapping data indicative of existing associations between functions and test cases and excluding, from the plurality of test cases run on the modified binary code, existing test cases, i.e., any test case indicated by the mapping data as having an existing association with any of the one or more impacted functions. In such embodiments, the target test cases may include a combination of the existing test cases and the selected test cases.
In at least some embodiments, modifying the binary code may include determining, for each impacted function, configuration information indicating a return type (RTYPE) of the impacted function and an instruction location (ILOC) for an instruction that loads a return value for the function to a return value register. RTYPE determinations may be performed by static analysis of source code.
For ARM CPU architecture embodiments, the return value register may be the r0 register while, for Intel CPU architecture embodiments, the eax register may be the return value register. Based on the RTYPE and the applicable CPU architecture of the device under test, instruction data (IDATA) for loading the return value register with a predetermined error value may be determined. The IDATA may then be used to overwrite the binary code at the ILOC. Prior to overwriting the binary code at the ILOC, the original binary code at the ILOC may be read and stored to enable a subsequent roll back of the binary code at the ILOC.
In some embodiments, modifying the binary code is performed by a custom loader implemented in a baseboard management controller of an information handling system. Determining the ILOC may include calculating an offset for the function, based on debug information generated by a compiler, to locate binary code corresponding to the function. The function's binary code may then be disassembled and the disassembled code may be used to identify the last instruction in the function storing a value to the function return register.
Technical advantages of the present disclosure may be readily apparent to one skilled in the art from the figures, description and claims included herein. The objects and advantages of the embodiments will be realized and achieved at least by the elements, features, and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are examples and explanatory and are not restrictive of the claims set forth in this disclosure.
A more complete understanding of the present embodiments and advantages thereof may be acquired by referring to the following description taken in conjunction with the accompanying drawings, in which like reference numbers indicate like features, and wherein:
Exemplary embodiments and their advantages are best understood by reference to
For the purposes of this disclosure, an information handling system may include any instrumentality or aggregate of instrumentalities operable to compute, classify, process, transmit, receive, retrieve, originate, switch, store, display, manifest, detect, record, reproduce, handle, or utilize any form of information, intelligence, or data for business, scientific, control, entertainment, or other purposes. For example, an information handling system may be a personal computer, a personal digital assistant (PDA), a consumer electronic device, a network storage device, or any other suitable device and may vary in size, shape, performance, functionality, and price. The information handling system may include memory, one or more processing resources such as a central processing unit (“CPU”), microcontroller, or hardware or software control logic. Additional components of the information handling system may include one or more storage devices, one or more communications ports for communicating with external devices as well as various input/output (“I/O”) devices, such as a keyboard, a mouse, and a video display. The information handling system may also include one or more buses operable to transmit communication between the various hardware components.
Additionally, an information handling system may include firmware for controlling and/or communicating with, for example, hard drives, network circuitry, memory devices, I/O devices, and other peripheral devices. For example, the hypervisor and/or other components may comprise firmware. As used in this disclosure, firmware includes software embedded in an information handling system component used to perform predefined tasks. Firmware is commonly stored in non-volatile memory, or memory that does not lose stored data upon the loss of power. In certain embodiments, firmware associated with an information handling system component is stored in non-volatile memory that is accessible to one or more information handling system components. In the same or alternative embodiments, firmware associated with an information handling system component is stored in non-volatile memory that is dedicated to and comprises part of that component.
For the purposes of this disclosure, computer-readable media may include any instrumentality or aggregation of instrumentalities that may retain data and/or instructions for a period of time. Computer-readable media may include, without limitation, storage media such as a direct access storage device (e.g., a hard disk drive or floppy disk), a sequential access storage device (e.g., a tape disk drive), compact disk, CD-ROM, DVD, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and/or flash memory; as well as communications media such as wires, optical fibers, microwaves, radio waves, and other electromagnetic and/or optical carriers; and/or any combination of the foregoing.
For the purposes of this disclosure, information handling resources may broadly refer to any component system, device or apparatus of an information handling system, including without limitation processors, service processors, basic input/output systems (BIOSs), buses, memories, I/O devices and/or interfaces, storage resources, network interfaces, motherboards, and/or any other components and/or elements of an information handling system.
In the following description, details are set forth by way of example to facilitate discussion of the disclosed subject matter. It should be apparent to a person of ordinary skill in the field, however, that the disclosed embodiments are exemplary and not exhaustive of all possible embodiments.
Throughout this disclosure, a hyphenated form of a reference numeral refers to a specific instance of an element and the un-hyphenated form of the reference numeral refers to the element generically. Thus, for example, “device 12-1” refers to an instance of a device class, which may be referred to collectively as “devices 12” and any one of which may be referred to generically as “a device 12”.
As used herein, when two or more elements are referred to as “coupled” to one another, such term indicates that such two or more elements are in electronic communication, mechanical communication, including thermal and fluidic communication, thermal, communication or mechanical communication, as applicable, whether connected indirectly or directly, with or without intervening elements.
Referring now to the drawings,
As depicted in
Disclosed methods and systems may select suitable test cases by identifying test cases that call or otherwise produce interactions with the impacted functions. As depicted in
As described below in conjunction with
Turning now to
As depicted in
The method 200 illustrated in
Having already identified the IFUNs, method 200 then changes (operation 214) the return value generated by each IFUN to a “wrong” value, i.e., an error value that will be used to easily identify test cases that exercised the applicable IFUN. As depicted in
The illustrated method 200 is configured for use in conjunction with mapping data identified as function-testcase mapping set 260, which includes a plurality of entries 261, of which
The illustrated method 200 uses mapping set 260 to identify (operation 216) existing test cases, i.e., test cases that have previously been determined to have an association with any of the IFUNs under consideration. Method 200 then executes the remaining test cases, i.e., all test cases other than the existing test cases identified in operation 216, one time. Because these test cases are executed with the modified IFUNs, all test cases that exercise any one or more of the IFUNs return with an error value that is used to identify a list of (operation 222) the failing test cases. Because the failing test cases identified in operation 222 represent test cases that exercise one or more IFUNs, these test cases are identified as selected test cases, i.e., test cases that might be usefully including in regression. As depicted in
The illustrated method then saves (operation 230) information mapping the selected test cases identified in operation 222) and their corresponding IFUNs in the mapping set 260 for use in evaluating subsequent firmware releases. Method 200 may then define the target test cases for regression testing by combining (operation 232) the selected test cases identified in operation 222 with the existing test cases identified in operation 216.
After establishing the target test cases, the method 200 illustrated in
Referring now to
The customized loader 306 operates in conjunction with a configuration file 320 which includes information indicating positions, i.e., memory addresses, and values to modify to produce modified software 312. With this technique of modifying the software in situ, i.e., directly in memory, enables the modifications to made without impacting performance, without requiring a recompile, and without requiring any substantial storage or processing resources apparat from the comparatively modest storage resources required for the configuration file 320.
Turning now to
The method 400 illustrated in
By repeating operations 404 through 412, the illustrated method 400 may obtain (operation 414) mapping data for the configuration file to be used by the customized loader (as described above with respect to
With the mapping data constructed, the illustrated embodiment of method 400 may then perform a second stage, identified in
Referring now to
This disclosure encompasses all changes, substitutions, variations, alterations, and modifications to the example embodiments herein that a person having ordinary skill in the art would comprehend. Similarly, where appropriate, the appended claims encompass all changes, substitutions, variations, alterations, and modifications to the example embodiments herein that a person having ordinary skill in the art would comprehend. Moreover, reference in the appended claims to an apparatus or system or a component of an apparatus or system being adapted to, arranged to, capable of, configured to, enabled to, operable to, or operative to perform a particular function encompasses that apparatus, system, or component, whether or not it or that particular function is activated, turned on, or unlocked, as long as that apparatus, system, or component is so adapted, arranged, capable, configured, enabled, operable, or operative.
All examples and conditional language recited herein are intended for pedagogical objects to aid the reader in understanding the disclosure and the concepts contributed by the inventor to furthering the art, and are construed as being without limitation to such specifically recited examples and conditions. Although embodiments of the present disclosure have been described in detail, it should be understood that various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202310073069.6 | Jan 2023 | CN | national |