Although there have lots of studies on using static code attributes to identify defective software modules, there still have many challenges. For instance, it is difficult to implement the Apriori-type algorithm to predict defects by learning from an imbalanced dataset. For more accurate and understandable defect prediction, a novel approach based on class-association rules algorithm is proposed. Class-association rules are looked as a separate class label, which is a specific type of association rules that explores the relationship between attributes and categories. In an empirical comparison with four datasets, the novel approach is superior to other four classification techniques and accordingly, proved it's valuable for defect prediction.