The invention relates to a MC / DC coverage rate determination method and device based on a
virtual machine and
terminal equipment. The method comprises the following steps: analyzing an application
source code file to obtain all conditional statements and conditional information, and sorting and simplifying the conditional statements and the conditional information to obtain an independent conditional
list and
corresponding conditional statement information; analyzing the
executable target code file to obtain the address of the conditional statement and the symbol
table information of the application program; adding an MC / DC coverage rate recording task in a
virtual machine running environment, reading the address of each conditional statement by the task, calculating the
truth value of each independent conditional simple logic expression and the
truth value of the whole conditional judgment expression when the
virtual machine runs to the address, and recording the coverage rate of each conditional statement; recording a file name, a function name, a line number, a judgment expression and a current execution
truth value list result of the current statement into a specific file; and analyzing the
record file after the operation of the virtual
machine is finished, and calculating to obtain the MC / DC coverage rate of the conditional statements in the execution process and the MC / DC coverage rate of all conditional statements in the
source code file of the application program.