In programming exercises, a few professors and assistants generally instruct many students. To conduct precise guidance, it is important for professors but difficult to detect the learning situation of each student, such as whether they are having difficulties in learning. However, there have been no effective methods for extracting occurrences of stumbling that do not result in compilation errors since most existing methods have targeted only those that do. In this research, we aimed at developing methods for detecting when inexperienced students make mistakes in expressing the intended processing as a program (i.e. stumbling in the construction of program logic). In this paper, we initially describe a method we developed for extracting candidates of such stumbling on the basis of an analysis of compilation histories. We also describe methods for estimating such stumbling from among extracted candidates by analyzing transitions in the similarity between source codes. Finally, we describe an experiment done using multiple methods of similarity calculation and discuss the characteristics of our methods on the basis of results.