[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] Re: Private methods should not be unit-tested

On 17 March 2014 01:09, Herman Peeren <> wrote:
> This is not meant as a rant and I know that in the current codebase of
> Joomla it won't have much consequenses, but I'm trying to think a bit more
> about why we are testing and what should be tested. Especially after seeing
> Sandi's presentation I came to the conclusion we are often testing too much,
> which might even become contra-productive. In "The Art of Unit Testing" by
> Roy Osherove (Manning Publications, second edition, 2014) there is an
> interesting section (8.1.1): "Deciding when to remove or change tests".

Deciding on whole "few" tests adequately cover your code is an art.
It's not just about testing the code you wrote, but also adding tests
to detect regressions in the future.

I'm certainly ok with not having full coverage from what we call
"integration" tests and there are a range of techniques for doing them
(it's the idea that even though the unit pieces might work
individually, they may not work properly in concert). But we do want
to aim for about 80% coverage at the unit level. Obviously some
classes like Input Filters are going to need many more test cases.

Andrew Eddie

Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.