November 26, 2007

Mock Objects in Bangalore.

This Sunday I attended a workshop on mock objects by Dr. Steve Freeman. Workshop was organised by ASCI (Agile Software Community of India).
We started 5 min late and Steve was fighting with his Jet Leg. Naresh was one of the facilitator, who gave the introduction of Steve and his work in Agile community.

There were 12 - 15 participants to attend the workshop and most of them were quite handy on TDD and unit testing concepts. This small gathering was also helpful in facilitate better understating and sharing ideas.

Workshop organised in following steps:

  1. Steve gave a little introduction about the design compliance of unit testing and role of mock objects in unit testing.
  2. After the introduction Steve gave a presentation on jMock and how to use it in JUnit. It was three step procedure:
    ->setup for JUnit by mocking the external classes.
    ->Writing the expectation.
    ->testing the desired method.

    Steve gave a brief description about the how to write all three steps using jMock.
  3. After 2 hour of session we all were hungry so Sreekanth and Naresh ordered some pizzas to keep us going. We took 20 min break with pizzas, cokes and chat with other participants.
  4. Now its time for Coding Dojo :). Steve gave us list of test case, jMock cheatsheet and design of the application. It was a some DJ application, we got brief knowledge about its design and how we are going test it.
  5. Its time for TDD. We started with pair programming. Steve suggested that the most experience guy in TDD should pair with least experience guy. We made a queue in the order of increasing experience and guys on the end were paring.
    As I was somewhere in the middle of the row, so I got pair with the guy same experience as mine.
  6. Then we started of the real TDD. This was my first experience in TDD and pair programming.
  7. I was very excited in writing test first and code later. It was just awesome to see how my test cases were writing the actual classes.
  8. As most of us new to jMock, whole exercise took some time. We had to extend the session for 30 min more (and Steve was struggling with his JetLeg).
  9. In last 5 min of workshop, we had a retrospective session (following the agile manifesto).
    In this session we shared our feedback about the workshop.

This way I finished my first encounter with TDD and agile programming. It was a great learning experience and I am really looking forward for the next workshop.
Thanks Steve.

No comments:

Post a Comment