In order to accurately obtain the Java program function calling path, and for facilitating automated testing and automatic test cases generation, the article puts forward an algorithm of Java function calling relation extraction based on Soot open source tools. Firstly, statically analyze within a single function calling relationship, define the function calling tree, and analyze the relationship between a single function calling tree and the program function calling graph. Then by combining algorithm to generate the process the function calling graph. Experiments prove that this algorithm can accurately and efficiently generate the Java function calling graph, and can guide the testers to design high efficiency and high coverage test cases.