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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:43:48+00:00 2026-06-17T17:43:48+00:00

I’ve recently been working on a project that has started to get fairly dependency

  • 0

I’ve recently been working on a project that has started to get fairly dependency heavy and have been exploring the idea of using an AutoMocking container to clean up my tests a bit and make them less brittle.

I’ve heard arguments against using them by TDD/BDD purists, stating things like: It isn’t immediately obvious which dependencies are required by the test subject, or you can add dependencies that you don’t really need. Neither sounds like a particularly strong argument against using them.

From my perspective, introducing one would allow me to refactor as required, removing and introducing dependencies in line with business requirements, without constantly having to return to the tests and introduce new mocks/stubs just to get the code to compile.

Is AutoMocking considered to be a good/bad practice? Are there specific situations when it should be or should not be used?

  • 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-06-17T17:43:49+00:00Added an answer on June 17, 2026 at 5:43 pm

    As with any tool or process, there are correct times and incorrect times to use them. Nothing is a silver bullet. You have to ask yourself “will this help me get my job done?” And at the end of our day, our job is to provide the most business value we can for the buck.
    When doing greenfield development, automocking isn’t as helpful. Everything is being developed from scratch, and TDD/BDD techniques with “traditional” mocking works great. Theoretically, the dependencies aren’t changing that drastically, and when they are, it’s probably good to know when you are breaking things.

    When in maintenance mode (or dealing with a legacy codebase), automocking can prove to be extremely beneficial. For example, you are tasked with cleaning up technical debt. This will probably involve a lot of refactoring, and being able to isolate your tests from these changes is a huge timesaver. Keep in mind that if your code has a lot of dependencies, it’s probably breaking SOLID and SOC, and you will (or at least should) have many tests that don’t utilize all of the dependencies. So automocking in this case is extremely beneficial. Of course there are many other examples where it helps as well.

    As with any tool, you have to make sure that it doesn’t become a crutch. Leveraging automocking so you can change interfaces and apis willy-nilly is obviously an anti-pattern. But when used correctly, I have found it to be a huge benefit to our project teams.

    It just requires critical thought and application in the correct scenarios.

    • 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
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.