Reputation: 922
I have to check compatibility of a software with systems (os, device, browser, client). Only some of the systems are supported.
We have all 4 paramaters combinations for compatible systems. Given parameters for some system i have to check for its compatibility.
Best i can think of that i allot different os values 0-9, device with values 100,200,..900, similarly for browser 1000,2000,...9000 and for client. Maintain a cache of all valid additions and check for given system from that cache.
Is there any better method? In the above method i can have scalability problem. suggest me some similar algorithms.
Upvotes: 0
Views: 262
Reputation: 19601
To be absolutely sure some combination will work you will have to test it. If you have so many combinations to check that you cannot check each one, you can make assumptions about what is likely to go wrong, and find schemes that give you the most useful test under these assumptions.
If you assume that bugs can always be replicated by combining just two choices (e.g. Windows + device always gives trouble, regardless of browser and client) then you can find a scheme for testing every combination of two choices without testing every combination of everything - see http://en.wikipedia.org/wiki/All-pairs_testing
Upvotes: 1
Reputation: 759
You could create some object representing the instance of your class and then hash the object and compare the hash to the hashes of the samples that work. This should solve your scalability issue.
Upvotes: 0
Reputation: 8087
Use a hash table. Virtually every language has them built in together with methods to serialize them to a file.
Upvotes: 0