Skip to content

First Stop on the 2010 Michigan Pairing Tour

2010 January 27
by Nayan Hajratwala

On Friday, 1/29, I’ll be making my first stop of the 2010 Michigan Pairing Tour in Grosse Pointe, Michigan. The plan is to pair with Ilya Sterin on what he describes as writing tests for:

a highly concurrent producer/consumer implementation for data messaging through numerous sources

Aaahh, legacy code testing and refactoring. One of my favorite pastimes I love it! :-)

The Tour Calendar is now available for anyone interested.

The February and March dates are *almost* confirmed, so i’ll be announcing those shortly.

Announcing the 2010 Michigan Pairing Tour

2010 January 21
by Nayan Hajratwala

Inspired by Corey HainesJourneyman Tours, I’m kicking off the 2010 Michigan Pairing Tour.

To start with, I’ll be spending 1 day per month pairing with individuals anywhere within about a 2 hour driving distance from Ann Arbor. (Yes, I realize this puts the top of Ohio in play as well. If you’re nice, maybe I’ll cross the border for you :-) )

I’ll pair in any language, on any project. We can write code, write stories, write acceptance tests, you name it.

Goals

What am I trying to accomplish?

  1. Enhance my own skills from hands on experience with other practitioners.
  2. (Hopefully) enhance my partner’s skills.
  3. Meet more like-minded folks throughout Michigan.
  4. Inspire others who don’t have the availability for a full Corey-style tour to go out and grow themselves and the community.

Logistics

If you’d like to be on my tour, please contact me via email or twitter. If you need to get permission from your boss, I’m happy to talk to him/her or sign any corporate NDA’s that are required.

My current plan is to do this on Fridays, but I’m pretty flexible, so let me know what works for you.

I’ll put up a Google Calendar shortly with all the booked dates. (Update: Google Calendar is posted)

Thanks for your interest, and I hope to see you on my journey!

Snow Leopard Upgrade Experience

2009 August 29
by Nayan Hajratwala

I upgraded my 17″ MB Pro last night to Snow Leopard. The installation went smoothly, and took about 45 minutes. the Mac rebooted a couple times on it’s own and then I was done.

This morning, as I started using the new OS, I experienced the following issues:

  • Dev tools not installed – easily solved by installing the XCode package off the DVD
  • QuickSilver not working — solved by upgrading to SL version, and removing
    • ~/Library/Application Support/Quicksilver and
    • ~/Library/Preferences/com.blacktree.Quicksilver.plist
  • MacRuby seems to be broken — seems like 0.5 is needed.
  • Quicken 2007 needs Rosetta — quite a nice implementation, as SL automatically downloaded Rosetta and installed it.
  • Electric Sheep 2.7b16 does not work — waiting for devs to update
  • iStat not working — waiting for devs to update
  • Xmarks not working — waiting for devs to update
  • Growl has strange behavior — upgrade to v1.2b fixes it http://code.google.com/p/growl/downloads/list — final release should be available soon.
  • Nambu not working — switching (permanently?) to Tweetie or TweetDeck
  • Weird font problem in Firefox — some sites indicate a problem with 3rd party font managers, but i have none. No solution yet.

Nothing critical (for me), but hopefully these will get worked out soon.

UPDATE (2010/01/20) – All issues have been resolved!

Agile 2009 is Almost Here

2009 August 3
by Nayan Hajratwala

The Agile 2009 conference is less than a month away! Need to convince
your manager to send you? See our justification toolkit:
http://agile2009.agilealliance.org/justificationtoolkit

Consider personalizing your program, and seeing how much value you can
receive for your time and money:
http://agile2009.agilealliance.org/personal_program

The program is also available online and in PDF format on:
http://agile2009.agilealliance.org/programOverview

We are almost out of Early Bird registrations, so register soon if you
want to snag one. Our 5-pack registration is the best deal. See
http://agileregistration.org for all the details.

Freshers’ Faire

We know that the crowd at Agile Conference can be intimidating, so don’t
miss the Ice Breaker on Monday. It will include a college-style
Freshers’ Faire where communities will be happy to introduce themselves
to you. The communities that will be represented include so far:
* Real Options
* CITCON
* Testing
* Leadership
* Agile Requirements
* Agile Coach and the Agile Coaches Gathering
* User Experience
* Telling Our Stories
* Agile Game designers/ enthousiasts
* Agile France
* PairWith.Us
* Kanban
* PMI
* Facilitation & Facilitation Patterns

Feel free to tell other communities about it and refer them to our blog
entry:

http://agile2009.wordpress.com/2009/07/16/freshers-faire-make-your-community-visible/

Programming with the Stars

One of the most fun events last year was Programming with the Stars, a
contest where you can pair with legendary programmers, and impress a
panel of ruthless judges. Programming with the Stars is coming back this
year, and you can apply too!

Check out an account from last year:

http://agile2009.wordpress.com/2009/07/19/programming-with-the-stars-coders-wanted/
Details on the contest there:
http://agile2009.agilealliance.org/programmingwiththestars

Personas

This year we are using “personas” as a quick way for attendees to tell
which sessions will be most relevant to their needs.

Personas are currently being described on the Conference blog. Watch for
them appear every few days!

Here is what we posted so far:

* http://agile2009.wordpress.com/2009/07/28/meet-billy-business-analyst/
* http://agile2009.wordpress.com/2009/07/25/meet-ellie-agile-explorer/
* http://agile2009.wordpress.com/2009/07/23/meet-rose-researcher/

* http://agile2009.wordpress.com/2009/07/21/meet-alex-architect/
* http://agile2009.wordpress.com/2009/07/15/meet-tara-tester/
* http://agile2009.wordpress.com/2009/07/08/meet-chandra-consultant/

*
http://agile2009.wordpress.com/2009/07/04/meet-padma-struggling-product-owner/
* http://agile2009.wordpress.com/2009/06/25/meet-rubin-reluctant-agilist/
* http://agile2009.wordpress.com/2009/06/18/meet-brooke-business-executive/

5-pack registration saves $400 per person!

Register now and get a $400 discount via a 5-pack registration.
Go to http://agile2009.agilealliance.org/ and choose “Register”.

A regular non-member single registration is a great deal at $1799, but
with a corporate group 5-pack, each person attends for only $1399 – a
savings of $400 each! It will work for you and your 4 friends too, no
need for you to be co-workers 😉

There’s no better way to check out the benefits of Agile for your
company than to turn your thought leaders loose among hundreds of
expert-led sessions at Agile 2009. See you there!

Maven 2.1.0 is out!

2009 March 23
tags: ,
by Nayan Hajratwala

After much anticipation, Maven 2.1.0 has been released. My personal favorite new feature is the parallel downloads of artifacts. This alone should significantly speed up builds on CI servers that refresh the repo on each build.

Go get yours today.

Leaving India: My Sister’s Book!

2009 February 24
by Nayan Hajratwala

My sister’s book is now available on amazon. Go check it out!

Getting OCMock to work

2009 February 19
by Nayan Hajratwala

I started using OCMock yesterday, and was quickly hit by a problem when trying to stub out return values.

My test method was (sorry for the lack of highlighting – the plugin i’m using doesn’t support Objective-C)

- (void)testReturnsStubbedReturnValue
{
	id mock = [OCMockObject mockForClass:[NSString class]];
	[[[mock stub] andReturn:@"megamock"] lowercaseString];
	id returnValue = [mock lowercaseString];
	
	STAssertEqualObjects(@"megamock", returnValue, @"Should have returned stubbed value.");
}

However, when running it, I would get the error:

  warning no '-stub' method found
  warning no '-andReturn' method found

After scrolling through all the OCMock test code, I finally was able to get it work by adding:

  #import <OCMock/OCMock.h>

That’s where the methods are defined, but not being an Obj-C guru, I don’t fully understand how the code knows it’s actually using the OCMock class, etc.

Anyway, it appears that the minimal code needed to get an OCMock test running is (i wish this was on their web site!):

In OCMockSampleTest2.h:

#import <SenTestingKit/SenTestingKit.h>

@interface OCMockSampleTest2 : SenTestCase {
}

@end

In OCMockSampleTest2.m:

#import "OCMockSampleTest2.h"
#import <OCMock/OCMock.h>
#import <OCMock/OCMConstraint.h>

@implementation OCMockSampleTest2

- (void)testReturnsStubbedReturnValue
{
	id mock = [OCMockObject mockForClass:[NSString class]];
	[[[mock stub] andReturn:@"megamock"] lowercaseString];
	id returnValue = [mock lowercaseString];
	
	STAssertEqualObjects(@"megamock", returnValue, @"Should have returned stubbed value.");
}

@end

I hope this helps someone!

Why I Use Maven

2009 February 12
by Nayan Hajratwala

I was asked recently why I like Maven so much. Here’s why:

  • The most basic project structure will compile code, run all your unit tests, and build a jar file:
    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.chikli.testprojecct</groupId>
      <artifactId>testproject</artifactId>
      <version>1</version>
    </project>
  • Due to the standardization, and logical defaults/conventions, I can open up any project that uses Maven for it’s build system and immediately understand the build process and the generated artifacts. This is in stark contrast to ant buildfiles which are custom from project to project.
  • Since all needed artifacts (jars) are versioned and live in a Maven Repository, I don’t have to include the actual jar files for third party libraries within my project structure.
  • I can run a single command and immediately see if any of the libraries that my project uses has released any updates (i.e. new versions of spring, hibernate, commons-*, etc):
    • mvn versions:display-dependency-updates
  • I can change the version of a library that my project uses simply by typing in the version I want.
  • Documentation – this has traditionally been horrible for Maven, but Sonatype has recently created an excellent free online book that covers all you need to know about using Maven.

I’m pretty sure there’s more I like about Maven, but these are the ones that came to me right away.

A Successful Attempt at Mangling Ruby

2009 February 5
by Nayan Hajratwala

I’m working on the Ruby Koans by Edgecase which has been a really nice way to introduce myself (again) to Ruby. It’s the right mix of hand-holding and “solve-it-yourself” problems.

I just finished the about_proxy_object_project.rb Koan, and while it works, I fear that I’ve fairly well mangled Ruby, and there are probably infinitely more elegant ways to do this. My code looks like Java transcribed into Ruby.

Anyway, here is the code. If you have some spare time, take a look and see what I could have done better. I wrote the Proxy class, the rest was supplied.

# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below).  You should be able to initialize the proxy object with any
# object.  Any messages sent to the proxy object should be forwarded
# to the target object.  As each message is sent, the proxy should
# record the name of the method send.
#
# The proxy class is started for you.  You will need to add a method
# missing handler and any other supporting methods.  The specification
# of the Proxy class is given in the AboutProxyObjectProject koan.

class Proxy

  class MessageLog
    attr_accessor :message_name
    attr_accessor :count

    def initialize(message_name)
      @message_name = message_name
      @count = 1
    end

    def increment_count
      @count = @count + 1
    end

  end

  def initialize(target_object)
    @object = target_object
    @messages = []
  end

  def method_missing(method_name, *args, &block)
    if @object.respond_to?(method_name)
      increment_message_count(method_name)
      @object.send(method_name, *args, &block)
    else
      super(method_name, *args, &block)
    end
  end

  def increment_message_count(message_name)
      message_log = called?(message_name)
      if message_log.nil?
        @messages < < MessageLog.new(message_name)
      else
        message_log.increment_count
      end
  end

  def messages
    @messages.collect { |message_log| message_log.message_name }
  end

  def called?(command)

    matched_message_log = nil

    @messages.each do |message_log|
      if message_log.message_name == command
        matched_message_log = message_log
      end
    end

    matched_message_log
  end

  def number_of_times_called(command)
    message_log = called?(command)

    message_log.nil? ? 0 : message_log.count
  end

end

# The proxy object should pass the following Koan:
#
class AboutProxyObjectProject < EdgeCase::Koan
  def test_proxy_method_returns_wrapped_object
    # NOTE: The Television class is defined below
    tv = Proxy.new(Television.new)

    assert tv.instance_of?(Proxy)
  end

  def test_tv_methods_still_perform_their_function
    tv = Proxy.new(Television.new)

    tv.channel = 10
    tv.power

    assert_equal 10, tv.channel
    assert tv.on?
  end

  def test_proxy_records_messages_sent_to_tv
    tv = Proxy.new(Television.new)

    tv.power
    tv.channel = 10

    assert_equal [:power, :channel=], tv.messages
  end

  def test_proxy_handles_invalid_messages
    tv = Proxy.new(Television.new)

    assert_raise(NoMethodError) do
      tv.no_such_method
    end
  end

  def test_proxy_reports_methods_have_been_called
    tv = Proxy.new(Television.new)

    tv.power
    tv.power

    assert tv.called?(:power)
    assert ! tv.called?(:channel)
  end

  def test_proxy_counts_method_calls
    tv = Proxy.new(Television.new)

    tv.power
    tv.channel = 48
    tv.power

    assert_equal 2, tv.number_of_times_called(:power)
    assert_equal 1, tv.number_of_times_called(:channel=)
    assert_equal 0, tv.number_of_times_called(:on?)
  end

  def test_proxy_can_record_more_than_just_tv_objects
    proxy = Proxy.new("Code Mash 2009")

    proxy.upcase!
    result = proxy.split

    assert_equal ["CODE", "MASH", "2009"], result
    assert_equal [:upcase!, :split], proxy.messages
  end
end

# ====================================================================
# The following code is to support the testing of the Proxy class.  No
# changes should be necessary to anything below this comment.

# Example class using in the proxy testing above.
class Television
  attr_accessor :channel

  def power
    if @power == :on
      @power = :off
    else
      @power = :on
    end
  end

  def on?
    @power == :on
  end
end

# Tests for the Television class.  All of theses tests should pass.
class TelevisionTest < EdgeCase::Koan
  def test_it_turns_on
    tv = Television.new

    tv.power
    assert tv.on?
  end

  def test_it_also_turns_off
    tv = Television.new

    tv.power
    tv.power

    assert ! tv.on?
  end

  def test_edge_case_on_off
    tv = Television.new

    tv.power
    tv.power
    tv.power

    assert tv.on?

    tv.power

    assert ! tv.on?
  end

  def test_can_set_the_channel
    tv = Television.new

    tv.channel = 11
    assert_equal 11, tv.channel
  end
end

SLIM on FitNesse

2008 November 18
tags: ,
by Nayan Hajratwala

Uncle Bob has posted a nice video covering basic usage of the new SLIM framework within FitNesse. It appears to streamline some (but not all) of the annoyances of the current FitNesse processing.

I have yet to try it, but it certainly looks promising, especially for people writing tests for multiple platforms.