Pages

Wednesday, December 16, 2009

Are you cultivating your software development expert mind?

What are you doing to build your proficiency in software development? It's something I've been interested in lately. How do you develop an expert mind in software development? I spend my day consulting and I notice that most of the people that I develop software solutions with day-to-day do not spend any time outside of work cultivating their development skills. I'm somewhat dumbfounded by this phenomenon. Is this commonplace elsewhere?

I spend a fair amount of time reading books and then applying the reading to personal coding projects. Typically I have used these projects to learn a new technology. Recently I've started working through Dave Thomas's Code Katas. From Dave's Code Kata website:

Code Kata is an attempt to bring this element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many different ways. Some are open ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer.


So, again, what are you doing to practice software development?

Friday, November 13, 2009

Not a fan of Apple's new Magic Mouse

I recently purchased the new Apple Magic Mouse and after about a week of on and off use, I'm not a fan of it. For me, the laser tracking is terrible. I thought it might be the desk so I bought a mouse pad (remember those) and though the mouse pad made tracking a bit better, the Magic Mouse laser tracking performance is irritatingly poor on both the desk and mouse pad surfaces. It's a beautiful device, but it's basic performance is just terrible from my experiences with it. I'm going to hang onto it for a while and see if the driver support gets better over time.

Anyone else seeing issues with the basic laser tracking performance?

Wednesday, November 11, 2009

Using argument matchers in EasyMock and mockito

I spent some quality time with EasyMock today while coaching some developers on building tests around an existing codebase. We were mocking a dependency of our SUT and the method call that we wanted to mock had two parameters. When we wrote the expectation, we used the anyObject() matcher for the first parameter and tried to perform an exact match on the second parameter, a Boolean. Here is an example of what we were trying to do in EasyMock (NOTE: we statically imported EasyMock so we could reduce the amount of code noise by not prefacing our expect, matcher, replay and verify invocations with EasyMock.):


expect(mockObject.retrieveSomething((String) anyObject(), false)).andReturn(someObject);


Unfortunately, EasyMock and mockito do not like this. They both want you to use matchers for all parameters if you use matchers for any parameters. However, the two libraries react quite differently when this situation occurs. EasyMock complains with a somewhat confusing message that at first blush makes it seem like we declared the expectation for multiple invocations. It really threw us off for a while (at least an hour) trying to figure out what was wrong with our expectations. Here is how we fixed it in EasyMock:


expect(mockObject.retrieveSomething((String) anyObject(), eq(false))).andReturn(someObject);


Mockito does a much better job of stating that when you use a parameter argument matcher in your expectation, you have to use parameter argument matchers for all of the parameters of the method call participating in the expectation. I find it interesting that mockito retains the behavior of EasyMock (mockito is a fork of EasyMock) with regards to argument matching, but mockito improves on the error messaging when something goes wrong with the mock object setup. Further reinforces my decision to forego EasyMock in favor of mockito.

Getting a handle on code quality with Sonar

I've been working with a client recently who uses Sonar, an open source code quality management platform hosted at Codehaus. I'm thoroughly impressed with this tool. If you want to see what the tool can do without investing the time in installing it, take a look at the various screencasts. They also have a live version of Sonar up so you can play with it without installation.

We've been working on getting unit tests built around a legacy code base and Sonar has been a big help in identifying classes that are the biggest code coverage offenders. We used the Clouds feature, a word cloud that weights the class names in the cloud based on code coverage and complexity. The less test coverage on the class and/or the more complex the class, the larger the weight of that class name word in the word cloud. It really helped us focus on where to direct our testing efforts.

I have yet to get this tool up and running in one of my own projects, but things are finally starting to simmer down now with consulting and training activities that I hope to focus on building out a CI environment using Hudson and hooking in Sonar to that environment. Stay tuned.

Tuesday, November 10, 2009

Promoting keystroke use in Eclipse

If you want to promote key mappings use in Eclipse, MouseFeed might be your ticket. This Eclipse plugin monitors your mouse usage, and when you click on a UI component (button, menu, etc.) that can be invoked by key stroke, the MouseFeed plugin will pop up a small notification window stating that the action has a key mapping. The notification window disappears after a few seconds, but it's power is obvious. Very similar to the Key Promoter plugin in IntelliJ IDEA. Very cool Eclipse plugin.

Here is a screencast of the MouseFeed plugin in action:

Thursday, November 05, 2009

Completed another Test Driven and Refactoring course for DevJam

This time using C# and the .NET platform. The course went over really well, though we did have some small snafus with the training area in the DevJam office. Nothing that can't be tweaked. I had 15 participants in this class. All participants pair programmed when completing the hand-on exercises and again, I'm totally amazed at how well pair programming goes over when you get people away from their normal work environment. Everyone really grooved on the pair programming thing.

One area that we will need to work on is the mock objects content. We don't have any hands-on exercises for using mock objects and we heard about it in the reviews of the course. I did walk everyone through a demonstration of using mock objects in your unit tests, but I mis-gauged how much interest the participants had in mock objects and the desire to get their feet wet with mock objects. Some of the class participants stay after the course ended and we did another 40 minutes of live coding demos on the use and features of mock objects (using moq for the mocking framework in .NET).

All in all, an awesome two days for me and hopefully for the course participants.

Tuesday, October 27, 2009

Test Driven and Refactoring class in Chicago

Completed a two day Test Driven and Refactoring class in Chicago today. The class went really well and I think I really was able to get a few developers to come down off the TDD fence and really buy into it. That is always satisfying. The class was again offered by DevJam.

I did have a few participants that actually bowed out after the first day of training. One in particular was very abstinent about not writing tests and really does not believe unit testing and TDD in particular are useful in software development. This person was very much in favor of big design up front. This person's views really threw me for a loop. The group that I gave the training to has significant issues with quality, so the view of testing not worth the effort seemed very ironic in this situation. Needless to say, I was not able to get this person to realize how unit testing and TDD help you in the design process. Oh well, you can't win them all over.

I heard a lot of good feedback around the mock objects example that I demonstrated. In this example, I demonstrated not only behavior verification with the mock objects, but also was able to demonstrate capturing indirect outputs on the mock objects and then verifying the state of these indirect outputs. I used mockito 1.8 for the demo. All in all a great class.

Second Groovy and Grails training in the bag

Completed my second Groovy and Grails training for DevJam this past Saturday. This training session was much smoother than the first training. Still too much material and exercises to be taught in just one day. Received a lot of good feedback from the participants and hopefully this feedback helps solidify the training. I'm always amazed at how much stuff I could focus in on for the Groovy training. Really need to beef up the meata-object protocol stuff in the Groovy training.

Wednesday, October 07, 2009

Using the new Groovy-Eclipse V2 plugin

Started using the new Groovy-Eclipse V2 plugin. I'm continuing to fine tune some Groovy training that I've come up with in collaboration with DevJam. So far so good. Seems to work pretty well. I'm not expecting much at the moment, but the alpha seems pretty stable. We need an open source Groovy IDE for the training, and I would love to use Eclipse and this plugin to fulfill that role. I think I still prefer IntelliJ for Groovy stuff (it seems more mature), but it costs some money and most people are using Eclipse these days.

Monday, October 05, 2009

First Groovy and Grails training is in the bag

I made it through my first test run of Groovy and Grails training for DevJam this past Saturday. Had a couple of snafus occur. Nothing major and easily fixed. Did learn a couple of things though:

Don't put developers on an operating system that they don't know for training

The DevJam training has Mac minis which boot either Mac OS X Snow Leopard or Windows Vista (via Bootcamp). I had the systems booted to Mac OS X for the training. Unfortunately all of the developers that came to this training were unfamiliar with Mac OS X, but willing to try it. Bad move on my part. I ended up answering far too many questions on the operating system and which tools were were going to use. Oracle SQL Developer also gave me problems in the Mac OS X environment when trying to update the tool with the MySQL drivers through its software updating system.

If you think you have enough code examples, you don't!


I had about 10-12 Groovy code examples to demonstrate various features of the language. Far too few for the questions that cropped up. Luckily, it was Groovy and writing new code examples or changing existing code examples was pretty straightforward. Kudos to Groovy for being very easy to explore and play with. The participants thought very highly of the interactiveness of the coding during the session.

Don't try to do both Groovy and Grails in a single day.


I knew going in that doing both was going to be very difficult. I just didn't realize how difficult it would be. Again, due to operating system and tool snafus, I didn't finish up the Groovy stuff until well into the afternoon. Not much time for Grails. I was looking forward to the exercise in Grails and we didn't get very far with it.

Automate the packaging of the student materials in electronic format.


We decided to put all the training handouts, examples, and anything else helpful for the students on 4 GB flash drives and give the flash drives to the students to keep. That's good. What's not good is missing some things on the flash drive and updating flash drives during the course. Next time I'll use an Ant build script to build a distribution and clean out any Subversion metadata from the student materials.

The Groovy Eclipse plugin seems to be making headway.


One of the participants in the group, Nick Spilman, had his laptop along and was using Eclipse Galileo and the new Groovy Eclipse plugin during the Groovy portion of the training. He thought it worked well with Groovy. I used IntelliJ 9.0 EAP (Maia) and that also works well. Looks like SpringSource (or shall I say VMware now) is getting serious on the tooling for Groovy and Grails.

Need to spend more time on understanding Groovy's meta-programming facilities.


It's one thing to use Groovy and use its meta-programming faclities (aka MOP) successfully in your own work. It is a far different thing to try and teach others about Groovy's meta-programming facilities. Teaching a concept, especially a concept as complicated as meta-programming, is extremely difficult.

Performing test runs of presentations and trainings is essential.


I'm very pleased that I was afforded the opportunity to be able to offer a couple of test runs of this training to some developers before offering it to the public. Like anything else, it takes practice and feedback to get good at something. I have another test run of this training later this month and I'm sure it will be much better than it was the first time out.

Saturday, September 26, 2009

ColorSchemeDesigner.com

If you're developing a website and need to pick out a color scheme, take a look at ColorSchemeDesigner.com. Great webapp for picking color scheme. Liked it so much I donated some money to the developer. Highly recommended.

Monday, September 21, 2009

Video conversion with HandBrake

I have a JVC Everio HDD camcorder that I haven't used very much until just recently. Looking for some software to convert the MOD formatted video files on the Everio to a different format, I happened upon HandBrake. HandBrake did a nice job of converting the video to something I can use in QuickTime. Very impressed with this piece of open source software.

Thursday, September 17, 2009

Is Spring Framework becoming a configuration nightmare?

I had a crappy day dealing with Spring Framework 3.0 M4. I've been using Spring since 2004 and I've been a big fan of its use. Lately however, I've become concerned that Spring Framework is turning into another EJB, a configuration monster. I've been using Spring 3.0 M1 for a while now and recently upgraded to M4 to get access to some new Spring MVC annotations, @RequestBody and @ResponseBody. These annotations allow you to bind directly to the request body and response body, respectively. They're very helpful if you are using Spring MVC for ReSTful web services. They seemed relatively innocuous, but after some time with them, they are much more complicated to configure than one might expect from Spring. Still don't have a working solution with these new annotations. Part of it is the documentation isn't where it needs to be, but that will hopefully be remedied by the time 3.0 is GA. In the meantime, I'm stuck on the damn configuration of view resolvers, mapping adapters, and what not. Configuration kills! I've had the chance to work on Grails and I must say, I am very much longing for another opportunity to work on that platform. I realize that Grails uses Spring, but Grails also keeps Spring away from, behind the covers for the most part, so I can build solutions for my client instead of muddling through configuration acrobatics.

Tuesday, September 15, 2009

Keeping traceroute/tracepath by my side these days

Ugh! All sorts of networking issues lately at work. Each environment is set up differently from a networking standpoint. Makes promoting code a pain in the butt. I've been giving traceroute and tracepath both a workout these past couple of days. Who says learning Unix utilities is a waste of time in this day and age of graphical desktops and networking utilities. One tip from today: Make sure you specify the port that you want to route to in the traceroute/tracepath invocation. In our case it did make a difference ;-)

Monday, September 07, 2009

Snow Leopard ships with Subversion 1.6.5 support

Just upgraded to Versions 1.0.5 and noticed that Snow Leopard ships with Subversion 1.6.5 libraries and command line tools. Very cool. I'm assuming Xcode 3.2 also uses Subversion 1.6.5.

Thursday, September 03, 2009

Snow Leopard installation frees up a ton of disk space

Approximately 17 GB in my case. Not too shabby. Now I have to get Xcode 3.2 and the iPhone SDK add-on installed. BTW, the iPhone SDK installation now expects Xcode 3.2 to be previously installed, so make sure you've installed it off the Snow Leopard distribution. The 404 MB file size of the iPhone 3.0 SDK for Snow Leopard should be tip off if you've installed previous iPhone SDKs.

.NET thread local storage implementation kicks my butt

I got skooled today in .NET. I wrote a thread-local storage abstraction using named data slots some time ago. Avoid named data slots at all costs! Use the ThreadStaticAttribute instead. Not only is the ThreadStaticAttribute much easier to implement, but it performs better also. I had to wait till my code was in a near-prod environment before enough load could be generated to cause the race condition to occur. It took me about 2 days of debugging to find the issue. Most importantly, read the damn documentation before you attempt to write some threading code. There are some subtle issues in the .NET Base Class Library that I would have avoided if I had read the MSDN site. Very embarrassing.

From Microsoft:

The .NET Framework provides two mechanisms for using thread local storage (TLS): thread-relative static fields (that is, fields that are marked with the ThreadStaticAttribute attribute) and data slots. Thread-relative static fields provide much better performance than data slots, and enable compile-time type checking. For more information about using TLS, see Thread Local Storage: Thread-Relative Static Fields and Data Slots. (http://msdn.microsoft.com/en-us/library/system.threading.thread.allocatenameddataslot.aspx)

Monday, August 31, 2009

Mac Pro upgraded to Snow Leopard

Painless install of Snow Leopard on my early 2009 Mac Pro. I don't really notice much new. System seems a bit snappier, but that purely qualitative observation on my part. No numbers to back that up.

Tuesday, August 18, 2009

Know your SUT and your mocks

I was working with a colleague of mine tonight and he became confused with his unit test. It was an interesting exchange, so I thought I would write it up. He had a system under test (SUT), a service, that had a number of dependencies. The dependencies were mocked using a mocking framework (mockito in this instance). He was writing a test to get better code coverage in preparation for some refactoring and he started to add an expectation to the SUT. When he ran his test, the test failed, but the error lead you to believe that it was the improper use of matchers within mockito. It took him and I awhile to realize that he was trying to add expectations to a non-mock class. In hindsight, he should have picked up on this right away, as we have a coding convention of naming our mock object instances as mock*. The SUT does not follow this naming convention and hence you should see the problem right away. A little concerned that mockito didn't alert us to the fact that we were trying to add expectations to a non-mock instance. Moral of the story: Make your mock object instances stand out--name them appropriately so everyone knows that it's a mock.

Wednesday, August 12, 2009

My top 5 favorite Mac OS X apps/tools/utilities

One of my friends is buying his first Mac (a Mac mini) and I told him I would compile a list of tools and utilities that I use on my Mac systems. Here are my top 5 that I absolutely must have:


  • Google Quick Search Box/Quicksilver: I was a big fan of Quicksilver, but it seems to be dead. Sounds like the Quicksilver developer is now working with/for Google on something similar: Google Quick Search Box (QSB). Love QSB and it seems to be in active development too.


  • iTerm: Gotta have a command line. This one does tabbed terminal consoles.


  • TextMate: Great programmer's editor.


  • Versions: A good Subversion client for OS X.


  • Growl: Notification system. Extremely helpful.







Sunday, June 21, 2009

First reactions to Xcode 3.1.3

Code Sense seems to be much better. Acts intelligently and pressing Return on the suggestion selects the suggestion. It's been a while since I've been in Xcode, but I remember the Code Sense being somewhat odd. That doesn't seem to be the case now. BTW, I'm using Xcode from the iPhone SDK released last week.

Thursday, May 14, 2009

Learn IDE key mappings while pair programming

I'm a big believer in keeping the hands on the keyboard and minimizing the amount of mouse use when coding. Therefore, I tend to spend some time learning the keymappings for the IDE I am using. I'm most proficient with IntelliJ IDEA but I've also learned a good portion of the keymappings in Eclipse and Visual Studio+ReSharper.

I've been doing a fair amount of pair programming lately on my current gig, a good thing. One behavior that we have been practicing while pair programming is gently forcing the driver of the pair to use keymappings to activate various actions within the IDE. Neal Ford describes this in his book The Productive Programmer. Practicing this behavior while pair programming has proven very valuable to increasing our productivity while in the code base. Neal mentions the KeyPromoter plugin for IntelliJ; I've tried this plugin and I haven't become a big fan of it. Much easier if your navigator keeps you honest.

I've done this before with pair programming while working at Identix in 2004 with Hans Loedolff. Hans knew all the IntelliJ keymappings and could type at about 90 words per minute. He was an excellent pair programmmer.

nmon performance monitoring tool

One of the takeaways from yesterday's Tomcat Expert Series seminar was the use of nmon (Nigel's monitor), a curses-based performance monitoring tool. I had never heard of nmon before yesterday, so I was curious why I missed this tool in my IT travels. Seems the tool has originated out of IBM, originally on IBM's AIX Unix variant. The tool has been ported to Linux. More information here. If you're deploying onto Linux or AIX, it might be worthwhile to take a look at this tool and add it to your systems. Unfortunately it does not look like there's a version for Mac OS X yet. Hey, OS X is Unix too ;-)

Wednesday, May 13, 2009

Tomcat Expert Series here in Minneapolis

Attended the SpringSource Tomcat Expert Series seminar here in Minneapolis this morning at the Hyatt Regency. Filip Hanik of SpringSource presented. Filip is a major committer to the Apache Tomcat project. Excellent technical presentations on Tomcat and JVM performance tuning tips and debugging JVM memory and thread issues. Lots of good information around Sun's generational heap and garbage collecting the heap, If you get a chance to take this presentation in, you won't regret it. $75 USD for 3.5 hours and a nice lunch. Seemed like a nice turn out, probably 120 or so attendees. SpringSource seems to be picking up momentum in the JVM space with recent acquisitions of G2One (Groovy and Grails consulting and development) and Hyperic (web application monitoring and management tooling). Could be well positioned when the economy comes out of this funk it's currently in.

Friday, April 24, 2009

Adding GNOME to Ubuntu Server

I needed to add in an Xserver to my Ubuntu Server--Oracle 11g installer is graphical. I didn't want to play the redirecting of the X display back to OS X, so I did some searching and found this discussion. I'll reproduce the steps that I took. The forum posting has many different solutions.

Update your package system.
sudo apt-get update


Install the Ubuntu desktop package. This package seems to be a super package containing many package dependencies. It literally downloaded about 1.7 GB of software. Gdm is part of this install, so you don't have to do an individual install of that after the fact.
sudo apt-get install ubuntu-desktop



Gdm automatically starts the X system during bootup. To configure it to start, do the following:

sudo /etc/init.d/gdm start



You may need to reconfigure your video card, keyboard, etc. To do so, do the following:
sudo dpkg-reconfigure xserver-xorg


Thursday, April 23, 2009

Installing VMware Tools on Ubuntu Server

I'm brining up an Oracle 11g install on Ubuntu Server here at home, and I had a need to install VMware Tools on the server installation before I got hot and heavy into the Oracle installation. Here are some great instructions on how to do just that. I'm using VMware Fusion 2.0.4 on a Mac OS X 10.5.6 host system. Seems VMware has released the source for VMware Tools and you can now get it from an Ubuntu apt repository.

Saturday, April 11, 2009

Excellent Digg Dialogg with Trent Reznor

Excellent video with Trent Reznor of Nine Inch Nails. Kevin Rose of Digg hosts and the questions are from the community, voted up on Digg. Excellent content around Trent's efforts on alternative music distributions and business models. He also mentions his interactions with id Software and John Carmack. Has some nice comments about the programming profession. Well worth watching.

Sunday, April 05, 2009

Embedded domain components in Grails

The embedded component feature of Grails is not documented very well, in my opinion. Therefore, I thought I would create a blog entry so others don't have to spend the time trying to experiment with it to get it to work.


I recently spent some time working on a home project that I have implemented in Grails 1.1. Grails has a feature for embedding domain components into other domain classes. An embedded component participates in the domain class mapping to a database table; there is no join to an child embedded component table. In my domain object model, a TimeRecord is a domain component suitable for embedding. It doesn't live on its own, but is meant to be embedded as a reusable component throughout my domain object model. Grails has first-class support for embedded components, though it took me a bit of time to figure out how to get it to work. First the definition of the TimeRecord class:



class TimeRecord {
TimeRecordUnits units
BigDecimal value

static constraints = {
units(nullable: false)
value(nullable: false)
}
}

Nothing earth-shattering here. The reference to TimeRecordUnits is a Groovy enum. The TimeRecord class is not meant to be mapped to its own table in the database; it will become part of any domain object's table mapping whenever it is embedded in that domain object class. Thus, the TimeRecord class definition needs to reside inside some other domain object's Groovy file. Strange behavior, even for convention over configuration, but it does work.


Now embed the TimeRecord in another domain object class and that domain object's table mapping will also have TimeRecord properties mapped to it. Here is my Story class that has a TimeRecord contained in it:



class Story {

TimeRecord estimate

static embedded = ['estimate']

}

I've removed other Story properties to focus on the embedded component mapping. Grails has a static property named embedded that specifies the component object property that should participate as an embedded association. That's it. I put the TimeRecord definition in the Story.groovy file, directly after the Story definition. Everything maps correctly to the database and I don't get an extraneous time_record table being generated by GORM. Pretty cool.


I must say that domain object modeling in Grails is much, MUCH faster than it is in Java with Hibernate. I'm at least an order of magnitude faster with GORM in Grails than I was in Java and Hibernate. I'm hooked on Grails convention over configuration theme.


Powered by Zoundry Raven

Sunday, March 22, 2009

Grails domain object modeling with Groovy enums

I had a need to use enumerations within my object model in my Grails app today. I wrote up a Google Sites page about my solution. I am using Grails 1.1 for this solution.

Sunday, March 08, 2009

Having another look at Grails

It's been a while since I've really worked with Grails. I used it in 2007 for about 7 months, but we really didn't use it in a typical fashion, as the front end was done in Adobe Flex. 2007 was also fairly early in the life of Grails; I remember using version 0.5.6 when I started at the client.

I'm now building a sample application in Grails 1.0.4 and doing all the AJAX stuff in jQuery. I'm really impressed with Grails now! It's so much more productive than I remember it. Also, I have a couple of books that have been absolutely essential to getting me going with Grails again: The Definitive Guide to Grails, Second Edition and Groovy and Grails Recipes. I'm using IntelliJ IDEA 8.1 for all my development and its Groovy and Grails support is much better than I remember it. JetBrains really makes it easy to give them money every year for a personal license upgrade for IntelliJ.

I haven't been super pleased with the Grails documentation on the Grails site and hopefully SpringSource has a positive effect on this issue in the near future. My development has been plowing ahead very nicely. I really like that I don't have to restart the application server for every little change. That saves a ton of time and has a positive effect on your ability to stay focused on job at hand. Very impressed with Grails this time around.

Thursday, March 05, 2009

The amazing effect of Apple's iPhone platform and the App Store

Michael Tyson has a very relevant post about the amazing effect that Apple's App Store has been having on creative individuals who are driven enough to build applications for the iPhone platform. I'm around quite a few people who have iPhones. It's amazing to see and hear their enthusiasm for this great platform. Michael's post is a great testament that software development can be very rewarding. Great encouragement for those interested in looking at Objective-C and Cocoa Touch.

Tuesday, March 03, 2009

IntelliJ's support for @AspectJ pointcuts in Spring 2.x AOP

I came across a really nice feature in IntelliJ IDEA 8.1 (it may be in earlier versions, but I'm using 8.1). I've been doing some AOP work within Spring Framework 2.5.6, using the excellent @AspectJ pointcut annotations. Once you have everything configured in your Spring application context, IntelliJ will start to annotate where pointcuts are being applied within your code. The annotation/emblem shows up in the left hand gutter of the editor window, right next to the line numbers. Clicking on the emblem will cause a popup listing of all the advices that are applied at that particular join point. You can even navigate directly to the advice from the popup. Very cool. Eclipse has something similar with their AspectJ development tools (AJDT), but this is the first time I've seen something like this in IntelliJ, my preferred Java editor.

Thursday, February 26, 2009

Versions, a native Mac OS X Subversion client

Just bought a license for Versions, a native Mac OS X Subversion client. I've been playing around with Versions in pre-release form and really liked it. I did have some troubles with previous releases reading my 1.5-based working copy, but that seems to be fixed in the 1.0.3 version of the Versions client. I really like the responsiveness of Versions and they have a very clean and uncluttered UI. Previously, I was using SmartSVN. Check it out, I think you'll like what you see.

Tuesday, February 17, 2009

Google Sync for the iPhone

Just came across a new feature of Google Calendar today, Google Sync for your iPhone...

http://www.google.com/mobile/apple/sync.html

I immediately set this up on my iPhone and it works great.

Monday, February 16, 2009

Interesting Microsoft Research paper on the efficiency and effectiveness of TDD

From cLabs Blogki:


http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf


Case studies done on 4 development teams (three at Microsoft, one at IBM) that have adopted TDD. Results of the case studies indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects tha tdid not use the TDD practice. The teams subjectively said that they experienced a 15-35% increase in initial development time after adopting TDD. Very interesting paper.


Powered by Zoundry Raven

Sunday, February 08, 2009

TED iPhone app is very cool

I seemed to have missed the release of the TED iPhone application. If you're into TED, the iPhone app is done very well and the video quality is great. You can download it from the App Store.


Powered by Zoundry Raven

jQuery resources, tutorials, tips

If you're into jQuery, this blog entry has a plethora of jQuery resources, tips, tricks, and tutorials.


Powered by Zoundry Raven

Thursday, January 29, 2009

Managing stories electronically

I've been involved in this agile project at my client for some time and for the past three months or so I've been working in a group that favors a low fidelity mechanism for managing their stories--Post-It notes on a board. The stories, tasks, and acceptance tests are all written on Post-It notes. We are required to keep the stories and tasks in Team Foundation Server (TFS) also, but the group manages the iteration's work from the Post-It notes. The TFS eScrum template is not a particular good system for managing stories and tasks, so we tend to stick to the low fidelity method.


I really dislike this behavior. The Post-It notes are difficult to keep stuck to anything for the entire iteration. They drop off the board and mysteriously get lost. The Post-It notes are typically written in many different handwritings. There's no consistency in display of stories and tasks. Some of the Post-It notes are almost unreadable. The format of the Post-It notes is not consistent. It's difficult to write much on a single Post-It note. Reporting, well...


I'm a big believer in managing your stories and tasks electronically. Use the Post-It notes during iteration planning to facilitate teamwork and collaboration, but don't leave the stories, acceptance tests and tasks in that form for any amount of time. Get them into a tracking system that allows you to easily manage the stories and tasks for the iteration. I'm a big believer of a dashboard view that gives you a high level overview of all the iterations stories and their progress in a single view.


Powered by Zoundry Raven

Sunday, January 25, 2009

Follow up on keeping fake objects simple

The Google Testing Blog has an a very timely article about keeping your fake object implemenations simple. I previously blogged about this issue. It's nice to see others have seen similar issues with the fake object test double.


Powered by Zoundry Raven

Saturday, January 24, 2009

Programming vibration on the iPhone

Erica Sadun has a timely blog posting about how to get your iPhone to vibrate from within your iPhone applications. I've been working on an educational app for the iPhone and wanted to use vibration for user feedback. And now I know how to.

Measuring value during an iteration

I'm currently working on a large agile project where we measure task burn-up. Our user stories are decomposed into individual tasks and the tasks are estimated. When a developer or a development pair completes a task, they mark that task complete in the tracking system. A daily chart is then generated by the tracking system that displays a line graph of units of tasks completed in the current iteration. The cumulative total task units from the estimates is another line on the graph, and it typically stays horizontal across the entire iteration. Up until recently I hadn't given much thought to these generated charts.

Now I'm wondering what value these charts actually provide. If management is interested in seeing that people are busy working and completing tasks, then these charts are spot on. They definitely will show the amount of work completed during the iteration and when it's completed. But really, is that metric all that important? I tend to say no. One issue off the top of my head that I have seen happen in our group is the completion of tasks on stories, but not fully completing the stories. For whatever reason, our user stories are drifting from one iteration to the next, never reaching the point of completion. Therefore, I conclude that we're keeping ourselves busy, but not adding any value to the overall product.

I want to know how much value I have built into the product. To measure that quantitatively, you need to measure user story burn-up. If you measure user story burn-up, you will focus the development team on completing stories. I think the emphasis needs to be on the user story; the task is a planning construct that just helps us decompose the story into units of development that can be worked on concurrently by a number of developer pairs. I don't know if I really care about task estimates anymore either. I'm drifting towards estimating at the user story level only.

Friday, January 23, 2009

Using ArgumentMatcher to capture indirect output arguments

Yesterday, I posted a blog entry about performing assertions directly in your ArgumentMatcher implementations.  I wanted to close the loop on my previous usage of the ArgumentMatcher.  After some discussion with the main committer to mockito, Szczepan Faber, it seems that ArgumentMatcher should only be used to capture the indirect output argument, making it accessible to the test code. Once the test code has the indirect output argument available to it, you can then assert on it to your heart's delight. Szczepan recommended not embedding the assertions directly in the ArgumentMatcher implementation.  More information can be found here.  Seems like a good approach. 

The importance of grooming the story backlog

I'm currently on an agile project in primarily a developer role.  Our iteration planning has been a sore spot with me since I joined the group.  We've made some tweaks and improvements, but our stories and their acceptance tests are poor quality.  We aren't doing much of any pre-planning, harvesting of stories, or grooming of the backlog.  It really hurts when we get to the iteration planning day.  I dread iteration planning. 

I'm a big believer in grooming the backlog while developers are working on the current iteration's stories; streamline your process by getting more things completed concurrently.  The coach and one or more of the testers get together with the customer and determine which features the customer would like to focus on in the next iteration.  If you need technical expertise, add the tech lead to this group.  Use the release backlog to jumpstart this conversation with candidate stories.  Fill out the details of this group of candidate stories for the next iteration.  This meeting between coach, testers, and customer focus on the feature details and the acceptance tests.  When you try to do this during iteration planning, there tends to be too many people and the conversation becomes chaotic.

Try to solidify your stories and acceptance tests well ahead of the iteration planning meeting.  Send out the stories and the accompanying acceptance tests to the rest of group before the iteration planning meeting.  Now the participants of the upcoming iteration planning can prepare off-line before the meeting. 

Thursday, January 22, 2009

Using assertions within your mockito ArgumentMatcher implementations

I've been using mockito in my Java work recently and have really enjoyed its functionality and ease of use.  Lately I've been trying to do a better job of verifying my SUT's indirect outputs, both behavior and state.  Behavior is easy to verify with mocking frameworks and mockito is no different.  State verification of indirect outputs is bit trickier, but still pretty easy to do once you know what matcher combination you need to use.  For mockito, you use the org.mockito.ArgumentMatcher<T> class and its subclasses (all implement the org.hamcrest.Matcher interface).  There is a single abstract method that you should implement, the matches(Object argument) method.  This method returns a boolean result. 

Today, I was having a conversation with a co-worker of mine, Ryan Anderson, about the use of the ArgumentMatcher.  Ryan wondered if one could use JUnit assertions within the matches method implementation and just return true if all of the assertions passed; failed assertions will not reach the return statement.  Indeed, you can use assertions in the ArgumentMatcher implementation.  JUnit assertions actually throw an instance of java.lang.AssertionError, thus your stack trace will show exactly which assertion within the ArgumentMatcher failed.  Much better using the assertions than testing and returning a boolean value.  Might be helpful for your testing efforts.

Wednesday, January 21, 2009

Taking fake objects too far

I recently worked on a Java project where we utilized the Fake Object pattern ad nauseum.  We used this pattern to provide a test double layer of our data access objects, but in doing so, we tried to implement too much of a fake repository for our domain objects.  The fake data access objects became a hindrance to writing unit tests and thus dissuaded people from writing unit tests.  Well, a friend of mine still on the project told me today that they are ripping out all the fake object implementations and putting in mocks and stubs using the excellent mockito library.  They hope to get back to easy test double usage and thus promote the use of unit testing and TDD.  Moral of the story: Your tests can accumulate technical debt.  Constantly ensure that test double usage is healthy in your unit tests.

Monday, January 19, 2009

Interface Builder: Remember to hook up the view to the ViewController's FileOwner view outlet

I don't know if I like or despise Interface Builder.  Most of the time it's an effective tool to building UI for the Mac and the iPhone.  Every so often, I'm completely confounded by it's tediousness.  Case in point: The ViewController's File Owner has an outlet for the view.  If you have one single view in your XIB, you still need to make a connection between the File Owner's view and the View object in the XIB file.  I spent significant time today trying to figure out why a multi-view iPhone example that I was working on kept throwing exceptions after I started adding the subviews to the codebase.  To me, Interface Builder seems a bit opaque; you never really know if everything is wired together properly.  I'm sure experience will help alleviate this type of issue cropping up in the future, but from my very limited exposure to the Xcode/Interface Builder tooling, it seems like the tooling could use a revamp to make things much more user friendly.  I believe the precursor to Eclipse, Visual Age for Java|Smalltalk had a similar UI wiring scheme, but with a much easier view of all the existing wirings.  Something similar would be helpful in Interface Builder.  


UPDATE on February 3, 2009: Bill Dudney has seen this phenomenon in his trainings and blogs about it here, with screenshots.

Wednesday, January 14, 2009

Google's Quick Search Box for the Mac

If you like Quicksilver for the Mac, you may want to look at Quick Search Box for the Mac.  One of the developers of qsb-mac is the Quicksilver creator, Nicholas Jitkoff.  Google is hosting it at googlecode as an open source project.  I like what I see of it already.

Tuesday, January 13, 2009

Beginning iPhone Development book

I finished up reading the book Beginning iPhone Development and working through most of the examples.  Excellent book for developers starting out on the iPhone platform.  The book is laid out with examples through 17 chapters or so.  The examples are all very relevant to functionalities on the iPhone: accelerometer, autorotation, autosizing, multiview applications, persistence, Quartz, OpenGL ES, gestural interfaces, Core Location, and others.  The examples are straightforward to understand and really give you a great taste of what's available with the Apple iPhone SDK.  There is nothing in this book about web applications on the iPhone--go elsewhere if you want to learn about that.  Looking forward to building and distributing some iPhone apps in the near future.

Interesting unit testing thoughts from Michael Feathers

Michael Feathers is well known within the agile community for his efforts and thoughts around testing. He has a very thoughtful post entitled The Flawed Theory Behind Unit Testing. The main takeaway that I glean from the posting was how tests make us slow down and reflect on our code. From the blog entry:

All of these techniques have been shown to increase quality. And, if we look closely we can see why: all of them force us to reflect on our code. That’s the magic, and it’s why unit testing works also. When you write unit tests, TDD-style or after your development, you scrutinize, you think, and often you prevent problems without even encountering a test failure.


I've been thinking more and more about my own testing behaviors these days, especially with my endeavors of teaching TDD and mentoring other developers on unit testing and the use of mock objects.

Thursday, January 08, 2009

.NET Base Class Library types not friendly to mocking with MoQ

I spent some quality time this week driving a design implemented in .NET using unit tests.  It was an enlightening experience and gave me a good glimpse at the quality of the BCL design.  I'm not impressed. We had issues trying to mock System.Net.WebRequest and System.Net.WebResponse and its decendents.  It seems that Microsoft prefers to expose abstract base classes, instead of using interfaces for this.  The aforementioned types are not interface types; they're abstract classes.  We've been using MoQ, a fine mocking framework, at the client I've been working at and I tried to create mock implementations of the System.Net.WebRequest and System.Net.WebResponse types.  No go--these types do not have public constructors.  The non-virtual, non-abstract methods also give MoQ headaches (good write up here about why methods of these abstract class types have to be explicitly decorated with virtual if you want to mock them).  Personally, I'm more fond of exposing interface types, thus alleviating the problem all together.  Very frustrating.  We did continue to unit test and utilized mocks for this, but it forced us to wrap these BCL types with our own types where we could control the virtual decoration.  Yuck!!

Thursday, January 01, 2009

Now deploying my development app to my iPhone 3G device

I went through the steps to get my Standard Developer Program activation hooked up through the Apple iPhone Developer Portal.  I wrote up a wiki page of how I did this.  I was prepared for the worst as I had heard the process was really convoluted and complex.  For me, following their user guide, the process was almost painless and quite simple.  I do recommend following the user's  guide though.