Context: Security is vital to software developed for commercial or personal use. Although more organizations are realizing the importance of applying secure coding practices, in many of them, security concerns are not known or addressed until a security failure occurs. The root cause of security failures is vulnerable code. While metrics have been used to predict software vulnerabilities, we explore the relationship between code and architectural smells with security weaknesses. As smells are surface indicators of a deeper problem in software, determining the relationship between smells and software vulnerabilities can play a significant role in vulnerability prediction models. Objective: This study explores the relationship between smells and software vulnerabilities to identify the smells. Method: We extracted the class, method, file, and package level smells for three systems: Apache Tomcat, Apache CXF, and Android. We then compared their occurrences in the vulnerable classes which were reported to contain vulnerable code and in the neutral classes (non-vulnerable classes where no vulnerability had yet been reported). Results: We found that a vulnerable class is more likely to have certain smells compared to a non-vulnerable class. God Class, Complex Class, Large Class, Data Class, Feature Envy, Brain Class have a statistically significant relationship with software vulnerabilities. We found no significant relationship between architectural smells and software vulnerabilities. Conclusion: We can conclude that for all the systems examined, there is a statistically significant correlation between software vulnerabilities and some smells.
翻译:安全:安全对于为商业或个人使用而开发的软件至关重要。虽然更多的组织认识到应用安全编码做法的重要性,但在许多组织中,安全顾虑并不为人知或解决,直到发生安全故障。安全失灵的根本原因是脆弱的代码。虽然使用指标来预测软件的脆弱性,但我们探索了代码和建筑气味与安全薄弱环节之间的关系。由于气味是软件中更深问题的表面指标,确定气味和软件脆弱性之间的关系在脆弱性预测模型中可以起到重要作用。目标:本研究探索了气味和软件脆弱性之间的关系,以确定气味。方法:我们提取了三种系统(Apache Tomcat、Apache CXF和Android)的气味、方法、文件和软件级别。然后,我们比较了这些系统(Apache Tomcat、 Apache CXF和Android)的气味。我们比较了它们发生在脆弱类别中(据报含有脆弱代码和中等级(尚未报告的脆弱性的不可忽视的类别)的情况。结果:我们发现,脆弱阶层与非易感的阶层相比,更可能具有一定的气味。上帝阶级、复杂阶级、大类、大类、数据类、易变等、可、 和脑类、我们发现有相当严重的统计性。