论文标题

您记得要测试您的令牌吗?

Did You Remember to Test Your Tokens?

论文作者

Gonzalez, Danielle, Rath, Michael, Mirakhorli, Mehdi

论文摘要

身份验证是确认系统用户身份的关键安全功能,通常在Spring Security等框架的帮助下实现。这是一个复杂的功能,应在开发的所有阶段进行核对测试。单位测试是一种有效的技术,用于对未广泛使用以测试身份验证的特征行为进行细粒度验证。问题的一部分是,帮助开发人员单元测试安全功能的资源有限。大多数安全测试指南都建议在“黑匣子”或渗透测试的角度使用测试用例。这些资源不容易适用于编写新单元测试的开发人员,或者希望对覆盖范围有以安全为中心的观点。 在本文中,我们通过采用基于理论的基础方法来解决这些问题,以通过分析481个JUNIT测试来识别常见的(单位)测试用例,从而从53个开源Java Projects中行使基于春季安全的身份验证实现的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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源