BangPypers
BangPypers The Bangalore Python User Group

March 2014 Meetup report

“Writing tests is an absolute waste of time”, some of them say.

Well, we do not think so. The March Bangpypers meetup was a hands on workshop covering TDD with Django. Just like last time, an enthusiastic crowd of 42 attended the session. It was held at the Apigee office in Koramangala. Facilitated by Siva, the session started at around 10:30AM and went on till 3:30PM. Unlike the previous sessions, Kracekumar was the only volunteer to help the participants.

The workshop started by telling everyone the importance of writing tests, the concept and theory of Test Driven Development and how it could help one tremendously while writing code. Although a bit hectic at first, it is a practice that would certainly pay off when it comes to catching the bugs in your code before it is deployed in production. The Repo and the session notes can be found here.

The session focussed on using selenium for writing functional tests and the Python unittest library for writing unit tests. As you can see from the notes, each step was implemented step by step, one at a time making sure that the crowd was following along. The functional tests were bundled in a standalone package whereas the unittests were written within the tests.py file of the newly created Django app.

The concept of writing tests for a piece of code that was not written, was quite alien to almost all the participants. “TDD is like martial arts”, stated Siva towards the end. “You cannot learn it in one day. First you have to go through all the troublesome exercises before getting to the actual kicking and punching part”.

Making voluntary, common mistakes in his code, the instructor made the participant experience newbie mistakes that anyone could make. Thereby making them think it through and finding a solution. The well laid out exercise along with the elegant presentation imparted a great deal of knowledge to the attendees.

The workshop was wrapped up by 3:30PM after which, all of us hungout a bit talking to each other about different technologies and how they compare with each other. Certain participants had a couple of doubts about the session to be clearted who stuck with Siva for a while to get everything cleared.

By 4:15, all of us were on our ways, waiting to come together once more for the next meetup!