Sunday, August 22, 2010

Subtractive Merge

Programming is a fun thing, sometimes the best thing you can do is to remove or undo what you have done. There are many reason for this, some of which could be:
  • You were trying out something and it did not work as planed.
  • You were using a new version of a library and it has bugs in it.
  • You made changes that were not needed and what to just go back to an old version.
In the end, the result is the same, you have changes that you made and now you want to get rid of them.


If you are using a Code Management System, what you'll need to is a subtractive merge. A subtractive merge is a way to remove or undo changes.

Say you have the following Ruby code

Version 1:

# Hello World program in Ruby

puts "Hello World"

Version 2:

# Hello World program in Ruby

puts "Good Bye World"

Version 3:

# Hello World program in Ruby

puts "Good Bye World"
puts "Hello world again"


Say you are currently at the third version of code ("Hello world again") and you want to go back to the first version of the code ("Hello World"), what you'll need to do is subtractive merge back to the first version of the code.

The way to think of a subtractive merge is that you are removing changes that were done. In the case of doing a subtractive merge back to version 1, creating a new version 4 of the code we will have the following for version 4 of our code:

Version 4:

# Hello World program in Ruby

puts "Hello World"

Example in ClearCase:
To do this in ClearCase from the command line you would do the following:

cleartool merge -to filename -delete -ver \main\branch\versionNumber \main\branch\versionNumber

Example with file hello.rb in the \main\dev stream:

cleartool merge -to hello.rb -delete -ver \main\dev\2 \main\dev\3

Next time you find yourself wanting to rollback or undo changes, try a subtractive merge.

Wednesday, August 4, 2010

What Side of the Tracks Should I Be On?

Whenever I can, I try to take a train to the city. Trains are great: no traffic jams, no trouble finding a parking spot, and no taking the wrong exit off the highway. Plus they are green (for the most part).

One thing I noticed is that most of the time the train station gives no indicator as to which side of the tracks to be on. In the morning when there are lots of people going to work, this is not an issue. Just go to where the people are. However, this does not work at odd times when you might be the only person at the station.

When at a station by one's self I find the general rules to help tell which side of the tracks to be on.
  • Most people wait for the train in the morning on their way to work in the city, when they get off the train on their way home they do not wait around they just leave; therefore the benches and covered waiting areas are on the side of the tracks going to the city.
  • If benches and covered waiting areas are on both sides of the tracks, the side with more benches and larger covered waiting areas is the side going to the city (the reason is volume).
  • If there are three or more tracks with a fence splitting the tracks, the slide of the fence with more tracks is the side going to the city (again the reason is volume, but this time in the number of trains).
Following these simple rules should help get you on the right side of the tracks, if they do not work please let me and others know by commenting.

Monday, July 5, 2010

Use Pictures to Communicate Not Words

As I move up the ranks at work I find myself asked more to share my ideas; as I get to present my ideas I noticed that the more casual (i.e. drawing on a white board) I present my ideas the better they "go-over" and get remembered by others.
Not only do my ideas "go-over" better with others, they also are more memorable to people. The order seems to go, from worst to best, verbal/Word without images, check list, Power Point/Word with text and pictures, and best of all, white board. I believe this happens for a few reason, but I the number one reason is words can have different means to different people.

Think about it, how often do two different people get the same mean from reading the same thing? Not often. If we did then we would not have introductions to books and teachers would not do anything but read to their classes. No, it seems that just words are bad at communicating ideas to people. Pictures are much better at communicating ideas and staying with us after the presentation. In fact most of our brain (75% according to Unfolding the Napkin) is used for processing what we see.

Which do you find communicates how a Data WebService works better?
Next time you need to communicate something to someone, try using a picture or two.

Wednesday, May 19, 2010

Software Testing 101: Boundary-value analysis

Welcome to Software Testing 101, a guild to assist in the testing of software. Today's topic, boundary-value analysis also known as boundary testing.

Boundary-value analysis is used to test the boundary of a process. For instance, say we have a process which can take inputs between 1 and 100. How can we test the process with the minimal amount of test cases (in most work environments it is hard enough to get enough time to test the cases needed).
What we want to do, to test this process, is to test the boundary or edge condition. The boundaries of this process are 1 and 100, therefore if we test integers around 1 and 100, we would be testing the boundary.

In order to test any boundary, fully, you would need three test cases:
  • Out side the boundary
  • Exactly on the boundary
  • In side the boundary
In this case for the lower bound of 1, we should test 0 (one out side of the boundary), 1 (exactly on the boundary), and 2 (one in side the boundary). Likewise for the upper bound of 100, we should test 99 (one in side the boundary), 100 (exactly on the boundary), and 101 (one out side of the boundary).

By using boundary-value analysis we are able to limit the number of test cases and fully test the boundary of a process.

Tuesday, May 11, 2010

Upgrading to Ubuntu 10.04 LTS


Just upgraded my Dell Vostro 1500 to Ubuntu 10.04 LTS on Saturday (May 8, 2010) and so far I love it!

I made the upgrade because it is a LTS (long term support) release, but the main reason was, I was having issue with my wireless connecting to U-verse. I am happy to say, the upgrade has seem to resolve my wireless connectivity issues. I can go back to watching Bleach in my bedroom if my wife wants to watch something in the living room (I am on episode 263, 幽閉?!千本桜&蛇尾丸).

Other benefits of the upgrade include:

Faster boot time (it seems to be faster to me)
Better looking default desktop and style
Sound working out of the box (even Flash sound in Chrome)

Over all I am loving the upgrade. Nice work Ubuntu team!