Thursday, 17 January 2008

Ruby on Rails productivity

I was always amazed by the productivity of ruby language. Specially by the development infrastructure of rails. I wanted to check it and specially to measure it.

Therefore, I decided to implement something which was already implemented in other languages before using other infrastructure. This happens in our industry very rarely.

I started to implement the payroll system described in the book Agile Software Development. Originally the payroll system was written in C++ and consist of about 3300 LOC. I implemented the first iteration in ruby writing only 383 LOC including even the test code. I was very surprised. :)

And why did I use rails? Ruby would have been enough.
Simply because it has a very effective development environment.
I used migrate files for creating the relational DB, fixtures for setting up the preconditions for testing, zentest as devil's advocate, and rake for a lot.

What about the benefits:
  • it was fun, easy, and very interactive
  • I've got fast feedback from zentest
  • all the O/R mapping was already done
  • learned a lot along the journey
  • During the development I was happiest ever
Keep smiling :)

Saturday, 12 January 2008

World of Standards

I saw an interesting post in my feed reader today about the fact that the IE8 passes the Acid2 test.
I ran the test myself immediately using my installed browsers. I was surprised that firefox didn't pass the test but I was very happy that Safari and Webkit both passed.
The whole test is just about displaying a simple smily face correctly, isn't it?
Taking a closer look what is inside the test I was surprised how many small details are tested.
They also test some seldom used great css features like the generated content, css tables, child selectorsto name just a few one.
The guys there simply made a brilliant job for the web community.

I am anxious to try the next Acid test. :)

Saturday, 15 December 2007

Webapplication testing like a Lego story

Once I have got the chance to challenge the joys and woes of testing a Webapplication.
I started the whole thing trying out HttpUnit/HtmlUnit and Selenium to experience which one is better for me.
I decided to use Selenium because it uses a real browser for clicking throughout the UI, therefore if the UI works driven by tests it will work in the hands of human users too.

I used the Selenium IDE to create my initial test cases and I saved them as Java test cases. Later as the number of test cases increased the same Selenium IDE generated java code appeared across several test cases. I refactored those repeating code until I had only one helper method for handling the UI elements. From then on writing test cases was like playing Lego in my childhood, except that instead of using the Lego brick I used the methods in my helpers. The number of test cases has grown to a few hundred in one month. Well, playing Lego becomes boring after a certain amount of time.
Fortunately I faced another challenge.

I needed to check if handling the mandatory fields, on forms works or not. Therefore I started to play with my lego set again. After writing the second test case I saw that they are almost identical. Hm... I decided to build a generic machine for testing those forms. In two weeks the machine was up and running and every form was well tested (around 300 cases).
In the meantime the way how the requirements were defined for the mandatory fields had changed from text based sentences into a big matrix. Usually changing letters in matrixes are much more easier than rewriting whole sentences right? So the requirements/matrix changed on every two-three days. All I needed to do was to change one or more letters from "r" to "m" in my test case to support those changes. Yes, my machine was data driven. Not to bad from a Lego system. :)

That was the funny part for a developer like me who was asked to test a web ui.

The whole thing was still under development and fine tuning. Therefore, I wanted to put those tests to check the ui every day automatically. The machine which was given to me for daily regression testing was running linux. It was placed somewhere maybe without a monitor and a keyboard.

Well, my idea was to test it under firefox but I was constrained to use only the text console. Hm... How those two fit together. Fortunately I got a hint from a friend to use a virtual display.
I used the Xvfb for the virtual display.

In this way the cron job could launch the test cases which could open a running fully functional firefox and the webapplication was tested every day. :)

Well, in the beginning I did't want to do all this "testing", but during the journey I gained a lot of experience and I say it worth playing all this Lego like game. :)

Wednesday, 14 November 2007

Introduction

Hello everybody


I am a Software Engineer with over 5 years of experience.
At this moment of writing this blog I am employed by a big software engineering company in Eastern Europe.
I have created this blog with the purpose of sharing ideas about software development, technologies and tools.
Hopefully this will connect me to other professionals around the globe and there will be a place for constructive debates.