lundi 19 octobre 2020

Software Unit Testing input values and code coverage

I have three questions about software unit testing. I have done some research but couldn't find any answers to my questions.

  1. In unit tests the out of range values should be checked. Does this mean that if my input is a double then I also have to test what happens if I insert a number which exceeds the definition value of a double 1.8 × 10308 ? Or is the out of range check only needed if my function only works for a "functional" interval.

  2. Is it correct that code coverage is not directly linked and therefore no requirement for unit testing? But highly recommended because of code verification?

  3. Does unit tests have to be in the target environment? For example I created a unit test in Matlab for a c coded mex function. The end product will run the c source code. Is the unit test in Matlab still valid? Or does the unit test has to be in C code? My understanding is that this doesn't matters for the unit tests but for the code coverage. Is that correct?

I hope that somebody can help me :) I appreciate every reference etc.

Cheers

Aucun commentaire:

Enregistrer un commentaire