Thursday, May 26, 2011

GSoC 2011 Melange Testing Project : Coding Period Week 1


The coding period has officially started and I have been rather slow and falling behind the schedule. I still have not started writing a test but I will try to give more time to the project in a couple of days. 
    It was quite an eventful week. I have been waiting for the welcome package by google and it was already May 23, so I just asked on the GSoC students mailing lists if anyone has already received it. Some of the students were very furious about starting such a thread as Carol had stated the deadline to be May 27. What I believed was that its not necessary that everyone will receive the package after 23. I also made a remark of why he bothered to read and reply if he was not interested. I was surprised to see that only one or two previous GSoC students from the 4k members strong mailing list care to answer constructively. It was encouraging to read Phillip Herron's comment which I quote below:

"Just be patient they _will_ come from last years GSoC it just takes
time if you consider the fact they have to individually create like 1000
of these things and get them each shipped to each of our address's
just be patient. Its a great feeling when it comes :) "


This is the reason why I love Melange. You are never restricted but re-directed if you are going wrong. I still remember when Mario told me that its bad collaboration when I commented a little offensively on the efforts of an aspiring student during the pre-GSoC time. I am also amazed by Carol's patience at answering the same  set of questions again and again asked by students on the gsoc mailing list. Anyway, I learnt from the criticism that I should be patient and keep good relations and collaboration with fellow students.

    I am going slow at the project and falling behind the schedule. I have not written a single line of usable code till now. My project is concerned with writing tests for the logic and views  and as I stated in my last post that I shall start with app.soc.logic modules, so I have generated a directory structure of app.soc.logic which is basically a tree like structure of the files in the directory. All the previous tests have been moved into tests/old_app directory as they conflicted with the new framework. My aim is to re-use the old tests and make the necessary changes with respect to the new framework. I will start with the app.soc.logic.allocations.py  module.

    I had a meeting with my mentor Leo yesterday i.e. on 25 May '11 and I discussed with him a few concepts related to testing.I asked hime what should the basic approach be while attempting to write the tests. Basically, we should first understand what a specific function does, think about all its use cases and then we test each of the use cases.
   I also have to implement a view to run the tests online rather than running the tests locally. I did not exactly know how to implement this. But Leo suggested that there are already some open source projects like gaeunit which do that. So, I referred to the gaeunit project and its just a single module which implements that. My approach was to run the tests using the python environment of GAE and somehow capture the test results but there is already a TestResult class in unittest module which returns an object for such manipulation. So, I need to make use of this class and tasks to implement my view.
   So, my goal for this week is to write the view and implement the test for app.soc.logic.allocations.py module at least.

 

No comments:

Post a Comment