The invention discloses a
code coverage rate statistical method and device,
computer equipment and a storage medium, and relates to the technical field of
embedded software, and the
code coverage rate statistical method comprises the steps that in the SSD running process, through
timer interruption of a CPU, a PC pointer before interruption is collected in an interruption
processing function; recording the collected PC pointer and the corresponding access times in a preset coverage rate statistical table; storing the coverage rate statistical table into an
NAND flash memory of the SSD; and reading the coverage rate statistical table from the
NAND flash memory, and generating a coverage rate
data file through an analysis tool based on the coverage rate statistical table and an
executable program file of the
firmware of the SSD. According to the method, the PC pointer before interruption is acquired in a non-intrusive manner through interruption of the CPU
timer, so that code expansion and
resource consumption caused by code
instrumentation are avoided; recording a PC pointer and the number of access times in a statistical table and storing the statistical table in an
NAND flash memory to realize
data recovery after power failure; finally, the coverage rate report is generated by combining
executable file analysis, and the method is suitable for embedded scenes such as an SSD controller with
limited resources.