Home avatar

Thoughts and code

The Productive Programmer

Just finished reading “The Productive Programmer” by Neal Ford. Mixed image emotions about the book. On one hand it’s packed with good practices and decent tips to follow, on another hand haven’t I watch the presentation on InfoQ, reading the book might be a bit more pleasant…

One good thought that I liked in the book especially - question the authorities. Exactly as the author of the book ran into the no acceptance of changing long-time structured naming conventions, same happened to myself recently in a team with a couple of “old school agile consultants” (no names :). And the most important lesson, don’t turn into angry (code) monkey and beat other developers for fresh ideas.

Hudson – CI Engine (part 2)

In my previous blog about Hudson I was excited as a user how cool and great this CI engine was. This week I had to quickly setup a project and get it going on our build server. Boy oh boy, that was great task. Easy, clean, and fast. You should definitely check it out.

For those who want to install it, keep in mind the next:

  1. You will have to install Java Runtime
  2. Once you can run the command line version, you can through the browser install the windows service (a much better way of running CI server)
  3. You probably will need a few .NET related plugins to install prior to setting up any projects, such as
    1. MSBuild (if you use it)
    2. NAnt (if this is your build script of choice)
    3. Gallio report builder (if you use MbUnit 3.x)
    4. Green Balls (if you rather see red-green and not red-blue – why blue?!)

The nice part is that the information is all available at the Hudson site, and very easy to find.

Two Good XML Tools

I was working a lot lately with regular expressions and XPath. As usual in scenario like this, you want to have a good tool to assist your tests writing. For regular expressions I used Rad Software Regular Expression Designer that does a good job of matching and replacements. For XPath, I used SketchPath 2.0 which is really friendly and great to use. Both are free for usage.

Feel free to comment on other useful tool you’ve encountered for XML and XPath.

Switching Mocking Framework

Our team is moving away from Rhino.Mocks to Moq.

Rhino.Mocks was the first mocking framework I encountered in my life about a year and a half ago, while taking JP’s Nothing But .NET training course. It was great (the power of mocking), it was weird (record/playback concepts), it was good. But lately, the pain of legacy support and backwards compatibility has made the tool too fat and complex.

If you are familiar with AAA syntax, Moq will feel no big change. Just less fat and more to the business. It’s simple and expresses well the concepts you need for mocking. There’s no backwards compatibility, as it entirely based on C# 3.0 and AAA syntax.

Testing - Just When I Thought I Had It All

Testing is normally divided into unit testing and integration testing. Is it?

The current project I am involved in has gone through some very interesting turns. I was privileged to get into some really interesting debates and get exposed to different approaches that might not always can agree with, but definitely contribute to my better understanding of testing in general. Testing, one word so many meanings…

Do you write tests to guard against unexpected changes in your code? Or do you write the tests to validate assumptions? Maybe you do it to drive out the design and implementation? Or you testing how components work together when they actually put together? If you do one of those, you do testing. Then the question comes - is that enough or  should all of the mentioned be done plus more? Well, this is the reason I decided to blog about the subject.

DbLinq

Today I had to look into persisting some of the data from the new system we are building into existing legacy system for backwards compatibility until the old system can retired (data that is required for the old applications/services that is a product of the new system). The database was MySql. The new system is leveraging FluentNHibernate to do the Domain objects persistence. The legacy system has no relational tables, and it’s just a matter of inserting information into the legacy DB. Since FluentNHibernate was not a good fit for the job, I looked into leveraging raw ADO.NET to do the simple job. And I couldn’t. Raw ADO.NET feels ugly after you get used to an ORM. So I thought about alternative, Linq to SQL. Well, Linq to MySql to be precise. I found DbLinq project which I highly recommend if you want Linq to any non MS SQL database (Oracle, MySql, SqlLite, Ingres, etc.)

Going Towards the End

Our current project is moving towards the final phase. This is going to be the 1st release, and I am quiet excited to see how team work is transforming a bunch of stickies and tests into a real system. This is how our whiteboard looks like (done-done part was not captured, but it’s definitely there and has a significant amount) and tests result trend based on builds Hudson CI is running.

Hudson – CI Engine

I am amazed. Not everyday you can find a great application that just works the way you expect it to work. Hudson is our teams’ CI engine of choice. We used CruiseControl, but it is no where close to what Hudson is capable.

Features I loved most of all:

  • Ajax updates for the web interface
  • Real time report of the projects statuses
  • Console of the build (see the script execution)
  • Integration with AD
  • Integration with Subversion (providing comments on commits)
  • Recent changes
  • Workspace (ZIPed trunk)
  • Real-time Build Executor Status
  • and much more…

We are less then a month on CI server, and Hudson is only a few days as introduced, but from now on there will be no project outside of it. So what’s the status, doc? Cloudy, but we are getting warmer and sun will eventually shine (a nice visual gimmick for Hudson to report the status :)

Nothing But .NET is in Calgary Again!

I know there are lots of good developers in Calgary. I know for sure lots of them feel sort of puzzled if they do things the right way. If you have a chance, get your answers at the course JP is giving in Calgary again – absolutely worth it. As someone who took the course a year ago, I can testify you will not be disappointed, unless code is not what you love to do. Yes, love to do, and not like, since to get through the course you gotta be loving programming. What will this course give you? I think some of the most valuable things a developer can ask for: