[webbeans-dev] Granularity of assertions in TCK
Dan Allen
dan.j.allen at gmail.com
Wed Jul 22 22:57:52 EDT 2009
Thanks for these guidelines Pete. I was feeling a bit confused about whether
I should be stacking assertions on a test or not. Now I've got a clear
picture.
-Dan
Btw, they are now on the wiki:
http://seamframework.org/WebBeans/JSR299TCK(feel free to reorganize)
On Wed, Jul 22, 2009 at 12:32 PM, Pete Muir <pmuir at redhat.com> wrote:
> Hi
>
> Since the TCK audit has been rebuilt recently, we've lost a lot of the
> granularity of the report. As we go through checking it we need to
> make sure to reintroduce that granularity.
>
> Here are a few guidelines (of course, sometimes they don't hold):
>
> * A testcase should verify one thing
> - in other words don't check two distinct thing in the same testcase
> - it may well be the case that the spec asserts the same thing
> multiple times (in different places), then it is fine to reuse the
> testcase
> - it may well be the case that a single check proves multiple
> things (for example the fact that a bean resolves could be checking
> type resolution rules, binding resolution rules etc.)
> - use common sense - if a test seems to be checking > 1thing,
> split it up
>
> * An assertion should be fine grained
> - if an assertion is being checked in multiple testcases (as
> defined above), it's often an indication that the assertion isn't fine
> grained enough
> - sometimes multiple testcases are needed, but you should think
> hard about whether you can split the assertion up (use tools like the
> highlighter (_highlight_) and strikethrough(~strikethrough~) to split
> the assertion up)
> - if an assertion has something like "X and Y must through a
> definition error if P, Q or R" then you should consider splitting this
> into 2 * 3 = 6 assertions so that a test can be assigned to each one
>
> if you need to split an assertions, takes it current ID and add an
> extra letter on the end.
>
> If you are wondering why these guidelines - simply that it makes
> getting an overview of the TCK easily - we can scan through and check:
>
> * how well covered a section is (whether or not it uses dense text to
> define something)
> * compare how dense a section is
> * view easily how covered a section is
> * easily check that a test is relevant to an assertion.
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20090722/d5ee066c/attachment.html
More information about the weld-dev
mailing list