To those of you who have very little or no idea of topcoder : It is one of the fastest and powerful crowdsourcing communities which aims at delivering software through competitions , a strategy that has been working successfully so far. My involvement in topcoder dates back to college life (2 or 3 years ago) when algorithm competitions gave us the same kind of adrenalin rush you get from a F1 racing. After over an year in a web-based startup company i have come to realize the importance of writing code that should be read and appreciated by others and what better way to start than with topcoder software component development competitions. After a few unsuccessful attempts and valuable learning i decided to give a best shot at an export file writer development competition at topcoder
The technology expertise required to build the component was somewhat familiar to me. The configuration based, bean to xls,ods,xml,csv,html formats didn’t require much of learning or research for me. The important thing was to get familiarized with the component development process of the TCS. A flash demo, sample review scorecard, a list of tools used gave me a rough idea of how to go about the whole process. Some of the things like ant targets along with testing tools used became clear before hand but i missed the most important tool called cobertura which i figured out just before making my first auto screen submission. After dropping in the required libraries and executing ant coveragereport cobertura gives a complete report of the lines of the code that were not executed after executing test cases. This gave a guiding light towards writing efficient test cases. Next thing was checkstyle tool which was available as a plugin in Jetbrain’s IDEA and i found it useful. Only problem was it reported nearly 100 warnings in my code which i was more than happy to ignore given that it was only my first competition in TCS.
The libraries used by the components required some running around to get them. A little bit of maven integration would have been useful but there is always a next time rite! I plan to plug-in maven with ant integeration and don’t have to worry about these dependencies any more. TCS advices developers not to spend too much time configuring ant but i feel having it setup in the first place (irrespective of support by your IDE) can save a lot of last minute falls. Its good to have “ant test” , “ant compile_targets” execute successfully right from the beginning and hey .. don’t forget about the good friend “ant coveragereport“.
Ok. I got my project setup and ready to write some useful code.! what? where are the skeleton codes ? thats right. TCS provides you the tcuml file of the project which you can open with Topcoder UML tool, generate the code in the right package and you have all the java doced code in you package. Then it was time to fill up the code. I was surprised to notice most of the code already written in java doc and most of the time a copy paste would work. Life can’t be simpler. But topcoder’s software process is always one step ahead . Designer is expected to think about development and developer is expected to write lots of test cases. Of the 4 days to complete the component i spent about 1 day understanding the component spec, requirement spec, design diagrams, 1 day on development and 2 days on writing test cases. The component had some rough edges when it came to testing. In the forums (where you are expected to raise questions and designer answers them) people raised questions mostly oriented towards the types of exceptions that needs to thrown/caught which was ironic but i enjoyed it. In all my components i developed i never worried about exceptions and logging them . But when you are developing in a crowdsource/open source environment logging / exceptions and documents are of paramount importance however annoying they are.
TCS expects 4 kinds of test cases for the component you are developing.
- Unit tests – which tests the component’s functionality – this is mandatory.
- Failure tests – which tests whether the methods are throwing the right kind of exception for the appropriate input
- Stress tests – which tests the component on very large inputs and logs the time taken
- Accuracy tests – which tests the accuracy . For example if the decimal digits in the exported xls file are accurate to some degree.
At the end of the fourth day of component development i had around 200 test cases including unit,failure,stress and i din’t have much time for accuracy tests.
You can make several submissions in the online review tool of the topcoder and each submission is auto-screened using cobertura and it passes only if the line and branch coverages are above 85%. Hurray !!! i made my first submission which passed auto screening. Then i ran checkstyle and cleaned up the annotations a little bit but i din’t have much experience / knowledge on what was expected in them which i came to regret later!
Each submission gets assigned a reviewer who takes the auto screened submission and evaluates the submission based on a TCS score card for development. Unfortunately my submission din’t make it through the manual screening but gave me a good understanding of the entire process and I thoroughly enjoyed. It might be too early to discuss about my score card as i am not yet rated but one of them was the use of wrong version of the third party library which resulted in reviewer test cases failing with flare
.
I will write about the list of mistakes i made and how i could have caught them earlier in my future posts. No charges for bookmarking and checking back later
Posted by nishantrayan
Posted by nishantrayan
Posted by nishantrayan