The invention discloses a code compatibility evaluation method oriented to software evolution, and analyzes and positions evolution reasons. The code compatibility evaluation method comprises the following steps: according to a source code, constructing a corresponding abstract syntax tree; extracting the attribute information of a class and an interface on the abstract syntax tree, and constructing a class model of the code; and on the basis of a binary compatible rule, carrying out evolution type distinguishing on the code, calculating the code compatibility, and showing an evaluation result. The technology can report reasons which cause the compatibility changes of the code according to a position where incompatibility evolution happens. The evaluation method automatically analyzes the source code, points out the position where incompatibility evolution happens in a program, solves the problems of subjectivity and low efficiency since manual search needs to be carried out when an incompatibility problem happens during code distribution, and lays a good foundation for automatically evaluating the code compatibility.