Unit Testing: Interfaces VS Implementation

Milian Wolff mail at milianw.de
Sat Jun 11 22:17:53 UTC 2011


Niko Sams, 11.06.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.

Hmm I probably simply don't get it: You rather want to copy the implementation 
code from KDevelop to KDevplatform and then test the interface using that? 

Considering that the implementation still has to test this all to make sure it 
all behaves correctly - what do you gain? Why not simply write something like 
ModelTest that you can plug in any kind of implementation and then just test 
it all?

bye

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110612/b3b4e239/attachment.sig>


More information about the KDevelop-devel mailing list