> For the complete documentation index, see [llms.txt](https://docs.flydean.com/spring-framework-documentation5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flydean.com/spring-framework-documentation5/testing.md).

# 测试

本章介绍Spring对集成测试的支持和单元测试的最佳实践。 Spring团队提倡测试驱动开发（TDD）。 Spring团队发现正确使用控制反转（IoC）肯定会使单元测试和集成测试更容易（因为类的setter方法和适当的构造函数的存在使得它们更容易在测试中连接在一起而不必设置服务定位器注册表和类似结构）。
