将 TDD 与 Web 应用程序开发集成的最佳实践? [英] Best practice for integrating TDD with web application development?

查看:30
本文介绍了将 TDD 与 Web 应用程序开发集成的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单元测试和 ASP.NET Web 应用程序在我的小组中是一个模棱两可的点.通常情况下,良好的测试实践会失败,而 Web 应用程序最终会在没有测试的情况下上线数年.

Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests.

这个痛点的原因通常围绕着编写 UI 自动化中期开发的麻烦.

The cause of this pain point generally revolves around the hassle of writing UI automation mid-development.

您或您的组织如何将最佳 TDD 实践与 Web 应用程序开发相结合?

How do you or your organization integrate best TDD practices with web application development?

推荐答案

如果您适当地分离层,就可以实现单元测试.正如 Rob Cooper 暗示的那样,不要在您的 WebForm 中放置任何逻辑,而不是管理您的演示文稿的逻辑.所有其他的东西逻辑和持久层应该保存在单独的类中,然后你可以单独测试它们.

Unit testing will be achievable if you separate your layers appropriately. As Rob Cooper implied, don't put any logic in your WebForm other than logic to manage your presentation. All other stuff logic and persistence layers should be kept in separate classes and then you can test those individually.

为了测试 GUI,有些人喜欢 selenium.其他人则抱怨设置起来很麻烦.

To test the GUI some people like selenium. Others complain that is a pain to set up.

这篇关于将 TDD 与 Web 应用程序开发集成的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆