Stuff about software development, agile and testing

Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Tuesday, September 22, 2009

Is anyone out there using GWT?

I would be surprised if the answer is yes except you are working for Google. For our new project we had a dream. A dream to create a complete testable web based business application for our customer. Now don’t get me wrong, it is possible to test drive standard web apps but it's hard. We have to have some unit testing tool for JavaScript and then something like Selenium or Watir for the actual integration test. It's a mess.

Now when you take a first look at GWT, it’s like a promise land. You get an integrated development environment to build web application. An environment where your Java code compiles to JavaScript, you get all IDE goodness and above all write unit tests for your GUI code. And it’s been out for few years now. What could go wrong if we try it out for our new project? At least that’s what we thought…


Installation

Most of our developers use Mac book pro as their development environment. Now GWT has some issues running with Java 6 because of 64-bit mode, we had to use Java 5. Now after Snow Leopard update we had to re-install Java 5 just for GWT. This is entirely Apple’s fault but we had this initial hiccup to make up and running for our developers.


Creating Project

This one was really annoying for us. Now in GWT, project could be created in 2 ways, using the command line webappCreator or using eclipse plug-in. We kind of needed both. We needed eclipse because we like to use as our development environment and command line scripts for hooking into our CI builds. If you create project-using eclipse, you cannot use it from command line. Now if you create your project using webappCreator (command line) then it will work from command line but eclipse will not recognize it as GWT project. Come on, this is something really basic. How would a tool like GWT miss something simple like this? But webappCreator does create a .classpath and .project file so that you could import the project to eclipse but that is not good enough. We could have still lived with that but the project that got created had an absolute path dependency specific to the environment. Ok let’s look at this in perspective of a team environment. If you create project and check all the files in your source control, no one else will be able to checkout and run the project as is. They have to go and edit both project and launch configuration files. A big failure for us.


Testing

Being part of an agile team we like to test drive all our design and production code. In fact that was one of the reasons why we choose GWT. To write a unit test we had to use GWTTestCase, which is a wrapper over JUnit. But unfortunately it wraps JUnit 3 not the 4, which is bummer. Every GWT test we created we had to create a launch file at the same time so that we could run it form eclipse and CI box. And did I mention that this launch files will again have an absolute path to the environment it was created. We did tried to use relative path but never worked for us. So again if you are in a team environment how do you scale this? And did I mention that GWT tests ran really slow in hosted mode. A huge failure for us.


Using 3rd path libraries

Could anyone expect a decent size Java project without any 3rd party library? To our surprise GWT doesn’t allow any 3rd party jar, it has its own special requirements. First we had to add 3rd party jars as module and it needs to have source and class files in same location. Now if you want to use apache commons for example you cannot. How many open source projects and tools do you know that follows this special requirement, only very handful of them? I do understand why this requirement is there but at the same time not having access to helpful libraries could slow your team velocity and throughput. Another failure for us.


So what happened next?

Within the second week of the project we scraped GWT and decided to go back to html/JavaScript. Even though we are facing the same testability challenges but our productivity went up. I am sure there are possible workarounds for all the problems I am mentioned up here. And I would like to hear them but if barrier of entry into GWT world is so high, I don’t see anyone using GWT in decent size project.



Saturday, September 27, 2008

I give up...mysql

Its over with mysql. I hope that I don't see it again. There are things that you love about database and installing them is not one of them, especially when it comes to MySql. No no I am not trying anything fancy, all I want is to get Mysql up and running on my new Mac book pro.

The installation process goes through fine but when time comes to login, mysql comes back with aceess denied for 'root@localhost.com'. According to the documentation, root user comes with no password...hmmmm, never mind. Lets move on.

My first reaction was , maybe its using some old my data folder that I migrated from my old mac book pro.

So I tried running /bin/mysqld_safe --init-file=reset-root-password-file to reset my root password. The init file contains an update sql statement to update mysql.user table with a new password for root user. To my surprise the situation did not improve at all.

Next I tried starting the mysql deamon server with -skip-grant-tables option and it worked. No don't start celebrating yet, when I said worked I mean now I was able to connect to the server using my mysql client. And when I looked up the user table I discovered that I don't have any users. Why ? I really don't know. At this point I have already spent 2 hours figuring out the problem but not ready to give up yet. I looked it up on google and as usual I am not alone, some mysql installation doesn't run the post installation script to create users and grant permissions.

All mysql installation comes with a mysql_install_db script under mysql/scripts folder. Apparently for some installation you have to run it manually. I am not sure why?.

Anyways, finally I thought I got it. So I went ahead and ran the mysql_install_db, it fails. This time because of 'duplicate entry for localhost-'. Apprently this happens when your hostname is set to localhost. Maybe this it, so as recommened I changed my hostname to my name and hooray the script ran successfully. Now I am ready to build the rails app I was planning (the only reason I want to use mysql in first place is because my pair has that setup) for in the first place. But no...now my mysql server doesn't start up and it doesn't even show any error message.

I think 3 hours a lot of time to setup a database and I cannot take it anymore

Labels