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

  • SEARCH
  • Home
  • 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 61875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:23:15+00:00 2026-05-10T18:23:15+00:00

I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he

  • 0

I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like:

public Decimal DiscountPrice {    get    {        return this.Price - this.Discount;    } } 

Would have a test like:

[TestMethod] public void Test_DiscountPrice {     Product p = new Product();     p.Price = 100;     p.Discount = 20;     Assert.IsEqual(p.DiscountPrice,80); } 

While, I am all for unit testing, I sometimes wonder if this form of test first development is really beneficial, for example, in a real process, you have 3-4 layers above your code (Business Request, Requirements Document, Architecture Document), where the actual defined business rule (Discount Price is Price – Discount) could be misdefined.

If that’s the situation, your unit test means nothing to you.

Additionally, your unit test is another point of failure:

[TestMethod] public void Test_DiscountPrice {     Product p = new Product();     p.Price = 100;     p.Discount = 20;     Assert.IsEqual(p.DiscountPrice,90); } 

Now the test is flawed. Obviously in a simple test, it’s no big deal, but say we were testing a complicated business rule. What do we gain here?

Fast forward two years into the application’s life, when maintenance developers are maintaining it. Now the business changes its rule, and the test breaks again, some rookie developer then fixes the test incorrectly…we now have another point of failure.

All I see is more possible points of failure, with no real beneficial return, if the discount price is wrong, the test team will still find the issue, how did unit testing save any work?

What am I missing here? Please teach me to love TDD, as I’m having a hard time accepting it as useful so far. I want too, because I want to stay progressive, but it just doesn’t make sense to me.

EDIT: A couple people keep mentioned that testing helps enforce the spec. It has been my experience that the spec has been wrong as well, more often than not, but maybe I’m doomed to work in an organization where the specs are written by people who shouldn’t be writing specs.

  • 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. 2026-05-10T18:23:16+00:00Added an answer on May 10, 2026 at 6:23 pm

    First, testing is like security — you can never be 100% sure you’ve got it, but each layer adds more confidence and a framework for more easily fixing the problems that remain.

    Second, you can break tests into subroutines which themselves can then be tested. When you have 20 similar tests, making a (tested) subroutine means your main test is 20 simple invocations of the subroutine which is much more likely to be correct.

    Third, some would argue that TDD addresses this concern. That is, if you just write 20 tests and they pass, you’re not completely confident that they are actually testing anything. But if each test you wrote initially failed, and then you fixed it, then you’re much more confident that it’s really testing your code. IMHO this back-and-forth takes more time than it’s worth, but it is a process that tries to address your concern.

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

Sidebar

Related Questions

Watching few examples that use repository pattern like StoreFront I couldn't figure out where
I'm currently watching Mule 101: Demonstrations of all things Mule tutorial because I was
I was watching today's Microsoft's Keynote at CES 2012 and noticed the demonstrator searching
Watching SO come online has been quite an education for me. I'd like to
I am currently watching a video from 27C3 and I would like to filter
I'm watching ECMA-262 (JavaScript 5 edition) and cannot understand what is code unit value?
i am watching this tutorial. at around 15:40, the speaker said something like a
Watching multiple elements in a form, I would like to enable the submit button
After watching: The Clean Code Talks -- Inheritance, Polymorphism, & Testing I checked my
I was watching a video on KhanAcademy: http://www.khanacademy.org/video/insertion-sort-in-python?playlist=Computer+Science And i noticed the IDE he

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.