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

Ask A Question

Stats

  • Questions 72k
  • Answers 72k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Use synchronization between your threads ! You should look into… May 11, 2026 at 1:33 pm
  • added an answer The functions in time.h are standard - they are available… May 11, 2026 at 1:33 pm
  • added an answer What about treating Results.Value as if it were a numeric… May 11, 2026 at 1:33 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.