This blog contains reflections and thoughts on my work as a software engineer

fredag den 12. september 2008

Process change only works top-down

Recently I have researched a bit on how to make a SOA project succeed - and much importantly: Why SOA projects fail. Given that the best way to make speed is to avoid making errors uncovered by others a Google search for "SOA Antipattern" reveals all kinds of goodies.

There are a lot of repeated do's and don'ts around many of which are quite obvious. For one: "Don't dive into a SOA project with a Big Bang refactoring of all your infrastructure". Agile chapter 1, page 1 (perhaps page 2): Don't do big refactorings at all. There is no such thing as a big refactoring if you have committed to the agile way of doing software development.

But: There is one argument which isn't quite so obvious and can be counter-argued with theoretically. The argument goes that the owner of a SOA business case should be a business executive in the area that the SOA service should be serving. Why is that? Well: For one: It commits the business to take responsibility for the IT they want, a.k.a: Having the business own it's own IT business cases stops having IT delivering good, stable and reliable products which doesn't solve any problems.

Having experienced a bit of problems lately in our Scrum process I came to think that there are a few similarities between the two. You need the business present on a daily basis taking responsibility of the development of the product you are about to deliver. The key elements which are critical for the Product Owners to be mentally involved in a Scrum team are (in my opinion):

  • Force the Product Owner to come to your Daily Scrum. No excuses - they must show up and listen to what you have to say. They might not understand everything but the team needs the Product Owner present to ask questions and for guidance.
  • Speak their language. Never say "This feature sucks because it requires me to make serious changes to moduly Y and X" but "That sounds like a neat feature- and it will unfortunately take X days and hours to implement". They don't understand technical complexity but the PO has a deep respect for "Return on Investment" which means the time spent on a single feature by the development team.
  • Make them test every time you commit something to the mainline /staging environment. No excuses. If the PO haven't tested an implementation the PO can't say it is Done and your team haven't improven the velocity of the sprint.

By following these steps you know that the Product Owner knows what's going on and can be held responsible for - well - IT projects that doesn't solve any problems in the business domain ;o)

The best way to ensure that the PO does in fact adopt to these few guidelines is to not let the IT departement drive the Scrum process. It can't be stressed enough. Any kind of process change and mindset change must ideally come from the Dark Knight of Evil, a.k.a the president of your organization. If i.e. SCRUM is only implemented within the IT departement you never get the Product Owners to adopt your philosophy because the live in a different world with a different mindset than yours. That mindset might not leave room for i.e. half an hour of testing when the Scrum Team says something needs to be tested. It is probably not because the Product Owner doesn't know or can't see the value of testing - but if the Product Owner is being overruled and assigned other priorities by his/her boss the SCRUM process fails because the team is unable to show progress to the rest of the business.

It's all a matter of prioritizing time - the SCRUM team and the Product owner needs to have the same priorities and only the Dark Knight of Evil mentioned above can reassure that the priorities are the same for various Product Owners and the various development teams within an organization. That's why the biggest antipattern in my opinion when implementing SCRUM in an organization is to let a single departement drive the mindset change through. It'll never be a good experience for all parts and inevitably the SCRUM process will be questioned again and again.

onsdag den 27. august 2008

IE8 InPrivacy - good or bad?

Take a look at this entry on the IE8 blog: Microsoft's latest weapon in the ongoing browser war is a feature called InPrivacy which basicly protects a user on the Internet from having i.e. cookies persisted on the user's harddrive from websites he or she visites. Cookies can be impersonated - that is, they are no longer stored on your harddrive but remains in session scope so when you close your browser or goes to another webpage the provider of webpage X doesn't have a clue about you whenever you re-visit the webpage...

This is good - or is it? Everybody (or at least everybody I know) hate banners for one. They are plain out annoying. I can't think of one single time where I clicked a banner during the last 6 months on purpose because I was intrigued to get to know more. There are several ways of removing ads while you are surfing without making your browsing experience very unpleasant because this is what will happen if you disable cookies in your browser. Most sites simply won't allow you to log in or even surf the website if you have disabled cookie persistence - and user's seem to comply with this since cookies are so widely used to store information about a user visiting a website.

So - imagine a world where cookies are enabled but only per session - nothing is saved. What will happen? A few things is bound to happen:

  • Everybody sees the same adverts because everybody comes without the vital information needed to track your recent visits down.
  • Visitor statistics on a website will be less trustworthy
  • Personalized content is not possible before the user logs in (which requires the user to create an account etc. etc)
This might not sound so harmful from a developer's point of view but to the Marketing and Sales Departement this is bad news. How to increase income if you don't know anything about your users? How to predict trends and plan for market movements if you are rendered blind by your users because they use a browser which only impersonates cookies but does not save them?

Cookies are not the only way of tracking users - I wonder if this guy will pull if off - but the cookie protocol is so simple that everything but cookies as a usertracking device is a more tedious task to use than simply using the HTTP cookie. However the trend against Internet advertisement begun several years ago with the first popup-killers so the InPrivacy feature could be somewhat expected. Microsoft would eventually enhance the popupkiller feature in IE6 which was the first mainstream, non-third party attempt to enhance the user experience of browsing the web and as they say: The future is what's happening while you are thinking ahead.

What do you think of Microsoft's InPrivacy feature - and what will the consequences be for people using the Internet in the years to come?

torsdag den 21. august 2008

SQL Profiler tip

Ages ago I discovered a nice little feature in SQL Profiler to enable you to only see the queries which comes from your machine. Very useful if you are not the only one using a database and want to track down which queries you are responsible for initiating from your local machine. I assume that you have basic knowlegde of SQL Profiler and trace templates - otherwise you should read more about this fantastic profiling tool before you proceed.

Here goes:

  1. Start up SQL Profiler
  2. Choose File --> New trace and attach to your database
  3. Click on Show All Columns - and whoops: Up comes the column "Hostname". Choose this column for every event you want to appear in your trace.
  4. Click On "Column Filters"
  5. Find the "Hostname" column and enter your computer's hostname in the "like" field
  6. Save your trace as a trace template - name it i.e. "MyComputer"
Now - this is the sweet thing - you can fire up SQL Profiler and trace every query which comes from your machine. All you have to do is to choose the trace template "MyComputer" and start tracing calls which only you have started.

I find it extremely powerfull because it enables you to debug single lines of code in Visual Studio and monitor exactly what SQL is hidden behind various peeks and pokes to your domain model. I use it about every time I use SQL Profiler - I couldn't live without my personal trace template.

Nothing magic about it - just one of these mighty fine things to have in your debugging toolbox I guess ;o)

Regards Kristian

tirsdag den 19. august 2008

Definition of quality - part #2

Followup to an earlier post about how to define quality - I actually heard another definition a few days ago which claimed that "Quality is when customer expectations are satisified".

I dare you: Can you argue against that definition and point out the weaknesses in the above statement?

fredag den 25. juli 2008

Javascript != Internet Explorer

I had this funny experience today with this little piece of Javascript:

function Redir(sAcceptUrl, orderId)
{
document.location.href = sAcceptUrl + "?orderid=" + orderId;
return false;
}

The function was called by a button's onClick-event like this:

input id="theBigRedButtonGoesWild" onclick="Redir()" type="button

This worked fine in IE but not in Firefox.... Firefox just posted to the same page and didn't care very much about the document.location.href change - What the hey ???

It turned out that when using this little function in Firefox you have to use the return value of the Redir() function in order for the Firefox event model to NOT perform a postback - like this

input id="theBigRedButtonGoesWild" onclick="return Redir()" type="button">


It has something to do with the fact that a button in Javascript is actually always a submit-button and inherits it's behaviours from a world which posts back if nothing else is being dictated. IE's event model is - well - different ;o

This was just a quick one - I am on vacation for 3 weeks starting in about 5 hours (first thing on my todo-list: Go to the parent's house and mow their lawn because they are on vacation...) so this blog will be on hold until I am back from work

Regards Kristian

lørdag den 19. juli 2008

RSS feed

For Your Information Only: I have burnt my feed on FeedBurner so please change the URL to this feed in your favourite RSS reader to this one:

http://feeds.feedburner.com/JustAnotherSoftwareEngineer

Thanks - and a nice weekend to you too :o)

Regards K.

torsdag den 17. juli 2008

Antipatterns exception testing

During my first encounters with Test Driven Developement (TDD) I adopted the ExpectedException attribute and used it heavily when coding - that is: I focused a lot on testing for every exception written in the code.

I have come to the conclusion during the last few weeks that my testcases didn't provide very much value if you test heavily for exceptions. There are a few bulletpoints to mention here:


  • Tests written for testing errorconditions on general exceptions (ArgumentNullException etc) are not important. You should write exceptions for ArgumentNull etc. etc but I don't test for them anymore. Focus your testing on things you can assert instead - a test which throws an error will fail the test so even if you don't write an explicit test for the error condition your test will still fail you if the error occurs. Never ever aim for 100% code coverage - if you do you are walking a deathmarch.
  • Business value exceptions are on the other side very important to write tests for. If you have custom exceptions classes which you throw when i.e. a business rule fails to validate you should write a test which succeeds only if the error is thrown. This provides business value: You know that your business logic works because you get your expected exception thrown
  • If you throw exceptions in your code WITHOUT explaining what went wrong I will hunt you down and shoot you in the legs. Not very pedagogic indeed but exceptions are only useful with a meaningful description of what went wrong. You are giving the consumer of the exception no data to help figuring out what went wrong.
Which best practices on this issue do you reccommend to others?