mardi 3 janvier 2017

Best Way of conditional execution for large amount of test cases in JAVA

I was asked this question in an Interview.

1) Suppose you have to validate 7 test cases, which will be your first choice ?
a) if else ?
b) Switch ?

2) now lets say, you have to validate 200 test cases, which will be your first choice ?
a) if else ?
b) Switch ?

2) now you need to validate 2000 test cases, What technique you will adopt ? (May be creating whitelist or blacklist stuff, not sure.)

I found somewhere this point :: If the switch contains more than five items, it's implemented using a lookup table or hash table, otherwise it's implemeneted using an if..else.

Can somebody explain this ?

Aucun commentaire:

Enregistrer un commentaire