Henrik Henrik - 1 year ago 108
C Question

C embedded automatic unit test generation

Is there any SW to generate unit tests in C and embedded applications? The reason I am asking is that my boss told me he heard from someone that "You need a tool to analyze the code and create 80% of all relevant testcases automatically, the remaining 20% you use all your time and focus on", else it would take "too much time".

I am very skeptic about this statement and can't see clearly what kind of tests that could be auto generated and if they would be any good at all.

I can, however, see that it would be possible to generate interface unit tests automatically for the API:s.

So can someone enlighten me on this issue?

Answer Source

Your boss has got the wrong end of the stick.

I know of no tools that will generate unit tests for you.

What he may be mistaking is code coverage and unit testing. While related they are in fact separate issues.

Code coverage will instrument your code and once finished running give you the low down on how much of your source was used in the run. This is useful when unit testing as it will effectively show you where you have tested and where you need to focus your work.

It is fairly easy to get the first two thirds of code covered but diminishing returns means to get near a magic 100% takes a lot of time and effort.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download