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 6724843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:44:14+00:00 2026-05-26T09:44:14+00:00

I’ve been reading up on unit testing, TDD, and the SOLID principles and I

  • 0

I’ve been reading up on unit testing, TDD, and the SOLID principles and I need some clarification. My understanding is that if one adheres to the open/closed principle, unit testing could become largely unnecessary due to the fact that the code is closed to modification – thus there is no need to retest if the code is properly isolated and decoupled. The longterm benefit of the added upfront cost of unit testing is lost if once the code passes related unit tests it will not change. The code will always pass because it will never change, right? Inherited classes will need to be tested, but once they pass related tests, they too will be closed to modification and will not need to be retested. The Wikipedia article on OCP reinforces this line of thought in the first paragraph, (I realize that doesn’t make it law).
The best explanation I’ve found for OCP and TDD living in harmony is here, though it seems that Arnon is saying that OCP compliments TDD in that the developer is discouraged from modifying source code because existing test methods can become complex when modified to test new functionality.
Is that all there is to it? Mind you that I’m not looking for an argument, I’m new to this and I’m looking for clarification from those with more experience with the subject than I.

  • 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-26T09:44:15+00:00Added an answer on May 26, 2026 at 9:44 am

    Even if you were to accept that once software works and doesn’t change, you don’t need to test it (which I don’t), you still need to show that a component works in the first place. I would argue one of the best ways to do that is a unit test(s).

    Also, practically speaking, once you have the test, it costs very little to run it. So even if components don’t change, you aren’t losing much by continually running the tests. Furthermore, sometimes design changes and you need to go back and redo some components — having unit tests definitely helps in this case…

    Remember, one result of having a test suite is that it promotes maintainability by showing when something changes. So even if your team is following the O in SOLID, that doesn’t mean that things won’t get changed accidentally. So the tests help there by showing if something is changed inadvertently, and they show you exactly what was affected by the change.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but

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.