The Pair Programming Virus

31 10 2007

Pun intented here.
If you do a lot of pair programming think again

here are some reasons why you should use your own keyboard at all times:)

1) Your pair has a virus ( real kind ) and is sneezing all over the keyboard
2) Your pair had a flu and is recovering from it.
3) Your pair is holding fries in one hand as he./she types and uses the keyboard with the same hand . Umm french fried keyboard.
4) You turn your pairs keyboard on the side and see all the food particles and dandruff fall.
5) Your pair went to the bathroom * enough said:)

If i have convinced you enough carry your own keyboard for pairing sessions and use purell when in doubt:)

Powered by ScribeFire.





Service Oriented Scrum Sprint Planning

19 10 2007

Scrum works well. when its only one project and sprint planning is really focused to that one projects. However the reality in most companies is that many of them are going towards a some kind of service based architecture.

In these cases or in cases where a number of projects are being developed at the same time, scrum planning gets confusing. Since each team is so focused on the current sprint and back log only, it becomes very tough to build dependencies between systems or services at the same time.

Enterprise SOA Sprint planning - ESOP just a fancy name conceived is based on restructuring projects and run dependent projects on the same sprint time line.

All projects will go to sprint planning the same day. The dependent stories are discussed in a common spring planning meeting where both teams are present and then the teams split to plan other stories.

This brings in awareness in all teams and they are aware of the service contract they need to fulfill as a part of this sprint. At the end of the sprint these contracts get fulfilled.

The product owners of each project are typically so focused on thier own project that often they tend to put cross service stories at a lesser priority than thier own stories. The parallel sprint planning would allow them to look at the big picture and plan the stories well.

This also is a fun event. At the end of the sprint the two systems are indeed talking to each other instead of building them in some kind of step approach.

Another fun thing to do is for the scrum masters to switch as moderators of the two teams in the planning meeting. Especially after a few sprints these planning meetings become fairly boring exercise. Switching scrum masters for the spring planning brings about a fresh breadth of air.

Powered by ScribeFire.





System.InvalidOperationException : Previous method ‘XYZ..;’ require a return value or an exception to throw.

8 10 2007

System.InvalidOperationException : Previous method ‘XYZ..;’ require a return value or an exception to throw. If this is haunting you, i may have the answer for that

having used NMock for a while,I have been wanting to try out Rhino Mock framework. Rhinomock is a typed library unlike other mock framworks which use string based paramaters.

However the very first time i used a rather simple implementation I was taken by surprise.

Here is the stub code. When i ran the test i got an error..

System.InvalidOperationException : Previous method ‘XYZ..;’ require a return value or an exception to throw.

Trying to figure this out took a while, onece it worked i felt really stupid. Hence this post so that someone else can save a few hours of
unwanted stress and agony

[Test] [Category("UnitTest")]

public void TestTheCallToService()

{

RequestContract request = new RequestContract();

MockRepository mocks = new MockRepository();

MyService service = new MyService();

MyServiceAgent.IAgent serviceAgent = (MyServiceAgent.IAgent)mocks.CreateMock(typeof(MyServiceAgent.IAgent));

List returnString=null ;

Expect.Call(serviceAgent.GetList()).Return(returnString);

service.GetList(request, serviceAgent);

mocks.ReplayAll();

}
Note the line mocks.ReplayAll();

This should be called before calling the service.GetList

In Rhinomock first we need to set up the expectations like any other framwork. Then we need to replay those lines from the times the recording starts . ( MockRepository mocks = new MockRepository();)

After the repay call, all the mock objects are in the correct state and the actual call to the layer, in this case a business component would actually work.

The code after the change should look like this

[Test]

[Category("UnitTest")]

public void TestTheCallToService()

{

RequestContract request = new RequestContract();

MockRepository mocks = new MockRepository();

MyService service = new MyService();

MyServiceAgent.IAgent serviceAgent = (MyServiceAgent.IAgent)mocks.CreateMock(typeof(MyServiceAgent.IAgent));

List returnString=null ;

Expect.Call(serviceAgent.GetList()).Return(returnString);

mocks.ReplayAll();

service.GetList(request, serviceAgent);

If i have saved you even a minute of time, Do let me know:)
}

   

Powered by ScribeFire.