arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2006.14553cs.SE
收藏

你记得测试你的代币吗?

Did You Remember to Test Your Tokens?

Danielle Gonzalez, Michael Rath, Mehdi Mirakhorli

摘要:

身份验证是确认系统用户身份的关键安全功能,通常在Spring Security等框架的帮助下实现。这是一个复杂的功能,应该在开发的所有阶段进行可靠的测试。单元测试是一种有效的技术,用于细粒度验证未广泛用于测试身份验证的特征行为。部分问题在于帮助开发人员进行单元测试安全特性的资源有限。大多数安全测试指南推荐的测试用例都是从“黑盒”或渗透测试的角度出发的。这些资源对于编写新的单元测试的开发人员,或者想要从安全性的角度来看待覆盖率的开发人员来说并不容易。在本文中,我们通过应用一种基于理论的方法来解决这些问题,通过分析来自53个开源Java项目的481个JUnit测试来识别令牌身份验证的常见(单元)测试用例。本研究的结果是一个开发人员友好的单元测试指南,该指南被组织为53个令牌身份验证测试用例的目录,代表了从我们分析的数据集中学习到的17个场景、40个条件和30个预期结果的独特组合。我们在测试指南中补充了常见的测试气味,以避免。为了验证测试指南的准确性和实用性,我们从选定的开发人员那里寻求反馈,其中一些人在我们的数据集中编写了单元测试。

英文摘要:

Authentication is a critical security feature for confirming the identity of a system's users, typically implemented with help from frameworks like Spring Security. It is a complex feature which should be robustly tested at all stages of development. Unit testing is an effective technique for fine-grained verification of feature behaviors that is not widely-used to test authentication. Part of the problem is that resources to help developers unit test security features are limited. Most security testing guides recommend test cases in a "black box" or penetration testing perspective. These resources are not easily applicable to developers writing new unit tests, or who want a security-focused perspective on coverage. In this paper, we address these issues by applying a grounded theory-based approach to identify common (unit) test cases for token authentication through analysis of 481 JUnit tests exercising Spring Security-based authentication implementations from 53 open source Java projects. The outcome of this study is a developer-friendly unit testing guide organized as a catalog of 53 test cases for token authentication, representing unique combinations of 17 scenarios, 40 conditions, and 30 expected outcomes learned from the data set in our analysis. We supplement the test guide with common test smells to avoid. To verify the accuracy and usefulness of our testing guide, we sought feedback from selected developers, some of whom authored unit tests in our dataset.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑