The invention provides a guided symbol execution method based on static path analysis, which can quickly reach the position of the specified code, and provide the test input to reach the target code. Step 1: First, determine the detection target through static analysis, and find the code or instructions related to memory allocation in the target program; Step 2, obtain the path-related functions and basic blocks from the program starting point to the specified code point, and determine the path accessibility according to the path. Calculate the weights of these functions and basic blocks with distances and distances; step 3, preferentially select the static analysis reachable paths with large weights to traverse; step 4, static path analysis; step 5, correlate the paths obtained by static path analysis Function and basic block information are placed in Paths[funcs, bbs], all target instructions to be analyzed are stored in the Vector of allocCallInst, and all current path states are stored in states. When the symbolic execution engine executes the analysis on the target program, through the loop Interpret and execute the instructions in the program one by one.