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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:43:52+00:00 2026-05-24T10:43:52+00:00

I am trying to come up with a test case for a Queue class

  • 0

I am trying to come up with a test case for a Queue class that I have not yet implemented. While trying to write the code for testEnqueue method I could not find ways to verify apart from using size() or dequeue().

Is it fine to to use other public methods(for ex: size/dequeue) to verify the test case for a public method(enqueue) of the same class?

  • 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-24T10:43:53+00:00Added an answer on May 24, 2026 at 10:43 am

    As I understand you see a classical chicken and egg problem here – how can you test a() and verify its behavior using b() and then test b() by using a(). From theoretical perspective if both of them are incorrect, the test might still pass… It’s like testing JUnit using JUnit.

    However if you treat your code as a black-box (which is the case when doing TDD) and you just write tests that give your class/unit some input and verify the output, there is nothing wrong with this approach. Just remember to test all the typical cases and corner cases/border conditions – if they match your business expectations, what could be wrong?

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

Sidebar

Related Questions

I am trying to test out MVVMLight but the DLLs that come with it
While trying to get a legacy codebase under test, I've come across an object
I'm trying to test my site under heavy load. I have found that the
I have come across a weird compiler error (using VC2010) while trying to compile
I am trying to get better at c++. I have a Test class and
I'm trying to run the test scripts that come with JanRain's php openid libraries.
I'm trying to come up with a Java regex that will match a filename
I am trying to come up with such a solution that the user is
I'm trying to come up with a reusable JS or jQuery function that would
I was trying to come up with obscure test cases for an alternative open-source

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.