The invention provides a method for improving annotation rate and annotation quality of open source codes. The method comprises the following steps of 1, establishing a code data server, and preprocessing the open source codes; 2, grading difficulty levels of code segments; 3, grading knowledge mastery levels of users; 3, pushing the code segments to the users of the corresponding levels accordingto the levels, thereby enabling the users to perform corresponding operations; and 5, pushing questions automatically generated for the code segments by a system to the users, performing answering bythe users, and if the answering is correct, displaying that the answering of the users is correct, and highlighting answers of the users; and if the answering is not correct, displaying that the answering of the users is wrong, and providing reference answers. According to the method, a batch of code segments with annotations and high-quality code annotations are formed after multi-time cyclic pushing; rich resources are provided for code reuse; the code retrieval efficiency of developers and the code reuse rate in a software development process are effectively improved; and the development efficiency is greatly improved.