Search code examples
unit-testingtdd

Best practice for integrating TDD with web application development?


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.

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

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


Solution

  • 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.

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