> -----Original Message----- > From: Chip Childers [mailto:chip.child...@sungard.com] > Sent: Friday, February 08, 2013 12:19 PM > To: Anthony Xu > Cc: cloudstack-dev@incubator.apache.org > Subject: Re: [MERGE] Security Group in Advanced zone > > On Fri, Feb 08, 2013 at 11:43:52AM -0800, Anthony Xu wrote: > > I see your point, I think it should be case by case, > > > > In this feature, 100 line change are in 6 "manager" class, there is no unit > framework for them, to be honest, I don't know to create the unit > framework for manager class, I believe it is a big task. If the framework is > there, I'm glad to add test cases inside framework to test the path I changed. > > > > If every function change needs unit test change, and as you said there is > > <1% > unit coverage. This will be a big burden for developer, may slow down > development. We may need to balance between them. > > So if we don't start doing this now, when will we start? I hope you get > my point here... yes, things slow down, but then they speed up. Test > coverage is critical to rapid development in such a large community.
We should start doing this now. There was always a framework even back in ComponentLocator in 4.0 to mock up the managers/adapters injected into the manager/adapter being tested. Now, with Spring it's even easier to use mockito to mock up the injected components. The framework is there and I understand compare to before it might seem unfair that you had to do it but not people before but it has to start somewhere with someone. Take a look at ApiRateLimitTest.java for how it's being done. That's done even without an injection framework. With the Spring injection framework it's even easier. Take a look at SecurityGroupManagerImpl2Test.java for one with Spring. --Alex