An Embedded Computer Software Testing Method
By modifying the embedded computer code and using VerOSource tool for analysis, the problem of insufficient test dimensions of embedded computer software testing methods is solved, and multi-dimensional software testing coverage is improved, suitable for high-safety fields such as spacecraft, power grid control and high-speed trains.
Patent Information
- Application Number
- CN202210216062.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-03-07
AI Technical Summary
Existing embedded computer software testing methods cannot fully cover the hardware design of embedded computers, and the test dimensions are limited, so they cannot meet the requirements of high safety and high reliability, such as spacecraft, grid control and high-speed trains.
By modifying the embedded computer code, adding driver test software code, capturing real-time data and performing statistical analysis of source code coverage, statistical analysis of target code structure coverage, and software defect positioning test, using VerOSource tool for analysis.
It has achieved multi-dimensional software testing coverage improvement, supports the functional performance of the whole machine and the real-time and reliability of software tasks, and is suitable for a variety of application scenarios.
Smart Images

Figure CN114661586B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer testing, and particularly relates to a method for testing embedded computer software. Background Art
[0002] Software testing is an important means to ensure the quality of software products of embedded computers, and is also an important activity to ensure the quality and reliability of systems.
[0003] Currently, the main methods for testing the software of embedded computer products are static testing methods and embedded software testing in a digital simulation environment. Static testing methods mainly check the feasibility of software by detecting the interfaces, structures, and grammars of programs, and judge whether the code meets the standards, whether the code structure is reasonable, and whether the code logic is appropriate. However, static detection methods cannot analyze the actual operation of the code. Embedded software testing in a digital simulation environment, such as the CRESTS software developed by Augitong Company, can virtualize the CPU environment in real time, perform code inspection, simulation operation, and generate test reports for runnable programs. However, it can only complete general testing, and for special embedded computers, it cannot test the dedicated hardware design, and the testing dimension is limited.
[0004] In addition, BIT (Built-In Self-Test) is usually used in the software of embedded computer products to detect the status of hardware, including power-on BIT, periodic BIT, startup BIT, maintenance BIT, etc. The number of test cases that can be written in this way is limited, the testing dimension is single, and the software testing coverage that can be achieved is limited. Moreover, in some fields with strict requirements for high security and high reliability of embedded software, for Class A software systems, object code verification must be carried out. Such as aerospace vehicles, power grid control, high-speed trains, and backbone network communication.
[0005] Therefore, there is a need to provide a testing method that can provide more-dimensional input information for source code coverage statistical analysis and object code structure coverage analysis tools, and has a high software testing coverage. Summary of the Invention
[0006] In order to solve the above problems, the purpose of the present invention is to provide a method for testing embedded computer software.
[0007] To achieve the above object, the technology provided by the present invention is as follows. The method includes the following steps:
[0008] S1: Modify the target embedded computer code according to the needs of adapting to source code coverage statistical analysis testing, object code structure coverage statistical analysis testing, and software defect location testing;
[0009] S2: Capture the real-time data during the operation of the target embedded computer application software and store it in the PC for test analysis.
[0010] S3: Based on the real-time data obtained in S2, conduct source code coverage statistical analysis tests, object code structure coverage statistical analysis tests, and software defect location tests on the PC for test analysis.
[0011] The embedded computer software testing method provided by the present invention further has the following characteristics. S1 includes:
[0012] S1.1: Add driver test software code.
[0013] S1.2: Conduct adaptation modifications for source code coverage statistical analysis tests.
[0014] S1.3: Modify the result output module code to add print information.
[0015] S1.4: Modify the BIT test software code to add a serial port control test interface menu and options.
[0016] The embedded computer software testing method provided by the present invention further has the following characteristics. S1.1 includes:
[0017] S1.1.1: Add discrete quantity acquisition driver software code to the embedded computer platform software, obtain the original discrete quantity acquisition data, and perform data filtering.
[0018] S1.1.2: Add analog quantity and frequency quantity acquisition driver software code to the embedded computer platform software, obtain the original analog quantity and frequency quantity acquisition data, and perform data filtering.
[0019] S1.1.3: Add serial port communication driver software code.
[0020] S1.1.4: Add a virtual SRAM read / write interface driver.
[0021] The embedded computer software testing method provided by the present invention further has the following characteristics. S2 includes:
[0022] S2.1: Capture the original data of the CPU's address bus and data bus during the startup to end operation of the embedded computer platform test software through a source code coverage statistical analysis tool.
[0023] S2.2: Capture the dynamic information of the object code during the operation of the embedded computer platform test software through an object code structure coverage statistical analysis tool.
[0024] S2.3: Use a software defect localization test tool to capture the original data of the external excitation before CPU acquisition during the startup to end operation of the test software on the embedded computer platform.
[0025] The embedded computer software test method provided by the present invention further has the following characteristics. S2.1 includes:
[0026] S2.1.1: Perform partition stubs on the source code to be tested and compile to generate the stubbed object code file.
[0027] S2.1.2: Use a source code coverage statistical analysis tool to capture the original data of the CPU's address bus and data bus during the operation of the embedded computer application software and store it in the analysis PC.
[0028] The embedded computer software test method provided by the present invention further has the following characteristics. S2.2 includes:
[0029] S2.2.1: Download and execute the object code program, and confirm that the monitoring agent is in a ready state through the RS232 serial port tool.
[0030] S2.2.2: Run the monitoring test program, record the dynamic information of the object code operation, and store it in the physical storage area.
[0031] S2.2.3: Run the serial port debugging assistant to receive and store the data printed and transmitted by the embedded computer monitoring agent.
[0032] The embedded computer software test method provided by the present invention further has the following characteristics. S2.3 includes:
[0033] S2.3.1: Start the embedded computer.
[0034] S2.3.2: Control the embedded computer through external excitation and execute the application functions one by one according to the test cases.
[0035] S2.3.3: Use a software defect localization test tool to collect analog quantity, frequency quantity, and discrete quantity data and record them.
[0036] The embedded computer software test method provided by the present invention further has the following characteristics. S3 includes:
[0037] S3.1: Use an analysis test tool to perform source code coverage statistical analysis operations.
[0038] S3.2: Use an analysis test tool to perform object code structure coverage statistical analysis operations.
[0039] S3.3: Use an analysis test tool to perform software defect localization statistical analysis operations.
[0040] The embedded computer software testing method provided by the present invention further has the following feature that the analysis and testing tool is the VerOSource tool.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] The present invention provides an embedded computer software testing method. Without changing the functional performance of the embedded computer product and the original system hardware and software architecture, by expanding the product testing interface, designing drivers and stubs, three-dimensional input information is provided for source code coverage statistical analysis, object code structure coverage, and analysis of software defect location tools, thereby improving the coverage rate of software testing and providing test support for the overall machine functional performance, software task real-time performance / reliability, etc. The present invention has the characteristics of multi-dimension, high test coverage rate, high portability, etc., and has a wide range of application scenarios in the testing field. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 The flowchart of the testing method provided by the embodiment of the present invention;
[0045] Figure 2 The logical schematic diagram of the testing environment where the testing platform used in the testing method provided by the embodiment of the present invention is located;
[0046] Figure 3 The virtual SRAM structure diagram of the testing provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] In order to make the technical means, creative features, achieved purposes and effects of the present invention easy to understand, the following embodiments will specifically describe the testing method provided by the present invention in conjunction with the accompanying drawings.
[0048] In the description of the embodiments of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0049] In addition, the terms "first", "second", "third", etc. are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more.
[0050] The terms "mounted", "connected", and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood through specific circumstances.
[0051] As Figures 1-3 shown, the software and hardware are monitored and tested in real time through the following steps to provide more dimensional input information for the source code coverage statistical analysis and the object code structure coverage analysis tool, and improve the coverage rate of software testing. The specific testing steps of this embodiment are as follows:
[0052] S1: Modify the target embedded computer code to adapt to the source code coverage statistical analysis test, the object code structure coverage statistical analysis test, and the software defect location test.
[0053] S1.1: Add driver software code.
[0054] S1.1.1: Add discrete quantity acquisition driver software code. The target embedded computer platform software obtains the original discrete quantity acquisition data from the specified register, and then filters the acquired data: if the values of three consecutive beats are the same, the value of this beat is used as the processing result; otherwise, the result of the previous beat is used as the processing result.
[0055] S1.1.2: Add analog quantity and frequency quantity acquisition driver software code. The target embedded computer platform software obtains the original analog quantity and frequency quantity acquisition data from the specified address, and then filters the acquired data: calculate the average value of the original data values acquired within a certain period to obtain the processing result of the analog quantity and frequency quantity.
[0056] S1.1.3: Add serial communication driver software code. The target embedded computer platform software implements the RS232 serial port data transceiver function.
[0057] S1.1.4: Add a virtual SRAM read / write interface driver.
[0058] S1.2: Modify the code of the core execution unit, adapt and modify the statistical analysis test of source code coverage, and perform instrumentation in the test software of the target embedded computer platform;
[0059] S1.3: Modify the code of the result output module and add necessary printing information;
[0060] S1.4: Modify the code of the BIT test software and add a serial port control test interface menu and options.
[0061] S2: Use the source code coverage statistical analysis tool, the object code structure coverage statistical analysis test tool, and software defect localization to capture the real-time data during the operation of the target embedded computer application software and store it in the test analysis PC.
[0062] S2.1: Use the source code coverage statistical analysis tool, as shown in the appendix Figure 2 to access the virtual SRAM logic in the PL through the virtual SRAM access interface, so as to capture the original data of the CPU's address bus and data bus during the startup to the end of the operation of the test software on the embedded computer platform.
[0063] S2.1.1: Perform partition instrumentation on the source code to be tested, compile and generate the instrumented object code file, and the number of instrumentations in each partition does not exceed 100;
[0064] S2.1.2: Use the source code coverage statistical analysis tool to capture the original data of the CPU's address bus and data bus during the startup to the end of the operation of the embedded computer application software and store it in the analysis PC.
[0065] S2.2: Use the object code structure coverage statistical analysis tool to capture the dynamic information of the object code during the operation of the test software on the embedded computer platform.
[0066] S2.2.1: Start the embedded computer, download and execute the object code program, and confirm that the monitoring agent is in a ready state through the RS232 serial port tool;
[0067] S2.2.2: Run the monitoring test program on the embedded computer, record the dynamic information of the object code operation, and store it in the specified physical storage area of the target embedded computer;
[0068] S2.2.3: Run the serial port debugging assistant on the PC side to receive and store the data printed and transmitted by the embedded computer monitoring agent.
[0069] S2.3: Use the software defect localization test tool to capture the original data of the external excitation before CPU acquisition during the startup to the end of the operation of the test software on the embedded computer platform.
[0070] S2.3.1: Start the embedded computer;
[0071] S2.3.2: Control the embedded computer through external excitation control and execute application functions one by one according to the test cases;
[0072] S2.3.3: During the process of executing application functions according to the test cases, collect analog quantity, frequency quantity, and discrete quantity data through the software defect location test tool and record them in the analysis PC.
[0073] S3: Use the analysis test software to conduct source code coverage statistical analysis test, object code structure coverage statistical analysis test, and software defect location test on the test analysis PC respectively.
[0074] S3.1: Use the VerOSource tool to perform source code coverage statistical analysis operations.
[0075] S3.1.1: Use the VerOSource tool to create a project in the analysis PC;
[0076] S3.1.2: Import the data collected in step 2-1 into the project;
[0077] S3.1.3: Use the VeroSource decision coverage and statement coverage analysis tools to perform analysis operations;
[0078] S3.1.4: Output a result list containing the source code coverage analysis certificate.
[0079] S3.2: Use the VerOCode tool to perform object code structure coverage statistical analysis operations.
[0080] S3.2.1: Use the VerOCode tool to create a project in the analysis PC;
[0081] S3.2.2: Import the data collected in step 2-2 into the project;
[0082] S3.2.3: Use the VerOCode analyzer to perform object code structure coverage analysis operations;
[0083] S3.2.4: Output a result list containing the object code coverage analysis certificate.
[0084] S3.3: Use the VerOSource tool to perform software defect location statistical analysis operations
[0085] S3.3.1: Import the data collected in step 2-3 into the project established in 3-1;
[0086] S3.3.2: Conduct a comparative analysis of the two groups of data according to the test case outline;
[0087] S3.3.3: Perform analysis operations;
[0088] S3.3.4: Output test results.
[0089] For the technical solutions provided by the above embodiments, through various system tests and installation verifications, the system runs stably and reliably, and can achieve multi-dimensional acquisition of product status information. This increases the number of writable test cases. With the cooperation of software defect location tools, source code coverage statistical analysis tools, and object code structure coverage statistical analysis tools, multi-dimensional and highly versatile software and hardware analysis and testing are achieved. In actual work, unit, component, and configuration item level tests were conducted on this controller. Before and after using the method of the present invention, the designed test cases increased from 3213 to 4581 cases, and for some units with a coverage rate not reaching 100%, the average coverage rate increased to 90%. In addition, this invention has been transplanted into a certain type of engine interface device, showing good portability.
[0090] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention. The above is only the preferred implementation manner of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and modifications can still be made, and these improvements and modifications should also be regarded as within the protection scope of the present invention.
Claims
1. An embedded computer software testing method, characterized in that, The method includes the following steps: S1: Modify the target embedded computer code according to the needs of adaption source code coverage statistical analysis testing, object code structure coverage statistical analysis testing, and software defect location testing; S2: Capture the real-time data during the operation of the target embedded computer application software and store it in the PC for test analysis; S3: Conduct source code coverage statistical analysis testing, object code structure coverage statistical analysis testing, and software defect location testing on the PC according to the real-time data obtained in S2; The S2 includes: S2.1: Capture the original data of the CPU's address bus and data bus from the start to the end of the operation of the embedded computer platform test software through the source code coverage statistical analysis tool; S2.2: Capture the dynamic information of the object code operation during the operation of the embedded computer platform test software through the object code structure coverage statistical analysis tool; S2.3: Capture the original data of the external excitation before CPU acquisition during the start to the end of the operation of the embedded computer platform test software through the software defect location testing tool.
2. The embedded computer software testing method according to claim 1, characterized in that The S1 includes: S1.1: Add driver test software code; S1.2: Conduct adaption modification for source code coverage statistical analysis testing; S1.3: Modify the code of the result output module and add print information; S1.4: Modify the BIT test software code and add a serial port control test interface menu and options.
3. The embedded computer software testing method according to claim 2, wherein The S1.1 includes: S1.1.1: Add discrete quantity acquisition driver software code to the embedded computer platform software, obtain the original discrete quantity acquisition data, and perform data filtering; S1.1.2: Add analog quantity and frequency quantity acquisition driver software code to the embedded computer platform software, obtain the original analog quantity and frequency quantity acquisition data, and perform data filtering; S1.1.3: Add serial port communication driver software code; S1.1.4: Add a virtual SRAM read / write interface driver.
4. The embedded computer software testing method according to claim 1, wherein The S2.1 includes: S2.1.1: Partition and instrument the source code to be tested, and compile to generate an instrumented object code file; S2.1.2: Use the source code coverage statistical analysis tool to capture the original data of the CPU's address bus and data bus during the operation of the embedded computer application software and store it in the PC for analysis.
5. The embedded computer software testing method according to claim 1, characterized in that The S2.2 includes: S2.2.1: Download and execute the object code program, and confirm that the monitoring agent is in a ready state through the RS232 serial port tool; S2.2.2: Run the monitoring test program, record the dynamic information of the object code operation, and store it in the physical storage area; S2.2.3: Run the serial port debugging assistant to receive and store the data printed and transmitted by the embedded computer monitoring agent.
6. The embedded computer software testing method according to claim 1, characterized in that The S2.3 includes: S2.3.1: Start the embedded computer; S2.3.2: Control the embedded computer through external excitation and execute the application functions one by one according to the test cases; S2.3.3: Collect analog quantity, frequency quantity, and discrete quantity data through the software defect location testing tool and record them.
7. The embedded computer software testing method according to claim 1, characterized in that The S3 includes: S3.1: Use the analysis test tool to perform source code coverage statistical analysis operations; S3.2: Use an analysis and testing tool to perform statistical analysis operations on the object code structure coverage; S3.3: Use an analysis and testing tool to perform statistical analysis operations on software defect localization.
8. The embedded computer software testing method according to claim 7, characterized in that The analysis and testing tool is the VerOSource tool.
Citation Information
Patent Citations
System and method for realizing universal type target code coverage rate testing based on JTAG (Joint Test Action Group) debug mode
CN104657263A
Software defect discovery method based on regional molecular graph mining
CN112395198A