An ant-based test construction method is proposed for cognitive diagnosis models. The method is the first use of ant colony optimization in the problem. The method outperforms traditional methods in test quality and search speed. An adaptation strategy for the design of heuristic information is proposed. The strategy improves ant algorithms in search efficiency and exploration ability.