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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:04:41+00:00 2026-05-15T14:04:41+00:00

There are two testing scenarios I am unclear on. Both appear at first sight

  • 0

There are two testing scenarios I am unclear on. Both appear at first sight to create very brittle tests.

First, when should one unit test the interface (i.e. verify that an interface has a set signature)?

Second, when should one “test the sequence diagram” (a term I just made up) – meaning verifying calls are being made to the appropriate objects?

  • 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-15T14:04:42+00:00Added an answer on May 15, 2026 at 2:04 pm

    Testing the interface means that you should only test the members which are available on the public interface. In other words, don’t test private stuff. Take the unit under test as a black-box. This makes the tests more maintainable because you can change the implementation details without breaking the tests. Tests will also express what your unit under test is good for, not how it is implemented.

    Testing calls made on other objects is called “interaction test” (not to be confused with integration tests, where you don’t mock the other objects). Interaction tests are needed when your unit under test calls a method on another object without depending on it. I try to explain it with an example.

    Following method needs to be tested:

    public decimal CalculateTax(Order order);
    

    Lets assume that this method needs to call

    TaxRules TaxRuleProvider.GetRules(Country country)
    

    which returns some local rules. When it doesn’t call it, it will not be able to return the correct result. It will miss vital information. You don’t need to test if it had been called, just test the result.

    Another method:

    public void StoreThingy(Thingy toBeStored);
    

    It will call

    public void NotificationBroker.NotifyChanges(SomeChanges x);
    

    StoreThingy doesn’t depend on the notification. You can’t decide on its interface if it sent notifications or not. You need to test this by an interaction test.

    Typically the methods for interaction tests return void. In this category are all kinds of events and notifications and methods like Commit().

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

Sidebar

Related Questions

There are two popular closure styles in javascript. The first I call anonymous constructor
There are two scenarios I need to clarify: An executable compiled with .NET 3.5
There are two databases in SQL Server 2005: One called A and another one
There are two different ways to create an empty object in JavaScript: var objectA
There are two pictureboxes with two different images. If I click on one picture
There are two threads. One is an events thread, and another does rendering. The
there are two databases to compare,but I can't connect one database directly. so I
Suppose there are two types of messages, QUOTE and TRADE. Both have different fields.
In the boost, there are two types of libs, one is ending with mt-gd
I'm having some problems with encapsulation in C#. There are two specific scenarios that

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.