Re: Gtk+ unit tests (brainstorming)



Havoc Pennington wrote:
> Tim Janik wrote:
> > 
> > ah, interesting. could you please explain why you consider it
> > such a big win?
> > 
> 
> Without it I think I usually write about 10% coverage, and imagine in my 
> mind that it is 50% or so ;-) I'm guessing this is pretty common.
> 
> With it, it was easy to just browse and say "OK, this part isn't tested 
> yet, this part is tested too much so we can speed up the tests," etc.
> 
> Also, if someone submits a patch with tests, you can see if their tests 
> are even exercising their code.
> 
> It just gives you a way to know how well you're doing and see what else 
> needs doing.

Sure! Tim, you can take a look here to see this in practice:
http://gtktests-buildbot.igalia.com/gnomeslave/gtk+/lcov/gtk/index.html

Those are the code coverage results for the tests I developed. As you
browse the files you realize the code that is tested (blue) and the code
that is not (red).  I think this helps with:

   * Realizing which code your tests are actually covering.
   * Designing new tests so they are not redundant.
   * Analyze which execution branches are not tested for a given
interface.
   * Easily check which files have more tests and which ones need more
testing work based on coverage %.

Iago.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]