Unit tests in Frameworks

Dario Freddi drf54321 at gmail.com
Tue Dec 6 18:44:01 UTC 2011


2011/12/6 Kevin Ottens <ervin at kde.org>:
> On Tuesday 06 December 2011 18:45:38 Dario Freddi wrote:
>> Hello everyone,
>>
>> I know some of you are crying blood just by looking at the title, but
>> yes, I want to bring this up :)
>>
>> I think Frameworks could be a good chance to enhance and force
>> requirements regarding unit tests, especially for new code. I am the
>> first who apologizes as most of the code I committed to kdelibs didn't
>> have unit tests at all, most of the times because the code itself was
>> too hard to test (which of course is not a good excuse). AFAIK there
>> is no policy (yet) in this regard; if we want to provide even better
>> quality with our product, I think we should fix that.
>
> What did you expect? I'm one of those unit tests evangelits, of course it's
> already in! :-)
> http://community.kde.org/Frameworks/Policies#Frameworks_have_automatic_unit_tests
>
> It's of course still somewhat lax because we're mainly dealing with existing
> code there. All new code and fixes should come with unit tests as much as
> possible.

Yeah, don't know why but I expected that... :D

>
>> It would be nice to enable coverage through gcov (I already have some
>> cmake code for doing that) and enforce a minimum percentage of
>> coverage for each component, maybe dependent on the tier (Tier 1
>> requires 90%, Tier 2 75%, etc...). Of course I know this is hard to
>> apply to existent code unless people will do an effort, but I think it
>> could be a sensible decision for future newcomers.
>
> Making it dependent on the Tier is likely a bad idea, purely GUI frameworks
> will de facto see less coverage than something purely computational. It's
> likely to be another set of criteria for such threshold.

I reckon the concern. Indeed in this light having a tier-based
criteria is not a good idea indeed.

>
>> What do you think about that? Is there an interest in applying
>> something like that to our policies? In case, who would like to help
>> me in drafting and implementing it?
>
> More than a policy, what we need is first the infrastructure to get those
> metrics automatically. Otherwise it's pointless really, it's making empty
> statements.
>
> Now, we already lined up an epic on that topic:
> http://community.kde.org/Frameworks/Epics/Continuous_Integration
>
> The page is still empty, but I'd advise you start to jot a couple of tasks in
> that regard, and having the necessary cmake magic in place to extract metrics
> is a good start. Policy should come last.

Agreed. I will fill the wiki page over the next days and ping the list
again when ready or almost there

>
> Also note that I think it'll be the right time to focus on that for 5.1, for
> 5.0 we already have plenty to do with the existing code.

+1

>
> Regards.
> --
> Kévin Ottens, http://ervin.ipsquad.net
>
> KDAB - proud patron of KDE, http://www.kdab.com
>
> _______________________________________________
> Kde-frameworks-devel mailing list
> Kde-frameworks-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
>


More information about the Kde-frameworks-devel mailing list