Random test is an important means to find and analyze charging pile faults. Aiming at the frequent occurrence of charging pile system faults, this paper proposes a generation method of charging pile detection strategy, which uses the Markov nature of the test process to model the test sequence as a random variable determined by Markov chain. Through Gibbs random sampling of the transfer sequence, a Markov chain is established to obtain the inherent minimum fault. The common substring search method is used to count the minimum fault information, and the minimum fault is re injected into the test strategy according to the suspicious degree, so as to improve the quality of the test strategy and reduce the number of test strategies. Finally, the effectiveness of the test strategy based on minimum fault is verified by the measured results. This method is helpful to determine the common fault causes, and has important guiding significance for reducing the risk caused by charging pile fault.