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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:26:55+00:00 2026-05-12T05:26:55+00:00

I have a persistent object with 7 pertinent fields. The fields can hold the

  • 0

I have a persistent object with 7 pertinent fields.

The fields can hold the number of values listed here:

Field    # of Possible Values
1        5
2        20
3        2
4        2
5        19
6        2
7        8

Which is a potential for 121600 unique objects.

The code under test is a number of filters that grab a certain number of these objects based on the values of their fields, and then puts them in a bin for use by another system. The bin depositing is trivial, tested, and works properly… it’s just that the filtering isn’t working. There seems to be many edge cases that aren’t being covered and many objects are being placed in a bin when they shouldn’t be selected at all or vice versa.

All in all, there are 9 filters which operate in a chain of responsibility, each filter putting objects in a bin until the bin is full, at which point the chain exits. The last filter in the chain is simply a ‘filter’ that sends an e-mail to an admin noting that the objects are running low (ie, if the chain reached this filter, then the bin isn’t full, and something needs to be looked at).

So my problem is this: How do I test these filters? I could create one of each unique type of object using a series of for statements:

public void FixtureSetup()
{
    for(each possible value for field 1)
    {
        for(each possible value for field 2)
        {
            // ... continue with 5 more for statements

            // Create Object with each value
        }
    }
}

But trying to manually figure out what objects should be properly filtered from the resulting collection (even the collection of filtered objects) would be terribly difficult (and if possible, I would have easily done it when I first wrote the filters).

I’m aware that the requirements are at fault because they say something like:

filter 1 gets
    - field 1: values 1/2/3
    - field 2: values 2/3/4
    - etc.

but the results are showing so many edge cases, that each time I change it to include that particular case, something else breaks (and I have no regression tests to ensure that it doesn’t) and it’s difficult to find out where in the chain the particular issue occurred.

edit> I am trying to test the filters separately, however assume the following:

filter 1 grabs 500 of the 121600 possible objects (according to the filter’s criteria). I’m finding that, say 100 (complete guess) of those objects that are grabbed, shouldn’t be – and for varying reasons. In order to know, I’d have to go through each one with the user(s) of the other system to know if the result set of each filter is correct. The opposite to that also lingers in my mind… what about all of the object that should have been grabbed, but weren’t.

I’m starting to think that this might be a problem in requirements gathering, and not testing.

  • 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-12T05:26:55+00:00Added an answer on May 12, 2026 at 5:26 am

    It sounds like you do not have a clear spec. If you don’t have a clear spec then how can you possibly know whether the code works according to spec?

    Take a step back. Start by writing a one sentence spec:

    The FrobFilter component takes a sequence of Frobs and places each one in the correct FrobBin until one bin is full.

    OK, now you’ve got a specification. It’s not a testable or implementable specification yet. Why not? Two reasons.

    Reason One: the consequence of no FrobBin filling up before the Frob sequence runs out has not been specified.

    Reason Two: “correct” is not specified.

    Now write a one-sentence spec that addresses each concern.

    If the sequence ends before some bin is full then the administrator is notified.

    The correct bin for a Frob such that Blargh is Gnusto is always the FrotzBin.

    OK, now you have two more problems. How is the administrator notified? And what happens if the Frob’s Blargh is not a Gnusto?

    Just keep on breaking it down, one sentence at a time, until you have a complete and accurate spec. Then you’ll find that your spec, the program which implements, and the test cases all look remarkably like each other. And that is an awesome situation to be in.

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

Sidebar

Ask A Question

Stats

  • Questions 210k
  • Answers 210k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I have done some more digging around and it appears… May 12, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer The closest thing is TOP: Select top 5 * from… May 12, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer This msdn link is the last word on the subject:… May 12, 2026 at 9:55 pm

Related Questions

Here is My Code To Log In var expire = DateTime.Now.AddDays(7); // Create a
I am looking at some code (Delphi 7) with following check is at the
I want to create light object data-package to pass between client and server applications.
I have a persistent class Author with two fields: int id , String name

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.