On 22 January 2013 16:37, Xiazhihui (Hashui, IT) <xiazhihu...@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 <rbtcoll...@hp.com> Distinguished Technologist HP Cloud Services _______________________________________________ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp