Monday, January 30, 2012
Artisan: Week 2
It was a pretty quiet day at the 8th Light office today. As such, I was able to study the Artisan (our project management tool) code base more in depth along with completing some small clean up stories. Looking at Artisan today reminded me of my first week at my previous job. Diving head first into an existing code base can be overwhelming regardless of how large it is. Artisan's code base is by no means bad and is fairly well maintained, but it is still daunting to try and grasp everything that is going on. I've used two methods to help me try and understand features in the code base. 1) I look at specific use case in the UI and then try and trace the feature the entire way through the system. 2) Look at the tests. This method may be harder for those who don't have a large suite of tests wrapping their application, but lucky for me Artisan is well tested. However, some tests with in the code base are really hard to read, especially tests that make heavy use of stubbing. This had made me realize that I probably shouldn't use much stubbing in my tests because it is really hard for others to understand. Setting up five stubs, then calling one method isn't really too helpful to read and doesn't always reveal the intend of the test. So, this is yet another reason that I prefer to use hand rolled mocks over framework stubs. Overall, I think I'm learning a lot about Rails development through working on Artisan, but there are still some pain points (like slooooow tests).