Monthly Archives: December 2007

Farewell 2007 – a brief look back

With fond memories I bid adieu to 2007…

It’s been an exciting year in lots of ways (in chronological order from the beginning of the year, definitely not in order of importance):

That wraps it up. I look forward to 2008!

Happy New Year!

Microsoft's ASP.NET MVC framework will be great for Automated UI testing

I’ve written automated UI tests using Selenuim running against a large ASP.NET Web 2.0 ERP application with great success. However, IMO the single biggest productivity killer for writing such tests is ASP.NET WebForms ID name mangling where ID’s are changed from something like “lblSysMText” at design time to “ctl00_cphContents_dlMessages_ctl01_lblSysMText” at runtime. Fortunately, Selenuim supports the use of XPATH expressions so searching for the above tag can be done using the following:

//span[contains(@id, "lblSysMText")]

Name mangling is a huge problem and thwarts all sorts of automated test tools whether you’re using AutomatedQA‘s TestComplete or a something like Selenuim. Whenever you have a situation where a simple containership change like moving a control into a DIV can break an automated test you’ve got a problem. These sorts of changes occur all the time on WebForms which are actively being developed meaning unless your tests are written using a partial match logic, like what I’ve illustrated above, you’ll be faced with lots of bogus failures which not only kill productivity but undermine your test automation efforts as the tests will be viewed as fragile and a waste of time.

MVC to the Rescue

Scott Guthrie wrote:

This model view controller (MVC) framework for ASP.NET provides a structured model that enables a clear separation of concerns within web applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and more control over the HTML that is emitted from them.

With the MVC framework name mangling will be a thing of the past. I believe not only will the MVC framework make unit testing easier it will be a major win for automated UI testing for ASP.NET apps. You’ll no longer have to jump through hoops to figure out the ID of a given tag on the page.

Last but not least, with MVC style development you’ll finally be able to use ID’s like #lblSysMText in your CSS again.

Firefox 3 beta 2 no doubt it's fast

If my first 20 minutes of Firefox 3 beta 2 usage are any indication it’s much faster than That said, I won’t be switching until a number of my Firefox addins are supported. Anyway, one thing is for sure and that’s that my blog loads significantly faster.

If you haven’t had a peek it might be work a look. It doesn’t appear to mess with your existing 2.0 install so it (seems) safe though I haven’t tried uninstalling yet.

Btw, Merry Christmas!

Microsoft's MVC framework means you'll need to rethink your WebForm world

With the advent of Microsoft’s new MVC framework for ASP.NET I think there will be a fairly significant impact on developers who have come to rely heavily on WebForms and related controls. I believe the new framework will require a significant “rethink” of how applications and controls are developed. If you watch Scott Hanselman’s video you’ll see he uses Rob Conery’s Mvc.ToolKit to flesh out the UI and notice that it doesn’t use the designer nor web controls at all.

The MVC framework is clearly going to change how the VS.NET web form designer will be used and certainly makes it less important. It will be interesting to follow the evolution of the framework and to see how MS updates the designer and code editor to fit this new (as in new to MS) model. It will also be interesting to see how 3rd party control companies like Telerik and Developer Express respond.

While at CodeGear I had frequent discussions with Jim Tierney (who I co-developed Delphi’s ASP.NET designer with) about moving Delphi’s designer away from being a WebForm centric because of the development costs involved and instead focus more on the code editing experience. I think the MVC style of development does just that and I expect Microsoft to come up with a number of improvements to the framework and tooling to better support it. I’ll be curious to watch what this means for Delphi’s ASP.NET support.

One thing I think is particularly interesting is with WebForms out of the way ASP.NET developers will be in a better position to leverage non-Microsoft AJAX frameworks such as Dojo, Prototype etc. etc.

Kudos to Microsoft for following through on this much needed alternative to WebForms!

Configuring CruiseControl.NET to publish exceptions outside of build tasks

The other day I blogged about plug-ins I’ve been writing for CruiseControl.NET for a custom process that I’m working on. I’ve written a custom <sourcecontrol> plug-in that monitors a directory on an FTP server for new files. If files are present they’re downloaded and a build is triggered. The <sourcecontrol> tag of my ccnet.config file section looks like this:

<sourcecontrol type="ftp"> <remoteHost>localhost</remoteHost> <userName>User</userName> <password>pwd</password> <localPath>c:\temp\</localPath> <remoteDir>out</remoteDir> <timeOut>2</timeOut> <fileMask>*.*</fileMask> </sourcecontrol>

A problem I was running into was that exceptions, like failed FTP connections, within my sourcecontrol plug-in weren’t being published using my email publisher as configured in ccnet.config. Prior to v1.1 this used to work using if you had following tag in your ccnet.config file:


With v1.1 came support for log4net replacing the functionality of this tag which is mentioned here but without further details as to the alternative. To publish these exceptions you have to configure a log4net SmtpAppender to sent email which can be done from app.config as follows:

<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender"> <to value="" /> <from value="" /> <subject value="test logging message" /> <smtpHost value="smtpserver" /> <bufferSize value="512" /> <lossy value="true" /> <evaluator type="log4net.Core.LevelEvaluator"> <threshold value="WARN"/> </evaluator> <layout type="log4net.Layout.PatternLayout"> <conversionPattern
value="%newline%date [%thread] %-5level %logger [%property{NDC}] -
/> </layout> </appender>

Btw, don’t forget to configure this appender in the <root> node of the <log4net> section as well. It’s a bit of a bummer that you have to have two Smtp setups to handle these kinds of exceptions but at least you have the capability to get the information published.

[Update: Dec 19, 2007] To clarify the exception I’m referring to above is occurs in my implementation of ISourceControl.GetModifications.

Vista hard reset this time takes my Explorer and Firefox settings with it

It’s happened again. Yet another hard reset of Vista and I’ve lost data. This never happened to me in Windows XP. After every running applications stopped responding and Explorer froze I hard reset the machine after waiting 5+ minutes for it to respond. I’ve since lost all of my Firefox browser settings, layout, history, proxy etc. as well as the icon layout on my Windows desktop, my taskbar positioning and who knows what else.

A number of my friends have given up on Vista and a few people here at Falafel have ongoing Vista issues. I’ve got it dialed way back to conserve on battery and memory on my MacBook Pro but I often wonder how much better Windows XP would work?

Google's Picasa vs. Nikon Capture's RAW file JPEG export

I’ve been playing around with $g(Nikon Capture) tweaking some of the photos I took in the desert and noticed a substantial difference in the quality of exported JPG images as compared to Google’s $g(Picasa). Using the default settings you can see that the Picasa version is very washed out and dull whereas the Capture version is much brighter with more detail. (see update below where I screwed up)

Picasa JPG export (Nikon RAW source file) Nikon Capture JPG export (RAW source file)
Exported using Google’s Picasa Exported using Nikon Capture

Last year I used several exported photos from Picasa of the kids to make up our holiday greeting card and we weren’t very happy with the final results as they were dull just didn’t look good at all. This year I used Capture and the results were much better. Lesson learned.

[UPDATE: Dec 11, 2007] I screwed up. I guess that’s what you get when you post at 12:30am. The original Nikon image I posted had Auto Contrast turned on. I’ve since updated the image which is now a straight export of the Nikon NEF file from Capture with the only tweak being a resize. Thanks to people’s comments I went back and double checked.

Using CruiseControl.NET to manage EDI Invoice processing

A few months ago I started working in an area I previously knew little about, EDI. EDI stands for Electronic Data Interchange and it defines standards for how businesses communicate with one another electronically. The basic flow of information for what I’m working on looks like this:

The document numbers above correspond to the following:

  • EDI 850 = Purchase Order (PO)
  • EDI 810 = Invoice
  • EDI 997 = Functional Acknowledgement

My client represents the seller’s side of this diagram and I’m specifically working on the lower half of this picture, the invoicing portion, as there is existing software which handles PO’s. As indicated in light red there is a trading partner involved which brokers various services between buyers and sellers including providing EDI services. The EDI “documents” are cryptic delimited text files exchanged via numerous transport mechanisms though FTP is used in this case.

The Flow

Basically, there is a system which polls the trading partner, again via FTP, looking for new purchase orders. When one is found the file is downloaded, validated, processed and an acknowledged (EDI 997) is transmitted back to the trading partner. Eventually, the order works it’s way through the system and an invoice is generated at which point, an EDI 810 is generated and transmitted to the trading partner, validated and again acknowledged with an EDI 997, a mirror image of the EDI 850 processing. For brevities sake I’m glossing over parts of this process but you get the gist of what’s going on.

When I first was assigned to start working on EDI invoicing I had a lot of things to learn including EDI, the current processes involved in invoicing and the software that handled purchase orders among others. I quickly learned via not so subtle hints that the existing software which handles PO’s wasn’t considered maintainable and is badly in need of replacement.

Using CruiseControl.NET

Once I got my feet grounded I realized this system closely resembled a continuous integration process and started investigating using CruiseControl.NET as the primary engine to drive invoice handling. I already knew CruiseControl.NET brought a number of interesting features to the table including:

  • Open Source
  • Polling architecture for trigging task execution
  • Open plug-in architecture for things like source control providers and task execution
  • Easily configured using XML (ccnet.config)
  • A customizable web based portal for monitoring projects
  • Email publishing for notifications
  • Logging

Basically, you can envision CruiseControl.NET as the two blue circular arrows in the middle of the above diagram. In a future, post talk more about the specific implementations of ISourceControl and ITask that I’ve written to manage this EDI process.

Randy Spitz

I’ve recently learned that Randy Spitz, an old friend and colleague of my at Borland has passed away. I first met Randy when I joined Borland back in August of 1992. He was a senior member of the Paradox for DOS technical support team and a fantastic mentor and trainer. Randy was always giving of his knowledge and time and had a wonderful calmness about him. I can remember going to him in those early days of my tech support career when a call got hectic and I needed help and him telling me “It’s ok. First, just breath. Now, what’s up?”

I lost touch with Randy after he moved to Northern California though I recall the last time we spoke and him telling me about his home there and describing it as a very serene idyllic setting which he clearly loved. I first heard the news from Lino who was talking to Michael Johnson. Then, later from Randy Sell and Joe Bentley all of whom (with the exception of Lino) worked in Support back then. Here, is a post from the Borland Alumni newsgroup on Yahoo (login required), from Michael Alessio (also from Borland tech support) about Randy.

My thoughts and prayers go out to Randy’s family. There will be a service in L.A., Randy’s hometown on Sunday.