Keil C51-based software source code and target code coverage rate analysis method and system

An analysis method and object code technology, applied in the field of KeilC51-based software source code and object code coverage analysis, can solve problems such as hidden dangers and difficulties, and achieve the effect of avoiding hidden dangers

Pending Publication Date: 2021-05-14
SHANGHAI AEROSPACE COMP TECH INST
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] (1) It is necessary to modify the compiled software, and the object code after instrumentation and the original software object code will inevitably have differences, which may lead to hidden dangers
[0004] (2) When the execution of multiple test cases requires multiple instrumentation analysis, since the target code after each instrumentation is different, when performing multiple test cases to perform software coverage statistics and summaries, it brings a great deal of trouble. difficulty

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Keil C51-based software source code and target code coverage rate analysis method and system
  • Keil C51-based software source code and target code coverage rate analysis method and system
  • Keil C51-based software source code and target code coverage rate analysis method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0032] refer to Figure 1-2 As shown, the present embodiment provides a kind of Keil C51-based software source code and object code coverage analysis method, it is characterized in that, method comprises:

[0033] Step S1: Build a software executable environment based on the Keil platform, and load information files including software source code, object code and M51 files.

[0034] In this embodiment, based on the Keil platform, further, the Keil platform is a microcontroller software development platform developed by Keil, a well-known software company, and is usually used for ARM core single-chip microcomputer development tools. The Keil platform provides a complete development solution including C compiler, macro assembly, linker, library management and a powerful emulation debugger, and these functions are combined through an integrated development environment (uVision). Therefore, building a software executable environment based on the Keil platform can be understood as...

Embodiment 2

[0053] refer to image 3 As shown, this embodiment provides a Keil C51-based software source code and object code coverage analysis system, using the analysis method of Embodiment 1. The system in this embodiment includes:

[0054] The loading unit 10 is used to build a software executable environment based on the Keil platform, and load information files including software source code, object code and M51 files.

[0055] The parsing unit 20 is used for parsing the loaded information files including software source code, object code and M51 file, and generating a correspondence relation file between software source code and object code PC addresses.

[0056] Execute use case unit 30, be used to utilize the software executable environment of Keil platform to carry out test case, and generate the object code execution result file of current use case by Keil order; And when executing a plurality of test cases, generate a plurality of object code execution result files .

[005...

Embodiment 3

[0060] This embodiment provides a computer device, including a memory and a processor, where computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor is made to perform the following steps. Step S1: Build a software executable environment based on the Keil platform, and load information files including software source code, object code and M51 files. Step S2: Analyzing the loaded information files including the software source code, object code and M51 file, and generating a correspondence relationship file relating the PC addresses of the software source code and the object code. Step S3: Execute the test case using the software executable environment of the Keil platform, and generate the object code execution result file of the current use case through the Keil command; and generate multiple object code execution result files when executing multiple test cases. Step S4: Merge and summar...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Keil C51-based software source code and target code coverage rate analysis method and system. The method comprises the following steps: S1, loading an information file including a software source code, a target code and an M51 file; s2, analyzing the loaded information file, and generating a corresponding relation file associated with PC addresses of a software source code and a target code; s3, executing the test case by utilizing a software executable environment of the Keil platform, and generating a target code execution result file of the current case through a Keil command; when the plurality of test cases are executed, generating a plurality of target code execution result files; and S4, merging and summarizing the execution condition of each instruction of the target code in the one or more target code execution result files to generate a target code coverage rate analysis file, and generating a software source code coverage rate analysis file according to the corresponding relation file. According to the method and system, the coverage rate analysis file of the software source code can be generated by utilizing the corresponding relation between the software source code and the target code, and the target code difference caused by instrumentation is avoided.

Description

technical field [0001] The invention relates to the field of software testing, in particular to a Keil C51-based software source code and object code coverage analysis method and system. Background technique [0002] In computer software testing, when performing coverage analysis in traditional testing methods, it is necessary to insert software source code or object code, insert output information, recompile and run the software, and obtain software coverage by analyzing output information. During the software testing process, the inventor of the present application found that the traditional testing method has the following defects: [0003] (1) It is necessary to modify the compiled software, and the object code after instrumentation and the original software object code will inevitably have differences, which may lead to hidden dangers. [0004] (2) When the execution of multiple test cases requires multiple instrumentation analysis, since the target code after each ins...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
CPCG06F11/3676G06F11/3684G06F11/3688G06F11/3692Y02D10/00
Inventor魏冬冬申臻于清华高赛军薛垒
OwnerSHANGHAI AEROSPACE COMP TECH INST