June 2007 - Posts

Agile Excuses - Introduction

In a recent post, I mentioned that South African companies are reluctant to adopt Agile Software Development practices and methodologies, their reasons often entertaining.

I have stumbled across an article entitled The Agile Method and Other Fairy Tales. In an upcoming blog series, I'm going to rebut some of the arguments that the author puts forward in this paper, amongst some other arguments that I've heard.

To stimulate your appetite a bit, here is the conclusion of The Agile Method and Other Fairy Tales. I hope that it entertains.

Agile proponents believe software development is unique from all other industries. They believe there is nothing to be learned from other disciplines like music, library science, medicine or architecture. Like most individuals in a crunch they default back to a position of comfort. For software developers this is coding. It is not about the code it is about creating products that customers can use.

Agile proponents argue against structured methods because it enforces accountability. Too many software developers want to be left alone so they can code. They want to run free and not be under any rule. They avoid accountability, management, or the idea of reining in costs.

Agile proponents discourage documentation. The software industry does not have reputation of being great communicators or organizers. Instead of trying to improve communication skills, they abandon the idea of communication. It is not possible for large groups of individuals to communicate without structured documentation. Agile proponents discourage a division of labor and argue all software roles are interchangeable.

Agile proponents are the leaders of a dysfunctional industry. They honestly believe no other industry or person can provide good requirements. They also believe nothing can be learned from other industries. It is not the software industry that needs to change, but everyone else.

Related posts:

Posted by trumpi | with no comments
Filed under: ,

Agile Software Development is number 18!

The South African software community is far behind the curve in the adoption of Agile Software Development practices, and the excuses that I hear for not adopting it is quite entertaining. Meanwhile, CNN has published a list called The 50 who matter now. It is a list of "people, products, trends, and ideas that are transforming the world of business" and Agile Software Development is listed in 18th place.

Related posts:

Posted by trumpi | 3 comment(s)

We have no comment

It has recently come to my attention that people reading this blog are having problems commenting when using Internet Explorer. This problem has now been resolved and you can use either Internet Explorer and Firefox to post comments on this blog.

Posted by trumpi | 1 comment(s)

Boo for Microsoft! Or maybe not

For those who think that Microsoft and Open Source can work together, think again and read Scott Bellware's licencing rant that he wrote while trying to figure out how to get Boo into Visual Studio.

Posted by trumpi | 2 comment(s)
Filed under: , ,

What is the fastest, DRYest way to (not) log?

The log4net FAQ asks the question What is the fastest way of (not) logging? It outlines two techniques of logging; I will present one more.

The first technique is the slowest of the three, but contains the least amount of code. The following snippet logs a million times and illustrates the first technique:

   1: for (int i = 0; i < 1000000; ++i)
   2: {
   3:    log.Debug("Number " + i + new Random(DateTime.Now.Millisecond).Next());
   4: } 

The big disadvantage of this technique is this: If debug level logging is disabled, then a lot of time is wasted evaluating the current date, getting a random number and concatenating strings. This is because the parameter to the log.Debug method is evaluated before log.Debug is called. A better way to approach would be the following:

   1: for (int i = 0; i < 1000000; ++i)
   2: {
   3:    if (log.IsDebugEnabled)
   4:    {
   5:       log.Debug("Number " + i + new Random(DateTime.Now.Millisecond).Next());
   6:    }
   7: } 

This way, if debug level logging is disabled, the cost of evaluating the parameter to log.Debug is not incurred. However, this more efficient technique is not very DRY, as we have to litter our code with if statements every time we want to log.

Another technique (not mentioned in the FAQ) uses anonymous methods. This third technique achieves more DRYness than the second technique, and is just about as fast. The following code snippet illustrates this third technique:

   1: private delegate string ObjectDelegate(); 
   2:  
   3: private static void LogDebug(ObjectDelegate d)
   4: {
   5:    if(log.IsDebugEnabled)
   6:    {
   7:       log.Debug(d());
   8:    }
   9: }
  10:  
  11: .
  12:  
  13: .
  14:  
  15: for (int i = 0; i < 1000000; ++i)
  16: {
  17:    LogDebug(delegate { return "Number " + i + new Random(DateTime.Now.Millisecond).Next();  });
  18: }
  19:  

How do these techniques match up performance wise? I've written a small console application that measures how long each of these techniques take to not log 1,000,000 times. I ran the application 10 times, and here are the results (in milliseconds):

Slow yet DRY technique Fast, not DRY technique Fast, DRY technique
156 62 78
375 78 78
343 78 78
968 93 78
843 62 78
234 93 62
187 78 78
265 62 78
328 78 62
281 62 78
Posted by trumpi | 3 comment(s)
Filed under: ,

How to audit your Subversion branches

One of the greatest features of Subversion (and any other decent source control tool) is the ability to branch. Branching allows development to occur in parallel streams and allows changes to be safely propagated from one development stream to another.

These features work well, but one often finds that developers forget to merge their changes back to the main development stream, or to use Subversion's terminology, developers forget to "merge back into the trunk."

Now there are several steps that one can take to ensure that this does not happen. One method is to insist that developers merge their changes back into the trunk immediately, but under high pressure forgetfulness is rife.

This is where the daily audit fits in. For a daily audit, you simply generate a log of yesterday's branch commits and try to match them to yesterday's trunk commits.

Using Subversion, here is the process step by step:

Step 1: Get a log of yesterday's branch commits

I prefer using the command line to do this. That way I can send the log to a text file. To get the branch commits for yesterday (5 June 2007), I use the following command line:

svn log https://localhost/svn/projects/Foo/branches/2.x -r {2007-06-05}:{2007-06-06} > c:\branches.txt

Let's say that the file branches.txt looks like this:

------------------------------------------------------------------------
r205 | tom | 2007-06-04 18:32:47 +0200 (Mon, 04 Jun 2007) | 1 line

Added view persistence for ChooseCountry View
------------------------------------------------------------------------
r207 | mick | 2007-06-05 14:59:57 +0200 (Tue, 05 Jun 2007) | 1 line

Added SharpZipLib.dll to implementation/lib/
------------------------------------------------------------------------
r208 | harry | 2007-06-05 15:27:13 +0200 (Tue, 05 Jun 2007) | 1 line

The report was displaying generalName in the place of comradeName. Corrected the error.
------------------------------------------------------------------------

In this file we have 3 revisions. We can ignore the first entry as it falls outside the date range that we specified.

Step 2: Get a log of yesterday's trunk commits

Execute the svn log command again:

svn log https://localhost/svn/projects/Foo/trunk -r {2007-06-05}:{2007-06-06} > c:\trunk.txt

Now assume that the trunk.txt file looks something like this:

------------------------------------------------------------------------
r206 | tom | 2007-06-04 18:35:40 +0200 (Mon, 04 Jun 2007) | 1 line

Merged revision 205 from the 2.x branch
------------------------------------------------------------------------
r209 | harry | 2007-06-05 15:30:31 +0200 (Tue, 05 Jun 2007) | 1 line

Merged revision 208 from the 2.x branch
------------------------------------------------------------------------

Again we can ignore the first entry because it comes from 2 days ago. At this stage I print the two files out.

Step 3: Mark off the branch commits that have been merged

Notice two things about the log messages in the trunk's log: First, it contains the word merged. This makes the log searchable. Having a searchable log will make the audit process a lot easier as it allows you to grep the relevant log messages.

Second, notice that the revision number of the branch commit and the  branch instance is included. This allows you to trace the exact log entry in the branch's log. When you have located the log entry on the branch's log, mark it off.

From this example, you will notice that the user mick has not merged his changes from revision 207 to the trunk.

Step 4: Follow up

If "missing" merges are detected, it is probably a good idea to find out why. Perhaps forgetfulness has crept in. Perhaps that revision was not intended to be merged to the trunk.

I hope that this is useful. It has served me very well over the past six months or so as I review the work of my fellow developers. I hope that it will serve you too.

Posted by trumpi | with no comments
Filed under: ,

SourceGear release DiffMerge - for free

image

A good, free, 3-way merging tool is very difficult to come by. Most tools that diff and merge either are not free, or they do not support 3-way merging, or they are simply have limited editing capabilities.

Up to now, I have only found one tool that features all of these characteristics. However, SourceGear have now changed that by releasing their DiffMerge tool for free.

DiffMerge includes features such as graphical diff, graphical merging between 3 files, folder diff, rulesets per file type and it is cross platform. Embarrassingly, the tool does not support keyboard shortcuts.

Configuring TortoiseSVN to use DiffMerge

After installing DiffMerge, you can configure TortoiseSVN to use DiffMerge as the default tool to diff files and to resolve conflicts. Navigate to the Settings screen in TortoiseSVN and locate the Diff Viewer option on the left. Enter all the options like the screenshot below.

image

The text in the textbox is as follows:

"C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe" /t1=Mine /t2=Theirs %mine %theirs

Then click on the Merge Tool option on the left, and fill the form values in the same way, except that the textbox should have the following text:

"C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe" /t1=Mine /t2=Base /t3=Theirs /r=%merged %mine %base %theirs

The next time that you edit a conflict while using TortoiseSVN, DiffMerge will open.

image

Microsoft announces "Acropolis" for building composite client applications

From Kathy Kam's blog:

So what exactly is this project? "Acropolis" is a set of components and tools that enables you to build composite client application. Great client application has three main components. It has to be cheap to buld, easy to manage and offers a high quality user experience. "Acropolis" plans to address all three areas. We plan on delivering a rich design-time toolset to help you compose the application beyond the UI. We have an architecture that enables developers to build their application in a composite manner making it easy to build. Finally, it offers prebuilt common components and services, that developers can use to deliver great user experiences in minimal cost and also makes the application easy to manage.

Download Acropolis from http://windowsclient.net/Acropolis.

Posted by trumpi | 4 comment(s)
Filed under: ,

ALT.NET - What's hot; what's not

Roy Osherove has published a list of hot or not technologies - most of the "hot" technologies living under the ALT.NET banner and most of the "not" technologies coming from Redmond.

I've decided to follow suit and publish a list of my own. Here's what I think are my hot or not technologies:

Hot Not
Monorail ASP.Net, Web forms
NUnit, MBUnit MSTest
NAnt MSBuild
Agile BDUF, Sign-offs
iBatis NHibernate, MS Entity Framework
Google code hosting Codeplex
Subversion, Cruisecontrol.NET and Trac Team Build
Test Driven Development MSTest
dotnet.org.za, Feedburner Windows Live Spaces
Jeremy D. Miller's Winforms posts CAB
Spring.NET Object Builder

Anything to add?

Update: I found a response to Roy's post by Bil Simser where he also posts his HOT or NOT list.

Update: Sam Gentile has just posted his list, along with a detailed description of why he is ALT.NET.

Posted by trumpi | 3 comment(s)