Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 258867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:12:59+00:00 2026-05-11T22:12:59+00:00

I know that the reason that Microsoft came out with ASP.NET MVC was to

  • 0

I know that the reason that Microsoft came out with ASP.NET MVC was to make it simpler to do Test Driven Design (TDD) for ASP.NET. However, I have a rather large brown field (existing) application in ASP.NET WebForms that I would love to implement some TDD type functionality in. I’m assuming that there IS a way to do this, but what are some viable options?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:12:59+00:00Added an answer on May 11, 2026 at 10:12 pm

    Microsoft introduced ASP.NET MVC because they thought they could make money from an untapped market – those who feel that Web Forms are too “heavyweight”, and who are programming using a lighter-weight framework. This includes those who are accustomed to the MVC paradigm.

    It also includes those who couldn’t figure out how to do unit tests in web forms, and who want to use unit tests and TDD.

    The way to do it with web forms, as with anything else, is to separate everything but the UI code into separate classes in a class library. Use TDD to develop those classes.

    The next layer of controversy is whether it’s necessary to use TDD to develop the remainder of the code: the markup, client-side code, user interactions, etc. My answer is that if you’ve got the rest isolated and tested, that it’s not worth the trouble to use TDD for this.

    Consider: your pages need to have a particular appearance. Are you going to write a failing unit test to prove that you are using CSS correctly? To prove that you’re using the correct CSS styles? I don’t think so.


    To clarify: In TDD, we start with a failing unit test. We then make the simplest possible changes that will make the test succeed.

    Imagine using TDD for a web page. What failing tests will you produce?

    1. Test that page is well-formed HTML
    2. Test that page includes the correct title
    3. Test that page includes
      1. “Enter ID” label
      2. An id textbox
      3. A data grid
      4. A “Go” button
    4. Test that data grid is empty after a GET
    5. Test that grid loads with data from customer 1 when “1” is entered into the text box and “Go” is clicked.

    And none of the above tests for the appearance of the page. None of it tests the client-side behavior of any JavaScript on the page.

    I think that’s silly. Instead, test your DAL method that retrieves data based on the ID. Make sure it returns the correct ID for id 1. Then, how long will it take to manually test the page to make sure it looks correct, you can enter the “1” and click “Go”, and that the data that appears in the grid is the correct data for customer 1?

    Test-Driven Development and automated unit tests are meant to test behavior. The UI of a web form is mostly declarative. There’s a large “impedance mismatch” here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that Stack Exchange sites do not use the ASP.NET MVC built-in @Html.AntiForgeryToken()
I think Microsoft must have a reason for enhancing ASP.Net with RAZOR syntax. On
I know that this may be an amateur question but for some reason I
I like to know is there any specific reason that there is no public
I know that this line of code will make the cell text-wrap: $objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setWrapText(true); 'D1'
I've noticed in a lot of Microsoft .NET classes that there's often a non-abstract/virtual
This is a question for the .NET philosophers: It is my understanding that Microsoft
I would like to know the reasons that we do refactoring and justify it.
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.