For this part we did not have to do as much coordination with fellow team members as the last part. For the most part, we each just wrote the unit test cases for the methods that we selected and checked into Perforce. The most challenging part for me was getting myself familiar with the code base and trying to test private method or method that did not return any value.
I saw quite a few questions about how to write unit test for these situations, and there were some people mentioned way to expose the private members but I was reluctant to do that because I believe in the principal of only testing the public interface. I ended up getting around the issue by setting up test scenario where the private method will get invoked based on the condition without making direct call to the private methods.
I used Visual Studio to generate class diagram, find references, and call hierarchy to methods to understand the code base more. These tools were really helpful to provide a clearer picture of relationship and interaction among the classes. I also noticed that the code base severely lack comments explaining what each class, method does, how it should be used, and what is the reason behind a certain piece of code.
Overall, it was a challenging assignment. A lot of the time were spent not on the technology side but on trying to understand what the code does. This does reflect the challenges of global software development, because a lot of times, developer are thrown into supporting or extending legacy code where there are little to no documentation and the original developers are not available for questions and answer.
No comments:
Post a Comment