Unit Testing: Interfaces VS Implementation

Niko Sams niko.sams at gmail.com
Sat Jun 11 16:42:22 UTC 2011


On Sat, Jun 11, 2011 at 17:31, Milian Wolff <mail at milianw.de> wrote:
> Milian Wolff, 11.06.2011:
>> Hey all,
>
> status update, please read the first mail as it's still valid.
>
>> * ShellBuddyTest (fails since current implementation lies in KDevelop)
>
> if someone tells me how, I would like to move the test files to
> kdevelop/languages/cpp/test and keep their git history.

I think there should be a very basic IBuddyDocumentFinder implementation inside
the test. And this test should then only test the code in kdevplatform.

The concrete implementation in the cpp plugin should be tested as you suggested
in cpp, but there only the cpp implementation has to be tested - not
the documentcontroller plus
the cpp stuff.

As Andreas said alrady, unit tests should test only as small as
possible units, while
integration tests test everything together. In theory when all units
are tested perfectly
there is no need for integration tests.
However integration tests are often easier to write, esp. for code
that is not designed
to be unit tested.


Niko




More information about the KDevelop-devel mailing list