Technology Radar
Published : Oct 23, 2024
NOT ON THE CURRENT EDITION
This blip is not on the current edition of the Radar. If it was on one of the last few editions, it is likely that it is still relevant. If the blip is older, it might no longer be relevant and our assessment might be different today. Unfortunately, we simply don't have the bandwidth to continuously review blips from previous editions of the Radar.
Understand more
Oct 2024
Adopt
自动化测试仍然是高效软件开发的基石。对于前端测试,我们可以讨论测试类型的分布是否应该采用经典的测试金字塔 模型,还是应该采用奖杯形状。然而,无论是哪种模型,团队都应专注于 组件测试 ,因为测试套件应该稳定且快速运行。相反,我们看到的是,团队放弃了对组件测试的掌握,而更倾向于端到端的基于浏览器的测试以及非常狭隘定义的单元测试。单元测试往往迫使组件暴露本应是纯内部的功能,而基于浏览器的测试则运行缓慢,更容易出错且更难调试。我们的建议是进行大量的组件测试,并使用类似jsdom这样的库在内存中运行组件测试。当然,像Playwright这样的浏览器工具仍然适用于端到端的测试,但不应用于组件测试。