Since the introduction of the QTestLib in Qt4 developers have the option of easily making their libraries an applications unit tested for maximum maintainability. The availability of the tools and the QTestLib tutorials on how to use those is useful, but not always enough. Having access to good tools does not automatically make a new developer an expert in using them and so its important to see how applications and libraries can be unit tested effectively using a set of techniques learned in the field.
In this presentation I will explain 3 different categories of testing; a Testing single methods output for known input b Testing the state of one class after calling methods on it c Mock object testing Each of these are used in a different context and in the presentation I will show examples of what method of testing you use for which kind of code.
I'll continue by showing actual Qt/KDE (coding) examples of how, in practice, each of these categories dictate a different approach to testing and then show actual unit tests and their code to test these. After this presentation the developer will have seen proven practices of unit testing and will be able to see how to use unit testing techniques in which situation. I will end with a set of guidelines on how to design your classes to make them even easier to unit test.