As the primary cause of software defects, human error is the key to understanding, and perhaps to predicting and avoiding them. Little research has been done to predict defects on the basis of the cognitive errors that cause them. This paper proposes an approach to predicting software defects through knowledge about the cognitive mechanisms of human errors. Our theory is that the main process behind a software defect is that an error-prone scenario triggers human error modes, which psychologists have observed to recur across diverse activities. Software defects can then be predicted by identifying such scenarios, guided by this knowledge of typical error modes. The proposed idea emphasizes predicting the exact location and form of a possible defect. We conducted two case studies to demonstrate and validate this approach, with 55 programmers in a programming competition and 5 analysts serving as the users of the approach. We found it impressive that the approach was able to predict, at the requirement phase, the exact locations and forms of 7 out of the 22 (31.8%) specific types of defects that were found in the code. The defects predicted tended to be common defects: their occurrences constituted 75.7% of the total number of defects in the 55 developed programs; each of them was introduced by at least two persons. The fraction of the defects introduced by a programmer that were predicted was on average (over all programmers) 75%. Furthermore, these predicted defects were highly persistent through the debugging process. If the prediction had been used to successfully prevent these defects, this could have saved 46.2% of the debugging iterations. This excellent capability of forecasting the exact locations and forms of possible defects at the early phases of software development recommends the approach for substantial benefits to defect prevention and early detection.
翻译:作为软件缺陷的主要原因,人为错误是理解、预测和避免这些缺陷的关键。根据导致这些缺陷的认知错误,我们很少进行研究,以预测缺陷。本文件提出一种通过了解人类错误认知机制来预测软件缺陷的方法。我们的理论是,软件缺陷背后的主要过程是,容易出错的情景触发了人为错误模式,心理学家观察到在各种活动中反复出现。然后,根据对典型错误模式的这种了解,软件缺陷可以通过查明这种情景来预测。拟议的理念强调预测一个可能的缺陷的确切位置和形式。我们进行了两个案例研究,以展示和验证这一方法,有55个程序员在编程竞争中,5个分析员作为方法的用户。我们发现,软件缺陷背后的主要过程是,在需求阶段,22种(31.8%)中,有7种确切的位置和形式,心理学家观察到的缺陷可能是常见的缺陷。这些缺陷的发生率占55个程序缺陷总数的75.7%;这些缺陷的出现率是预估的缺陷,其中每一种是预估的缺陷,这些缺陷是预估的。