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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:11:29+00:00 2026-05-11T17:11:29+00:00

How do you decide what to choose: use mock objects for a test OR

  • 0

How do you decide what to choose:

  1. use mock objects for a test OR
  2. create a test object/ object graph using an IoC framework and run test on that data
  • 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-11T17:11:30+00:00Added an answer on May 11, 2026 at 5:11 pm

    It depends what you are trying to test. Unit tests with collaborators mocked out are great because

    • They are really, really fast
    • They are small and easy to understand
    • They don’t have dependencies on the wider world which makes them easy to run
    • They provide excellent defect localisation

    However, pure unit tests cannot tell you if you have configured your objects correctly in your IoC container, if the database connection string works etc. You need a test which runs up your IoC container and really reaches out to the Db to prove these things.

    If you write as many of your tests as pure, standalone unit tests as possible then your build will stay fast. This is crucial, as a slow bulid gets run less. Even so, don’t forget to add a sprinkling of wired tests to prove that your application’hangs together’.

    For example, we have a (single) test for every service in our container that proves that we can request it from the IoC container. This proves we’re wired up, from then on it is unit tests all the way. We have lots of pure unit tests.

    The whole lot is then wrapped in some application level functional tests to prove that the app itself does what the user wants.

    The thing to bear in mind is the time cost of each test type. Moving from pure unit -> wired -> functional tests costs an order of magnitude of execution time and complexity when they break.

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • 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
  • Editorial Team
    Editorial Team added an answer I would have the following tables: User (UserID, firstname, lastname,… May 11, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer JKL parseXML is an awesome toolkit for that. http://www.kawa.net/works/js/jkl/parsexml-e.html May 11, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer Depending on the database engine you are using, there can… May 11, 2026 at 9:55 pm

Related Questions

I'm facing developing a new web app in the future and I'm wondering how
I am a little ashamed to say that I have never used an ORM;
I am building a system for distributing packages (.zip archives) created by different organizations.
I have a C# module responsible for acquiring the list of network adapters that
In a domain driven design where you're going for a non-anemic domain model how

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.