[Openstack] which is the level of unit test cases should be covered

John Griffith john.griffith at solidfire.com
Tue Jan 22 14:47:34 UTC 2013


On Mon, Jan 21, 2013 at 8:58 PM, Robert Collins
<robertc at robertcollins.net>wrote:

> On 22 January 2013 16:37, Xiazhihui (Hashui, IT) <xiazhihui09 at huawei.com>
> wrote:
> > Hi friends,
> >
> >
> >
> >          I want to upload a volume driver, right now I’m writing unit
> test
> > case code ( it’s also need to be uploaded).
> >
> >
> >
> >          And I do not know the requirements of the unit test code. Which
> is
> > the level of unit test cases in my unit test code should be covered:
> > Function Coverage, Condition coverage, Decision Coverage, Statement
> Coverage
> > or others? Or should I write what I think needs?
>
> Pragmatically speaking, code should be tested such that if either:
>  - some precondition it has is changed (either elsewhere in the same
> code base or in the behaviour of some other code base) that we find
> out
>  - if someone changes the code itself and breaks an existing use case,
> we find out.
>
> Exactly what that means may be different for different routines :).
>
> My general rule is to start with testing each entry and exit path and
> any domain or range corner cases.
>
> -Rob
> --
> Robert Collins <rbtcollins at hp.com>
> Distinguished Technologist
> HP Cloud Services
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
You can use some of the other back-end driver tests as a starting point or
reference, and submit a review and go from there.  Also feel free to grab
somebody on IRC in #openstack-cinder and maybe we can help answer more
detailed questions you have there.

Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130122/b2f379b4/attachment.html>


More information about the Openstack mailing list