c# - How would you test something that filters complex objects -


I have a persistent object with 7 provincial areas. <

The number of values ​​listed here Can hold:

  area of ​​possible value # 1 5 2 20 3 2 4 2 5 19 6 2 7 8  

For 121600 unique objects Which is probable

There are several fields of code under test that gets a certain number of these objects based on the values ​​of these fields, Puts in a bin for use of Tm bin trivial submit, has been tested and works fine ... it's just not much work that filtering. It seems that many shadowy cases are not being covered and many objects are being kept in the bin when they should not be chosen at all.

All things, 9 filters that work in a series of responsibilities, put each filter in the bin until the series is out in the bin. The last filter in the series is simply a 'filter' which sends an e-mail to an administrator that it is being noted that the objects are running low (i.e., if the series has reached this filter, the bin is not complete, And some need can be seen).

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

  Public Zero Ficture Setup (for each possible value for field 1) {for (field of field) For every possible value 2) {// ... continue with 5 and 5 for statements / create an object with each value}}}  

but manually detect it Trying to see how the object is properly filled Should Shutter collection Collection (filtered objects too) would be very difficult (and if possible, I would have it easy when I first mentioned filter).

I know the requirements are in error because they say:

  becomes filter 1 - field 1: value 1/2/3 - field 2: Value 2/3/4 - etc.  

But the results are showing very high cases, whenever I change it every time to include that special case, something else breaks (and I'm sure There is no regression test to do that I do not t) and it is difficult to find out that there was a special problem in the series.

Edit> I am trying to test the filter separately, although the following values:

filter 1 hold 500 (500 according to the filter criteria) of possible objects 121600 Takes. I think, say 100 (complete estimates) of those items, which are caught, this should not be - and to know for different reasons, I know that the result of each filter is correct, then I Know that the other system will have to go through every one with the user (user). On the contrary, my mind is also distracting ... all the things that should have been captured, but what not.

I think that these requirements may be a problem in collecting, and not testing.

It seems that you do not have a clear idea. If you do not have a clear idea, how can you possibly know if the code works according to the imagination?

Take a step back start by typing a one sentence device :

The frobfilter component takes a sequence of frobes and each one has a right frobin Takes place in a long time until one is full.

OK, now you have a specification why it is not yet a testable or implementation specification? two reasons.

Reason one: The result of filling a frobin before the free sequence is not definite.

Reason Two: The "right" is not specified.

Now write a sentence that concerns every concern.

If the sequence ends before a bin is completed then the administrator is notified.

The perfect bin for a frobe is that the Blurge Gunsto is always frottben.

OK, now you have two more problems, how is the administrator notified? And what if Frob Blargh is not a Gnusto?

Just one sentence at a time, until it breaks, unless you have a complete and accurate imagination. Then you will know that your imagination, program that applies, and test cases all look like each other and this is a great situation.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -