Hey All, The last few days developers from Schuberg Philis and ShapeBlue spend a lot of time on fixing findbugs findings. This started as an idea to onboard some of the new guys on CloudStack development, but it turned out to be a 5 days long hackaton. The end goal was the elimination of the FindBugs findings in the Scariest category and to make a dent in the Scary category. The rules are simple, find a bug, write a unit test to prove it, fix it and prove that it works.
I'm very happy to say that we succeeded in our goal. We have over 20 Scariest bugs and over 30 Scary bugs. It also was a great learning experience for everyone involved and we got a lot of impromptu trainings on unit testing, mocking and CloudStack internals. The test procedure we used to verify the fixes consisted of static analysis, peer review, rat build and functional testing with devcloud. Of course functional testing with devcloud doesn't cover a whole lot of functionality, but at least we are core core functionality of CloudStack (startup, provision ssvm, provision network, provision instance) still works. The peer reviews were done by dividing up the commits among the team and each did a bit of the work. Daan en me did the final review using the reviewboard with our committer hats on. However the right question to ask now is how did this improve CloudStack. We did find a number of pretty serious bugs (like == being used for Object comparison when equals should have been used) but nobody ever complained about those functions. Another example is a common pattern to test for null on an object and then printing an error message that object.getId() could not be found inside the if statement. The correct answer to that question is that in my opinion we both did and didn't improve CloudStack. The paradox here is that we improved the code as written making the code flow as the original developer (probably) intended and we added unit tests to prove it as well. However there is not much we can say about the functionality of the code. We touched code in all areas both within and outside our areas of expertise. So it is possible we introduced a number of functional problems that were working by accident earlier, however our belief is that this is far preferable above code that works by accident. All things considered, we are very happy with the result of this week and we will for sure do this again. Cheers, Ian, Alex, Antonio, Wilder, Miguel, Sander, Daan and Hugo ----------------------------- Hugo Trippaers Schuberg Philis Boeingavenue 271 1119 PD Schiphol-Rijk http://www.schubergphilis.com/ +31 207506553 +31 6 510 555 19