in my situation i have too many parameters(1000 parameter or more ...) the number of parameter may change. every parameter contains a defined number of values .the problem is that the combination of all parameter values is too long which make it impossible to cover all the testing cases , so is there a solution to generate an automatic testing that covers all the parameters ?

  • 3
    Start with refactoring your code so that it processes a list instead of having thousands of params. – RubberDuck Mar 18 '17 at 0:22
  • Possible duplicate of How to test an algorithm with multiple inputs? – gnat Mar 18 '17 at 5:14
  • You surely don't mean literally you have a function with 1000 parameters. Please explain what you really mean by "1000 parameters". – Doc Brown Mar 20 '17 at 20:27
  • @DocBrown parameters can have other meanings... In the abstract sense, inputs that can have different values. – Frank Hileman Mar 30 '17 at 23:51
  • @FrankHileman: sure it can have other meanings - that is why I asked for a clarification. In the current form I think the question should be closed as "unclear", it is badly written and the OP does not seem to care. – Doc Brown Mar 31 '17 at 4:50

Often, the effect of a parameter value is "monotonous", in the sense that the values are ordered in some way, and whenever a test succeeds for two different values we know it will succeed for all values in between.

This can be used to limit the number of values to try. Instead of trying a 1000 different values you can get by by testing 20 or so. This is apparently known as boundary scanning or boundary value analysis in the literature.

But it is only useful for reducing the number of different values to try for a given parameter. Your problem is the number of different parameters. Even with only 2 different values for each parameter, there are 21000 combinations to try. You would need to identify and exploit higher-order "monotonicities" in the 1000-dimensional parameter value space to reduce this. Whether this is possible depends on what the parameters mean.

| improve this answer | |

Not a test, but informal or formal proofs will cover all possible parameter values. Typically to reduce the burden of proofs or testing, we restrict both the number of parameters and the range of possible values for those parameters. This reduces the state space of the program.

| improve this answer | |

There are several testing frameworks out there that generate test cases. This Computerphile video nicely demonstrates one in action. The idea is that a machine can generate more test cases than any person ever could, and thereby more thoroughly tests the code. Instead of just getting full branch coverage, you can get complete input coverage.

Of course, these tools tend to be geared toward functional languages, so you might have a hard time finding a good one for your particular language.

| improve this answer | |
  • Read again: 1000 parameters. Be extremely optimistic and assume no more than 2 values for each parameter. Complete coverage of 2^1000 combinations, just by computer magic? Dream on. – reinierpost Mar 18 '17 at 23:50
  • 1
    @reinierpost and I also told OP (albeit in a comment) that they should refactor so that there aren't 1000 params... OP asked a question, I provided a reasonable answer and some extra context. It's a really interesting video actually... Also, the number of variables here make it so that only a machine could thoroughly test it. – RubberDuck Mar 18 '17 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.