Scandinavian Agile 2009

Posted in development with tags , , , , on October 26, 2009 by kto

I participated in the conference a bit over a week ago. It was a nice conference and a lot has been written about it by the people participating and presenting there. So I won’t add any more to that except few short notices..

First of all, the conference was well worth the price – it was shamelessly cheap. It was a good opportunity to meet people who I have a lot common with. Best parts were of course finding someone had solved some problems we’re having and of course arguing about anything… I think there wasn’t enough arguing going on so that’s something the organizers need to pay attention to next year.

The whole second day was an Open Space session. Good idea, but didn’t work that well in the practice. Maybe it’s because so many participants were Finnish? We ended having too little sessions with too many participants on each with too few arguing and very little discussion. I found more interesting debates outside the Open Space area where coffee was served.

Props to organizers for having coffee available at all times.

I will be there next year as well. I hope I could come up with something worth sharing so I could present there as well.

Deploying Rails app on Glassfish – standalone or shared WAR?

Posted in development with tags , , , , , on September 27, 2009 by kto

We have been working with Glassfish v2 now for a couple of years. We’re developing mostly using Java, but last year we wanted to try implementing one part of our enterprise application with JRuby and Rails. The experiment was good and we decided to continue using Rails on Glassfish.

Our setup was a standalone WAR which included everything needed packaged inside. I wasn’t personally involved with this application from the beginning and when I started making changes in it I thought that a standalone WAR is the only option. After getting more familiar with Glassfish, I tried the Update Center application and noticed that it’s possible to install JRuby to Glassfish as a shared component. I started wondering what would be the added benefit of installing JRuby on the application server instead of bundling that in the WAR – specially as at the moment we only have one Rails application.. Nobody from our team could answer the question and it wasn’t considered important enough to start investigating it any further.

It was only until two weeks ago when I started wondering about this issue again. It really bothered me since the only thing I could think of as an added benefit of installing JRuby as shared component on the container was that the Rails application WARs become a lot smaller. This was also what Arun Gupta hinted to me in Twitter – see his blog entry for more details…

Not enought I thought… Also what’s the point – imagine you have two Glassfish Clusters in production, both having e.g. three nodes. Using shared JRuby would mean having to maintain versions of JRuby and all the related Gems on six servers in production. And each separately. Using standalone WAR, it’s maximum two deployments to upgrade JRuby on all six nodes.

Finally last week I got my answer – and of course it was obvious, one of those when you slap your forehead! Why didn’t I figure that out myself?! One of the reasons I participated in Sun’s webinar about deploying Rails apps on Glassfish was the opportunity to ask this one question. The answer I got was:

A: When you go in to production , you freeze your gems with app.

And of course! I’m going to set up my own development environment so that Rails app WARs can be made as small as possible, there are also other benefits (like simpler configuring of JRuby options). WARs ending up in the production environment will still be made using the old style standalone configuration.

On the other hand… I’m a bit tempted to install Glassfish v3 on my development box just to see the differences in compared to GF v2.1 which we now have in use – it would also support directory based deployment of Rails apps.

Or maybe I could get directory based Rails deployment work with GF v2.1 as well – similarly as Java based web application deployment using exploded WARs…

Webinar Experience

Posted in development with tags , , , , , on September 25, 2009 by kto

A couple of days ago I participated in a “Develop, Deploy, and Scale your Rails app on GlassFish” webinar. I haven’t participated any webinars earlier so I thought I’d share some experiences about it.

Registration

Registration for the webinar was easy. As I’m a Sun Developer Network (SDN) member I get invitations to webinars and other events once and a while in my inbox. This one sounded interesting enough and I happened to be free at 8pm on Wednesday evening so I clicked the registration link in the e-mail. I had to fill in my e-mail address on a web page and click a button. I then got an e-mail with a link where I could join the event when it was about to start. I got two more remainders about the event later.

Suggestion #1: Have some European-friendly webinars as well. I wouldn’t mind spending an hour during my working day following a webinar. 1pm Pacific time is good – but only for those living on that time-zone…

Joining the event

I have a tendency to postpone things to the last possible moment. So on Wednesday evening at 7:50pm I went in my sons room and started my laptop in order to join the event.. Of course my computer refused to co-operate (it’s running Windows…) as fast as I would have wanted so it was few minutes to eight when I finally managed to get in the webinar startup web page. And I was then told to install some special software to be able to participate. Damn… Quick download, spawning a new command prompt with local admin rights and installing the software. Luckily (and surprisingly) no reboot was needed. At 8pm sharp I was ready to join the event.

Suggestion #2: Include a list of required software in the registration e-mail. There is a link to a page where you can “check that you have the required software installed”, but it only addresses media players but not the actual webinar presentation software.

Technical Quality

I had no problems in hearing the sound or seeing the presentation. Everything just worked smoothly and there were no anomalies. It seems the things didn’t go as smoothly for everyone as the Q&A box was filled with questions related to audio or presentation quality. There were actually so many of those that it started to be annoying since all the “real” questions and answers were lost among the rubbish.. Also lot of the questions were related in where to get a replay of the event – even though it was mentioned already in the first email that replay information will be e-mailed to all registrants after the event has taken place…

Here are few good (bad) examples:

Q: hi guys – have we started? Is there audio?
Q: Is the audia functioning now
Q: the voice is not loud
Q: how can I join conference call?
Q: isnt there supposed to be a # at the end on the passcode?
Q: How can I get back to the screen, my firefox just crashed :(
Q: how can i go back to the shared desktop?
Q: Do you have the recorded version of this?  audio is not working at all
Q: i cant understand any thing, the voice is not clear
Q: Please send me a link where I can retrieve the replay of this audio and presentation coz the buffering is really disturbed out here..
Q: can i record this lesson in my computer?
Q: is the presenter showing us how to do something?  all i see is Demo Gem-based deployment
Q: can you please email me the presentaion slides?
Q: can you send me slides
Q: hey i missed the earlier part of this presentation..!
Q: can i get the replay after the webinar?
Q: can u give me a hint where it would be posted?
Q: do we go to the sun website to download this session or it will be sended for each attendees
Q: the prsentation is stopped completetly. It is very slow, this is the only one i attended in such quiality
Q: Can we access this presentation online later ?
Q: Can you please email me the presentation file?

Suggestion #3: Have a separate Q&A panel for the questions regarding technical problems related to the presentation (and not to the content).

Contents

The technical content of the presentation was good in my opinion. I had just read this Sun’s whitepaper titled Getting Started With JRuby on Rails for Sun GlassFish Enterprise Server v3 Prelude which included some same information that was given during the presentation.I think the webinar was a good continuation for that white paper. So I recommend reading that paper first and then seeing the webinar replay.

I think the possibility to ask questions from the panelists who were all professionals was one of the best things in the webinar. Of course, since anyone could attend the webinar there were lot of err.. not that good questions asked.. Some people were confused as the presenter run the demos on his Mac. Here are few chosen pearls from the questions asked:

Q: Is Rails an abbreviation?
Q: y glass fish used only in java
Q: what is mean by rails
Q: what is jruby?
Q: is this presentation only for mac users? I am a bit shocked with this OSX desktop. I was hoping seeing some Opensolaris etc.
Q: this update is shown how it is updated on mac OSX?
Q: JAVA AND JAVAC NO WHERE IN PICTURE

Suggestion #4: Have a link to a page with answers to frequently asked questions (like above) and possibility to answer someone privately to no to clobber the Q&A panel for everyone with the not relevant questions.

There were a lot of good questions asked as well and I have to give props to the panelists who patiently answered all of the questions. You can take a look at all the questions and answers from the session in Arun Gupta’s blog (he was the presenter of the event).

Summary

In my opinion the one hour webinar is a good opportunity to learn about new things or deepen knowledge of something. The possibility to ask questions from professional panelists real-time is really good! I could join an event with only the panelists and no presentation if such would be arranged :)

I’ll definitely join another webinar should there be something which I’m interested in. Just would prefer better timing for those…

Q: is this presentation only for mac users? I am a bit shocked with this OSX desktop. I was hoping seeing some Opensolaris etc.

Slack is Good

Posted in development with tags , , , , on September 20, 2009 by kto

Our latest sprint ended few days ago. This was in several ways a different iteration in compared to the many earlier ones. We have two testers in our team and other one of them was having a well deserved one week vacation in the beginning of the sprint. So he was away first half of the sprint. Few days before the tester was supposed to come back from his vacation, our other tester got ill and was forced to stay home for the whole remaining sprint (we’re running two week iterations).

Left with three developers and a scrum master we first thought that the sprint will be doomed. Luckily it all turned differently. Our sprint goals were related in proving that certain architectural choices we have made would be scalable enough. So the tasks on our sprint backlog were pretty much setting up testing environemnts and doing performance and reliability testing. Idea was to set up few separate similar performance testing environments and spend couple of days running tests to find out the worst bottle necks which we could then fix to get scalability to the required level.

We wanted to first do the testing before doing anything with the code to stay focused. This meant that in the beginning of the sprint there were no developer tasks for us developers. So we had to step out of our nice boxes and do something different instead.  It wasn’t easy and it was also kinda scary, like walking on a thin ice… Well maybe not that scary but that sounded nice. Instead of coding we cloned VMWare images on ESX serves, updated backend server installation scripts and planned performance tests while documenting everything to the Confluence as we went ahead.

This all was really refreshing. During the sprint planning we had over-estimated all tasks which involved testers – since we knew half of our testers would be absent during the sprint. What we didn’t know was that developers could pick up really soon on managing and developing test environments and other tasks traditionally done by the QEs… So even if other tester was having relaxing time with his wife and friends and other one was having not that relaxing time with his flu we managed to meet the sprint goals earlier than expected.

Sure we were lucky as well, since we managed to prove that the performance and scalability requirements were met – and we didn’t need to do any code changes. The last two days of the sprint we had to actually find something else to do. We had our master tester back from vacation running the tests and preparing demo and there were no tasks for us on the sprint backlog. We took a look at the next story on the product backlog but decided to not to start it yet since we wouldn’t have been able to complete a single task from that story (which wasn’t analyzed well enought yet).

So we arrived late to the office, started the days slowly drinking coffee and bullshitting with each others while sitting on sofas… Long lunch break and heading home early. Easy money!

Seriously, we did some things which we had postponed for months: started setting up our continuous integration system on Hudson, fixed some small memory leaks on our client software, analyzed unit testing coverage reports (Clover, I love you), read some latest technology related blogs and articles etc. And most important of all – we spent a really good 5% workshop with out product owner. Also for the first time in months there was really time to think about the whole architecture of the system we’re building on a large scale and plan the near future architectural changes which affect several components.

I’d say that all in all this was one of the best sprints ever. We didn’t burn many product backlog stories but in my opinion we’re now in a state where we will be able to burn the forthcoming stories a lot faster and we’re able to estimate the product backlog stories really effectively.

We also managed to improve the time what it takes to set up one performance testing system from two days to few hours.

Personal Scrum my ass

Posted in balance with tags , , , on July 13, 2009 by kto

To put long story short: tried it, didn’t work.

Doesn’t make sense to try to apply something that artificial to personal life. In work that might well work (say if you worked in a one-man team) – seems some are successfully doing that (like this guy).

Anyway, for me trying to apply that for my endless list of things to do at home didn’t really help in anything. It didn’t make things worse but is didn’t improve them either…

There was one comment from my wife (how I secretly nominated as the PO even though she didn’t know that – or that I was trying to apply some Methodology there) which was a real eye-opener. When presenting her the big list of things which need to be done (the Product Backlog) and asking her to prioritize it she said “Are you really so stupid that you cannot decide which of those should be done first?” Ouch.  She’s goddamn absolutely right about that – goodbye personal scrum!

In the beginning of my vacation I read Henrik Kniberg’s nice article about how to make best of both Kanban and Scrum. And yeah – I had a brilliant idea!!! How about Personal Kanban!?!

And how about not trying to apply software development methodologies at home for home repairment tasks?!!

Because for a one-man team the freakin’ Kanban board will be just one large todo-list.

So after all this fussing and fighting (my friend) the good old Todo-list worked the best. And even that is not needed now on vacation as I don’t need to focus on secondary things (such as work).

Beta1 –> Beta2 How Hard Can That Be?

Posted in development with tags , , , , , , on June 30, 2009 by kto

Turned out it was really hard.

We’re using Windows Installer for installing our workstation software. So far using that has been relatively simple and easy. There’s nice support for creating Windows Installer projects in the Visual Studio 2005 and we can build the installers using Visual Studio command-line tools. So our automated building system also produces Windows Installer packages.

Of course there are some problems not yet solved properly – like when the the files to be included in the installation package are moved, removed or added. All these require manually modifying the installer project. Also we’ve not found a way to make the same project produce installation packages with debug binaries (for testing) and release binaries (for release, duh). That could be done by compiling the binaries twice and generating the installer between compilation rounds but so far the pain is not hard enough for anyone make it happen. So we maintain two Windows Installer projects – one including debug binaries and other one including the release binaries.

There have been some plans to explore WiX for easing the automated creation of the installer packages but priorities for this are too low for it to happen.

Also it’s a pity that Visual Studio only supports a subset of Windows Installer features, basic things like service installation, grouping files in features and components and custom installation dialogs are missing.

So we knew there are limitations and inconveniences but as said there wasn’t enough pain for anything to change.

This Monday we started preparing for upgrading our existing beta users to the latest and greatest beta-version of our software. It was supposed to be an easy task as documented so clearly in MSDN. Just increment the product version property and do a reinstallation re-caching the local MSI package.

This Monday the problems started. We had no issues upgrading from previous build to next one. Or from beta1 build to the build following that. But for some odd reason all upgrades from beta1 to the latest builds were failing silently. Everything seemed to go well there were no errors reported doing the upgrade – just no files were updated on the target systems! The local MSI package was cached but that was good for nothing.

It took one and a half days until someone started to suspect that renaming one file in the package might cause the problems. This was found by trial and error: upgrade beta1 with later builds until found the one which is not working. Due to the previously mentioned limitations in MSI package authoring we can’t just double-click an MSI package to try the installation (and it wouldn’t work fora minor upgrade anyway), we need to pass a special, dynamically crafted set of command-line parameters to MsiExec. There’s also some other kind of magic required to stop some components not working upgrade-friendly in the beta1 installations. So testing one upgrade installation might take considerable amount of time.

After the root cause for the problem was found it wasn’t hard to find some answers. As usual, our deares friend Google helped us out in this. Thanks for the supplementary documentation provided:

The thing was, Visual Studio puts all files in a single feature (named DefaultFeature) . When we renamed this one file in the installation package, it was basically removed from this feature and a new file was added. Adding files is not bad for upgrades – but removing is. Windows Installer uses black magic, hidden powers and some complex logic to determine when to replace an existing file with one from the upgrade package. And even if it’s being told to reinstall everything (REINSTALL=ALL, repairmode = “force all files to be reinstalled”) it’s still not doing that – since it’s not able to determine the status for this one component which used to be part of this feature. Therefore it skips upgrading anything and still reports no errors (unless MSIENFORCEUPGRADECOMPONENTRULES is set to 1).

To workaround this there are basically three alternatives:

  1. Include the old file in the upgrade package. Simplest way unless the old file causes problems when being installed together with the new files. Luckily this wasn’t the case for us.
  2. Instead of upgrade do remove feature and install. Problem is, since there’’s only one feature removing it is basically uninstallation of the whole software. Nice way of doing and upgrade.
  3. Do major upgrade.

I think we’re going to end up in choosing alternative #1. In the near future we need to seriously re-consider the design decisions we’ve made concerning application deployment, patching, upgrades, uninstallation…

These things are never easy. I personally had high hopes for Windows Installer and still haven’t buried those. These decisions are also often costly yet they might be done hasty.

Personal Scrum

Posted in balance with tags , , on June 22, 2009 by kto

I’ve got too much things to do.

The work I can handle well – it’s easy to set priorities and sometimes there are other people to set them for you. And in case there’s trouble my team is there to help me.

But at home… Although we have a “team” here as well things don’t always work so well. We’ve gathered a lot of “things which should be done” debt during the year we’ve lived in our new apartment. From the top of my head here are some of the tasks waiting to be started (or completed):
paint the bedrooms’ walls, paint the ceilings of toilets and the utility room, redo the laminate floor on one room, replace the plastic carpet with laminate floor on other room, sand and oil the wooden terrace, get some large stones and sink them in the garden, re-arrange the stuff in the warehouse, wash few carpets, redo the stone stairs on the backyard… Oh, and in addition the “normal” stuff like hoovering, washing floors, small repairs, mowing, gardening, washing windows etc… There plenty more where those came from :D

One might think that it would be easy to “just do it” as they say but it’s not always that easy. More than one item on the todo-list have the top-priority, things get added to the list every day and randomly and not all things can be done at all times. Also for most of the items on the list there’s only one resource available for the job – and that’s me (surprise). One problem why things won’t get done is that none of the tasks have a clear deadline set.

Just today I started thinking that this all sounds awfully familiar… It’s like running a software development project and using all the anti-patterns available. We have the Hero Anti-pattern, we have the constantly changing requirements and priorities, we haven’t set any due dates and for some of the items we haven’t defined to desired scope…

So… Today while driving home from work and listening to the audio book my thoughts drifted to the stuff waiting to be done at home and I had an idea. Scrum works so well for the development projects (when used correctly) why wouldn’t it work for my personal projects as well? Of course there won’t be 1-to-1 match and I definitely won’t be having daily scrum meetings with my family (although I’ve heard some people do have kinda like daily scrums like as part of dinner etc.). But it would definitely help to put all the things on a backlog, estimate some sizes for the items and maybe list also required equipment etc. with them. Also should be noted that not all items can be done whenever. With this list done (and prioritized!) I could then select item(s) for the first sprint and get things done.

I think I’ll have to nominate my wife as the product owner.

Why is nothing happening in the C++ world?

Posted in development with tags on June 3, 2009 by kto

About a year ago – after almost a decade of coding in C and C++ – I took a leap on the “other side”. Our team was lacking a server side Java developer so I took a four day crash course on Spring and started writing code in Java.

Nothing has been the same after that.

First of all I recommend the course for everybody in need for that kind of training. It was arranged by SpringSource and went by the name Core Spring. The description of the course says:

In this four-day bootcamp you learn how to use the Spring Framework to create well-designed, testable business applications in an agile manner.

And at least I learned what they promised. The first week after the course I was already producing value.

I was really really amazed about the productivity increase in compared to coding in C++ using Microsoft’s Visual Studio 2005 which I had done earlier. The amount of available libraries and the ease of use of those (with e.g. Apache Maven) was something I had never seen in the C++ world. Sure there are a lot of libraries available for C++ as well, but they’re mostly commercial and/or closed source and taking them in use is really not that straightforward.

And the development environments. Wow. During the Spring course we did the exercises using Eclipse which is Open Source btw.  And I had wasted so many years fighting with Visual Studio, doing refactoring manually or by using search and replace. I had never done any unit testing or real TDD, I had been writing all my constructors and getters/setters by hand. Now I was using this free tool which did all this manual work automatically and intelligently! No more using code snippets (in combination with search&replace) for writing the required boilerplate code thanks to intelligent editor and Spring. Later on I changed Eclipse to a commercial tool called IntelliJ IDEA – that’s probably the best programming editor I’ve ever used.

And don’t get me even started with Hibernate

Anyway, last week I had to return back to the native world of Visual Studio 2005 and C++. This time, however, I could use a real application framework: Qt. And it’s actually even more than that Qt is a cross-platform application and UI framework. It is the first C++ application framework which was easy to take in use. Get a license, download, install, use. At least the three first parts were easy, it took me a while to get used in the concepts used in Qt. All these signals and slots look a bit confusing in the beginning. Also the (unit) testing framework (QtTest) included in Qt was not the easiest one to learn. Good thing is that the documentation for getting started is really good and easily available. Bad thing about the documentation is that since all classes are ‘Q’something, help index usability suffers a bit. Anyway, I soon found out that Qt is a lot more than a cross-platform UI framework, which was pretty much why we started using it in the first place. It has a lot of stuff included -  all ready to use.

Like in Java world.

Almost.

I think Qt is merely a good start – it’s a big step towards the easy reuse of components in the C++ world. And I think Nokia now owning Qt is a really good thing. Qt is available as commercial edition as well as (L)GPL editions – on multiple platforms. And it is also possible to contribute to developing the frameworks (see http://qt.gitorious.org/). Really good.

If only we got a better programming editors for C++ as well… The best environment (for Windows) seems to be Microsoft Visual Studio 2008 enhanced with Whole Tomato’s Visual Assist X add-in.

Unfortunately the .NET world is still unknown to me… I’ve heard some really good things about that, specially the latest versions of the framework seem to be fairly decent development environment. A colleague of mine once even said that “Windows Vista with the .NET Framework 3.0 is the world’s best development environment.” Ironically, at that time Vista was just about to become more popular so we couldn’t get that as operating system for our work computers. In fact, we still can’t get Vista, we have to use Windows XP (or Linux – which IMHO is a lot better choice) – and 32-bit version only…

The thing which makes me wonder the most is that C++ has been around a looong time – since 80’s. And it’s precessor C a fair amount longer. Java is a young language in compared to the old-timers and yet it’s so much better supported and promoted.

As I will be working quite a lot with Visual Studio (version 2005 at the moment), C++ and Qt in the future as well I’d love if someone proved me wrong in what comes to the available development environments. Pretty please.

Oh, one more thing… Why can’t I do this:

/*1:*/ class ThisSucks {
/*2:*/ public:
/*3:*/     ThisSucks() {};
/*4:*/     ~ThisSucks() {};
/*5:*/     static const int MY_STATIC_CONSTANT_INT = 1;
/*6:*/     static const wstring MY_STATIC_CONSTANT_STRING = L"Not allowed";
/*7:*/     static const wstring MY_OTHER_STATIC_CONSTANT_STRING;
/*8:*/ };
/*9:*/ const wstring ThisSucks::MY_OTHER_STATIC_CONSTANT_STRING = L"This is allowed";

The above example doesn’t compile – line 6 gives error C2864 (note how bad the documentation of error C2864 is). On the other hand, there’s nothing wrong with lines 5, 7 or 9. I just don’t get it.

Burning the Midnight Oil

Posted in balance on May 22, 2009 by kto

Get it while it’s hot – the midnight oil I mean… I have such a bad habit of staying up really too late at nights. I do this several times a week for no particular reason. Usually I tell myself that I must complete these work related tasks by tomorrow or else… But of course that’s not really true. The real reason why I love to stay up late is to have some quality time of my own. I know that I will be completely wasted next morning but I really don’t care. It doesn’t matter now.

I’m free to do whatever I want, nobody needs me now. I can do my own things with my computer and in the Internet without feeling guilty about it. Even if a lot of my time in the Internet goes in reading work related blogs and articles I still don’t have time to do that during the work day. And not to talk about being able to write about some professional experiences – will not happen during office hours. And will not happen outside office hours either – except really late at night.

I do also other things in the Net than keep my professional knowledge up to date. I follow a bunch of non-work related blogs. I write some of my own as well (in addition to this), I do visit Facebook occasionally but I have to admit that recently (say, past few months) there hasn’t been really anything for me. I try to update my Twitter status at least once a day. Not that easy always… Oh, and of course I look for nice new gadgets to want – or get… Lately I wanted to have an iPhone.There’s a nice story about how I didn’t get it as a work benefit phone so I ended up purchasing one of my own. I’ll share that story some day in the future…

Now I think I’ll go get some sleep. Fortunately tomorrow is Saturday. Unfortunately two-year old child doesn’t really care what day it is, he’ll wake up when it’s time to wake up. Usually that’s too early – and usually he takes care that he doesn’t get up alone.