Unit Tests

Andreas Pakulat apaku at gmx.de
Sat Sep 13 01:20:06 UTC 2008


Hi,

I've recently felt really uncomfortable when doing some coding on a new
component at work. The reason was that we already have quite some code
there, but still lack unit-testing for some core parts.

Hence I'm writing this post. I think we all agree that we're seriously
lacking unit-tests, I know that duchain/c++ has tests, also cmake
support has some tests and qmake as well. The new test-plugins also have
tests. However the core parts lack them, that is the majore libraries in
kdevplatform.

I know and understand that writing tests might be boring (though I have
to admit that it can be fun too - try to think of it as an excercise on
breaking other peoples code), but I think if everybody tries to do a
little, we can already get quite some more coverage.

So I'd like to ask what you all think about the following guidelines:

1. If you find a bug and fix it or work on a bugfix for a reported bug,
write a unit-test for it first.
2. If there's infrastructure missing to create such unit-tests, lets
discuss how we can create that infrastructure
3. It would be nice if everybody could spare an hour or two of
development time every other week - or once a month or something and use
it for test-writing.

With that I think we might be able to increase the test coverage of our
code-base quite a bit. Note that not only unit-tests on individual
classes are important, integration tests could also be useful.

Andreas

-- 
Chess tonight.




More information about the KDevelop-devel mailing list