Testing IComparer Implementation

  • Thread starter Thread starter ckarbass
  • Start date Start date
C

ckarbass

I am testing a comparer class that implements IComparer. The comparer
constructor takes as arguments a property field which can take on lets
say roughly fifteen values. It also takes two other boolean arguments.

Testing all permutations of the comparer doesn't seem practical. Are
there any suggestions for testing the comparer? Do I need to test all
permutations?

Thanks in advance for any advice.
 
Depends on what your code does. If you have different execution paths based
on the values passed as an argument I would say yes.

Gabriel Lozano-Morán
 
I am testing a comparer class that implements IComparer. The comparer
constructor takes as arguments a property field which can take on lets
say roughly fifteen values. It also takes two other boolean arguments.

Testing all permutations of the comparer doesn't seem practical.

Is the number of permutations 4 x 15? That doesn't sound too bad, especially
if you can make it table-driven.
Are there any suggestions for testing the comparer? Do I need to test all
permutations?

Are you a professional tester or a programmer? If the former, then yes, you
have to test all the permutations. Otherwise, my advice is to test
everything that could break.

///ark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top