A number of related courses form a curriculum group, but the construction of curriculum group and teaching are not relevant, which affects teaching effect. By using same teaching cases, students can gradually complete the course group, deepen their understanding of the course group and improve their practical skills. This paper proposes a case library generation scheme based on code automation technology, which uses a code automation tool to complete the reconstruction of case code, and can complete the construction of a high-quality case library of course group quickly.