提出一种通用且高效的隐式规则自动提取与反例检测方法,使用频繁闭合项集挖掘技术挖掘包含多种程序元素的编程模式,然后由编程模式产生编程规则;引入正序规则的概念,以避免从同一个编程模式中产生多个冗余规则.在此基础上,提出一种高效的反例检测算法检测违反规则的程序片段.实验结果表明,该方法能够自动提取程序中存在的隐式编程规则,并快速有效地检测违反规则的反例.
A general and efficient method is proposed to automatically extract the roles and detect violations to the rules extracted. Closed frequent itemset mining is applied to mine programming patterns. Then these patterns are used to generate programming rules. The concept of Positive Order Rule is introduced to avoid generating redundant roles from the same programming pattern. Based on these efforts, we also propose an efficient violations detection algorithm to detect program segments that are not consistent with the extracted roles. The experiment results on large software source code indicate that this method can automatically extract lots of implicit programming rules and also can efficiently detect the code segments that violate the extracted rules.