Sunday, January 12, 2014

Increase Productivity with Power Nap

It is generally said that every adult should get an average of eight hours of sleep. This is the agreed scientific fact so far. See this harvard article for more details.

I am not ready to go by this. Reasons

  1. Contradicts the religious beliefs - Allah says pious spend most of the night standing (in prayers)
  2. Adjusting to this schedule is really hard given that I need to wake up at 5:30 AM latest everyday
Having heard of power naps, I did some Googling. Out of the results I got, the below site seemed convincing of the benefits of napping.

Especially, see the video linked on the site above. Its a really convincing one (or is it too nice to be true?)

With some confusion, I turned to Sunnah, to see the guidance of Prophet Muhammad on this subject.
The below youtube playlist was really good, esp the last three clips.

Below are some important points from the video that took my attention:
  1. The Prophet dis-liked doing anything after Isha: Go to bed after Isha.
  2. The Prophet fluctuated the time of Isha: This makes sense if that is the last thing you do at the end of the day.
  3. The Prophet preferred to delay Isha till the middle of the night: Falls somewhere around 11 PM (the speaker assumes night starts from Magrib)
  4. The Prophet naps between Qiyam-al-lail, and Fajr
  5. The Prophet makes Qailoolah: Napping in the middle of the day. Assuming day starts from Fajr and ends at Magrib, middle of the day falls somewhere around 11:30 AM. It is customary to have a relief of work between Zuhr and Asr in the middle east, and this is practiced to the date.
  6. The speaker also emphasizes on the prophetic etiquette of sleep, such as the recitals, and ablution.

If you are familiar with the concept of Qailoolah and thinking of the right time to perform it, the below article can shed light in it (anytime in the afternoon, before or after, zuhr). 
http://islamqa.org/hanafi/darulifta-deoband/24332

Note: If you are someone who takes time to fall asleep, and thinking that 20 minute power nap is not for you, you may be wrong. Napping is not sleeping. Read the below.
http://lifehacker.com/5501942/how-i-mastered-the-power-nap


Sunday, March 31, 2013

Unix Phiolosophy: "do one thing, and do it well" Comes to GUI World Now

Unix command line is still widely used. Everyday, it sees new users who appreciate it. You don't see a lot of duplicated effort in command line tools.
There's only one 'cd', 'cp', 'chmod' etc..
Then these commands are designed to work together by using standard input/output, redirections, piping, scripting etc. They all work like one family. The output of one is taken as the input of the other and they can be chained in a single line like awesome players.
find . -name 'filename' | xargs -r ls -tc | head -n1

But, each GUI application tries to redo what others have already done. A word processor tries to do image editing, an image editor tries to do word processing, etc...
This leads to a lot of duplicate effort, and wasted energy. We don't see the culture of one program doing only one thing and doing it well. Even if they do so, their is no specification how they work together and how one can achieve something bigger by putting them together.

It seems the answer is near. It is Plasmate in KDE.

Tuesday, March 26, 2013

Just read http://www.linkedin.com/today/post/article/20130325152022-1791094-my-mother-s-daughter?ref=email

Thought of those days in which I came to know that my was having cancer. I resigned my Job from Virtusa those days, although I was a happy and appreciated employee, and joined OrangeHRM just to have a better work-life balance.

Same feelings.

Sunday, March 24, 2013

Use cases or User stories: What is it that we do in OrangeHRM

A user story is very simple and is written by the customer. It's incomplete, possibly inaccurate, and doesn't handle exceptional cases because not a lot of effort is expended making sure it's correct. During development, it serves as a reminder and a starting point for additional discussions with the customer about the full extent of his needs.

No we don't do the above.

A use case is more complex and is written by the developer in cooperation with the customer. It attempts to be complete, accurate, and handle all possible cases. A lot of effort it expended to make sure it's correct. During development, it's intended to be able to answer any developer questions about customer requirements so that developers may proceed without having to track down the customer. 
Yes the above is what we do

XP stories (and similar things, often called features) break requirements into chunks for planning purposes. Stories are explicitly broken down until they can be estimated as part of XP's release planning process.... A story may not even show up in a use case narrative, such as adding a new asset depreciation method to a pop up list.
 No. The above is not done at the specification level. But, probably done during iteration planning.

Conclusion: User stories and use cases do overlap, and sometimes the same at different precision levels. I think we do use cases in 2 digit precision.

Tuesday, December 25, 2012

Is My Child's Montessori a Real Montessori?

My son starts preschooling next week. I am not much worried about his education as he already
1. Recognizes vowels in Tamil
2. Can count up to ten
3. Can add up numbers using his fingers for counting
4. Knows colours
5. Draws basic shapes
6. Colours inside shapes
7. Knows some rhymes
8. Can tell meaningful stories (can even make up one for you)
9. Asks a lot of questions
etc..
I think the above may be well enough for a child of 3.6 years.

We , my family including my parents, didn't leave some basics such as learning alphabets solely at his teacher's hands. Even if he doesn't even learn a single word from the preschool, it is fine with me as he already knows what a child should know academically. Instead, I expect him to learn morality, how to cope up with others, how to accept both success and failure equally, socializing with others etc at the preschool.

There are a lot of preschools, often called montessories - appropriately or not - in our area, but I was picky in one since I find that the teachers there are kind, somewhat broadminded, and have a sound religious background.

I met brother-in-law uncle today, who is a principal of a secondary school, and his wife runs a nursery for more than six year. He told me that they have purchased a complete study pack spending around 400,000 LKR which guides a child from 3 years to 14. Having not spending that much, I was thinking why they could not get some free materials from the internet and print them out in good quality themselves which would have costed much less than the amount they had spent. Thought of trying it out myself.

Did some searching online and found that keywords homeschooling, preschool, and montessori bring more relevant contents. And, being new to montessori method, just read some article here and there but came across something very important; how to check whether the preschool my son is going to attend provide montessori education or not. The following are the criteria I came across from The American Montessori Society



  • mixed-aged classes, in which older children serve as role models and helpers;
  • a full array of developmentally appropriate Montessori learning materials;
  • teachers with credentials from a Montessori teacher education program;
  • adherence to the Montessori instructional approach, with teachers serving as guides rather than givers of information.


Getting curious on evaluating my son's preschool with the above criteria. Whether they follow montessori or not is not going to change my decision on whether my son will study there or not. But, the online research gave me some inspiration to try some montessori concept on my son.

Need to learn some more and try it out.

Monday, September 24, 2012

Anti-Islam Movie Contradicts Youtube's Community Guidelines

Google, if wishes, has all the reasons to remove the anti-Islam movie which creates a big fuzz these days. Such removal will not be the first time, as Google has already removed such offending clips when it came to holocaust denial. It had also removed numerous videos posted during Gaza Invasion, as the videos contained dead bodies claimed to be killed by Israeli soldiers.
Term:
YouTube is not a shock site. Don't post gross-out videos of accidents, dead bodies or similar things intended to shock or disgust.
Try the following link and see for yourself.
www.youtube.com/playlist?list=PL7FBB27616F4428B7

The anti-Islam movie is in clear contradiction to the following Google Community Guidelines, but still resides there safe and sound in youtube, enjoying the popularity.
1. Hate Speech
Term:

We encourage free speech and defend everyone's right to express unpopular points of view. But we don't permit hate speech (speech which attacks or demeans a group based on race or ethnic origin, religion, disability, gender, age, veteran status, and sexual orientation/gender identity).
In the same page Hate Speech is defined as:
"Hate speech" refers to content that promotes hatred against members of a protected group. For instance, racist or sexist content may be considered hate speech. Sometimes there is a fine line between what is and what is not considered hate speech. For instance, it is generally okay to criticize a nation, but not okay to make insulting generalizations about people of a particular nationality

2. Harassment
Term:
Things like predatory behavior, stalking, threats, harassment, intimidation, invading privacy, revealing other people’s personal information, and inciting others to commit violent acts or to violate the Terms of Use are taken very seriously. Anyone caught doing these things may be permanently banned from YouTube.
In the same page Harassment is defined as:
It comes down to respect. YouTube is all about sharing and interacting with the community in respectful ways. If you're not sure whether a video or comment you've made crosses the line, follow a simple rule of thumb: if you wouldn't say it to someone's face, don't say it on YouTube. And if you're looking to attack, harass, demean, or impersonate others, go elsewhere.

Sunday, September 23, 2012

Sri Lanka's Rating Based on Media Freedom For the Past Ten Years

I was just going through the rating of countries according to media freedom from Reporters Without Borders'.
What caught my eyes is that we (Sri Lankans) are just one step better than Somalia, and rated 163rd of 179 countries.
I then started comparing the ratings given to us during the past ten years. The results below.
2002 - 51
2003 - 89
2004 - 110
2005 - 115
2006 - 141
2007 - 156
2008 - 165
2009 - 162
2010 - 158
2011/12 - 163

Numbers speak. No comments from me.

Sunday, September 16, 2012

Controversial Anti-Islam Movie and Controversial Reaction

I was just going through the news on the new controversial movie (Innocence of Muslims). Given that it is a low budget film, directed by a pornographic film director, and the producer/financier is a fraudster, I would say anyone can clearly see the purpose of the film.
It has more to do with making huge profit with small investment, more than religious hatred or freedom of speech. I would say the people behind the video clip have achieved their targets already.
I am glad that Libya has appologized for what happened, and takes actions to protect law and order.

I saw a quite interesting statement in Al-Jazeera, which I find strikingly true.

The unrestrained anger against a YouTube clip has even led to outrage among some Syrian activists, with one tweeting that "the only thing that seems to mobilise the Arab street is a movie, a cartoon or an insult, but not the pool of blood in Syria".


Tuesday, July 17, 2012

Nokia, Qt and future of KDE

I had blogged about what would happen to Nokia, Qt and KDE almost an year back when they started signalling to go behind Windows mobile.

I think many of my predictions are coming true, or have a chance of becoming true as there is a fuzz on forking Qt and Nokia loosing interest in Qt.

I just read an article on dot.kde stressing how important is it to keep Qt open and free. I don't see a bright future for Nokia. No innovation, and so many strategical mistakes these days.

Good Bye, Nokia!

Sunday, July 1, 2012

Syria - Starting to Explode

As Kofi Annan put it, “'Syria is not Libya, it will not implode, it will explode beyond its borders."


Syria's current crisis is not just about revolution against repressive ruling elite. It also has religious and sectarian sentiments which send strong messages to its neighbouring countries. A bit of background about the country will help to understand the situation clearly.


From its independence in 1946, Syria was desperately in need of stability. It faced many coups and counter-coups, and had 20 cabinets just between 1946 to 1956 and multiple versions of constitution. The Assad family rose to power with the 1970 Syrian Corrective RevolutionImmediately after which Hafez-Al-Assad, the current president's father, established Alawite rule of the country by offering high ranking positions to his loyalists, and close family members. This brought immediate stability and set the ground for development and progress. 


Although the above revolution had its positive effects, Alawites, the current ruling elites, represent just 12% of the population. This allowed Alawites to enjoy benefits out of proportion, which could also be interpreted, inevitably, as marginalization of Sunnis who represent 74% of the population. 


There are several Shi'ite sects which co-exist in harmony with Sunni communities. But, unfortunately, Alawites may not be one of them. Most of the Alawite belief is kept in secret and they don't pray in mosques. They consider pillars of Islam as symbols, rather than duties. They are considered as Pagans by early Imams such as Imam Ibn Kathir. This naturally places a historical mistrust between the local Sunnis and Alawites. 


Even though Bashar-Al-Assad tries to over come this by emphasizing he is Baath Socialist, secular, and married to a Sunni wife, it is not so convincing when Alawites enjoy the government's favour. He even tried building mosques for Alawites, praying in mosques in public, and making Alawites act more like Sunnis. But, the sectarian division is more historical and deep rooted, and marginalization of Sunnis is too much to be overcome by such actions. 


The mistrust of locals, and the craving for absolute power left both Assads, the father and the son, with no option but to rule the country with an iron fist. Any slight action against the regime, whether peaceful or not, is not tolerated. The regime has been very notorious for suppressing its own people. According to Wikipedia


On the other hand, he also drew criticism for repression of his own people, in particular for ordering the 1982 Hama massacre, which has been described as "the single deadliest act by any Arab government against people in the modern Middle East"; as well as others such as the April 1981 Hama massacre, the Tadmor Prison massacre, the Siege of AleppoTel al-Zaatar massacre and the October 13 massacre.[6][7] Additionally, Human Rights groups have detailed thousands of extrajudicial executions he committed against opponents of his regime.[8]

So, the current state of conflict has dimensions such as 
  1. A totalitarian regime which favours a small circle and marginalize the rest
  2. A Shi'ite sect suppressing Sunni Muslims
It is hard to judge the current revolution as it has a complex mixture of the both above elements. When oppressed Sunnis raise against Alawites, chantings such as "The Christians to Beirut, the Alawites to the grave" are common. These sentiments made many Alawites to think that Assad's fall will lead to a sectarian genocide. This made more and more Alawites to side with the regime, which in turn makes the revolution more and more sectarian. The involvement, and the massive financial and weaponry support the current regime receives from Iran, and the deployment of Hezbollah forces on the ground along with the government add fuel to the sectarianism.

On the other hand, "Free Syrian Army" Syrian is a proof that the crisis is more about dictatorship rather than sectarianism. Syrian military leadership had issued orders to shoot disobeying soldiers who refuse to shoot at unarmed civilians. Such defectors, including high ranking officers, who sidelined with the civilians have come together and formed Free Syrian Army. Free Syrian Army is made up of both Alawites and Sunnis. This puts revolutionaries of Sunnis and Alawites together against an oppressive regime and in the same plate.

This uprising also draws other countries such as Turkey, Egypt, Jordan and Saudi in to the picture as regional and neighbouring powers. 

Around 30,000 refugees have camped near the Turkish border, and Turkey is already providing a base for Free Syrian Army... Hezbollah is already on the ground with Assad... Jordan is giving shelter to refugees... Saudi is providing arms for revolutionaries...


The Syrian issue seems to be spreading to the other countries day by day, rather than settling. YesKofi Annan is correct. “'Syria is not Libya, it will not implode, it will explode beyond its borders."

Sunday, June 24, 2012

Migrating From Selenium 1.0 to 2 - an Alternative to waitForPageToLoad()

We have been developing a selenium 1.0 based automation suite and an important decision we had to take recently was to support modern browsers. Modern in the sense, Firefox 3.6 is not any more modern, and so is Firefox 10.0.
This forced us to upgrade our suite to Selenium 2.0. Because of the way the suite is designed, upgrading the entire suite is just a matter of rewriting a single class, and ideally it should work.  All went fine, until we came up with the waitForPageToLoad() function of Selenium 1.0, which does not have an equivalent counterpart in Selenium 2.0.
Two recommended solutions to this issue in the official selenium documentation were

  1. Wait for an element instead of a page load - This doesn't work because this requires a major rework. We need to find all wait statements, and decide what to wait for. There are instances where clicking on a button may lead to different pages based on the other choices made in the page. This makes this solution more complex.
  2. Wait for certain amount of time if an element is not found - This is simple, and we tried it out. It creates a lot of unnecessary waiting for every elements, even when the test case expects the element to be not present. Eg: assertFalse($selenium->isElementPresent("ElementID"));  takes 30 seconds (default timeout) to pass. The suite which originally ran at 1.5 hours, took more than 5 hours to complete.

The current solution we are trying out, may be the final one that we would settle for, is none of the above two. We implemented waitForPageToLoad() as waiting for document.readyState status to become "complete".

$state = $session->execute(array( 'script' => 'return window.document.readyState', 'args' => array(), ));
if ($state == "complete" || $timedOut ){
return;
}

So far the results are positive. I hope this tip would help anyone migrating from selenium 1.0 to 2.

Thursday, December 15, 2011

KDE 4.7.2 is Now Available for Debian

KDE 4.7.2 has been uploaded to both experimental and the semi official http://qt-kde.debian.net/ repository.

The release has been a long awaited one, delayed due to various reasons, and I hope this is a great news for many of us.

At the meantime, KDE 4.8 beta2 is available now from the upstream.

Sunday, October 23, 2011

Composite Key Problem in Doctrine and How to Work Around

I tried to create an invoicing system with symfony 1.4. It did not work out well as the database design contained some complex composite keys which were not possible to be mapped properly in doctrine that is bundled with symfony 1.4.

I tried to work around by creating the database first, and then generating the schema. But, if I use the same generated schema and created the database, some extra unnecessary  constrains were generated. These constrains made the database design useless. After trying a couple of time, I lost my faith in doctrine, and just gave up.

See my post on doctrine and composite keys to see the design which caused the problem.

I heard that symfony-2 has a better support for the composite keys, and tried it out. Again, it did not work out well.

Then, after some searching, I learned that to properly use an ORM, I should start with a class diagram. ORM should persist it to the relational database. I should not go the other way around, which is, creating the relational db structure and mapping it to the class diagram. So, I tried the above db design in the OO context, and below is the initial draft I could quickly produce. This diagram sees simpler and natural to put into action with an ORM.


A complex problem to be solved in one perspective, can be a very simple one in another perspective. Finding the right tool, if it seems hard, then consider finding the right perspective to solve the problem.

Sunday, October 16, 2011

Nokia - Maemo, Meego, Meltemi, and What ....?

History has proven that division of labour is the path of the future and present. Nokia should have concentrated on Phone Hardware rather than trying to come up with a phone OS. Their efforts to come up with Maemo and Meego were proven failures. They shared the same fate as HP's WebOS. (Now that google has bought Motorolla, will the history repeat? The answer is yet to be seen)

In the meantime, other phone companies started making phones for Android. That worked well as the model goes along the well proven division of labour concept. They had out-beaten Nokia in the Smartphone Niche.

From the above perspective,  Nokia's decision to go with Windows-7 Mobile is a good choice. And Plasma Active is a recent choicewhich is now open . Even if they had decided to go with Android, that would also be fine, if they had the capability to compete purely based on the hardware.

Or has Nokia lost their faith in their hardware competency and trying to survive with the brandname and some software differentiation?

Sunday, September 25, 2011

80% of the Words Used In the Quran Can Be Learnt in Two Months

If you are looking for an easy way to learn Quran the following site would be very helpful.

Start with the video embedded in this site. That gives a lot of useful information on how to use the material.

The brother who made the video, points to an external site and explains how to use it. I tried the links and found some of them are moved, but within the same site, and you can access them using the links provided.

Try it out, and Insha Allah you may benefit a lot!

Wednesday, September 7, 2011

KDE 4.7 is Delayed in Debian

I think I owe a blog post here because I see a lot of users visit my KDE 4.6 being delayed post. Whenever I login to debian-kde IRC channel, the topic says "No ETA for 4.7." I don't have any other information on the topic. I did look at regular places where I check for info, but could not find any.

As debian is a voluntary project, we can't expect them to commit to a deadline. People have their own lives to live. But, I tried the IRC twice to get some information on why they explicitly say "No ETA for 4.7." It seems there is no special reason for delaying 4.7 other than the usual one, need more helping hands.

I hope people join their hands with Debian.

Update: KDE 4.7 is now available for Debian

Defining QA Process for Teams Which Don't Write Test Cases

As I am leading a small QA team on an Open Source company, I have the task of defining the QA Process. The formal QA cycles, and process won't work here.

We have two major teams, one is working on the open source product, and the other one working on customizations of the open source product. The Open Source team is more agile, while the customization team being less agile. We have projects for which presales and estimation done in 15 minutes, development and testing finish in one day.  The largest project so far is two and a half developers working 3 months together, and two testers working both on manual testing as well as automation of basic test cases.

Writing test cases is not in the business model. We send the feature specification to customers and get it signed off before the project starts. The practice of signing the test case document is not there. I have spoken to the project managers, and none want the QA team to write test cases to their products. Since test cases are not signed off, they don't carry much business value for project managers.  For a project that runs one month, they don't want the QA team writing test cases for one week.

Following are some of the reasons why test cases don't provide a good solution to the company.
1. Specs are not written in a way so that business scenarios are easily visible. Rather it describes a small chunk of functionality. This makes it harder to write test cases before the release is made.
2. Test cases are useful if the same set of test cases are executed in multiple cycles. This, usually, is not the case. A story/functionality, is usually tested thoroughly in only one cycle. And there will be defect verifications in one or two more cycles and that's it. This reduces the value for the test cases a lot, and people prefer ad hoc.

I find it harder to define a testing process where test cases are not practiced. Since testing then goes undocumented, it is harder to monitor and control it.

I know that Agile teams don't rely on formal test cases, and they have a different view on testing. I am currently going through  "Agile Testing" by Lisa Crispin, hoping that it will shed some light to the problem.

Today, I found something interesting in the book, which I would like to share with the rest of the world.
Agile testing doesn’t just mean testing on an agile project. Some testing approaches, such as exploratory testing, are inherently agile, whether it’s done an agile project or not. Testing an application with a plan to learn about it as you go, and letting that information guide your testing, is in line with valuing working software and responding to change.

Sunday, September 4, 2011

Automating Web Applications - How I Got Started - 3

I am going to explain a tool that I created which stands in between Record and Play Selenese and robust automation code.

You better read my previous post to see why I came up with such a solution.

The purpose of the solution is

  1. the tool should be usable by non-technical people as well
  2. a single modification of the web application should break only a single unit in the automation suite. For example, if a text box is renamed in the application, it should be possible to fix it only in one place and correct the suite.
  3. should allow re-usability. i.e. We should be able to build a block of solid piece and reuse multiple times
  4. should support parameterizing the data. 
  5. the learning curve should be small, and after that users should be writing test cases straight away without worrying much about building large frameworks.


Bearing the above considerations in mind, I decided to go with a "hack-around of Selenium IDE."
The design had three layers
1. Action layer - containing all the actions. An action is the atomic element which performs a logical action and placed inside an action file.
2. Template layer - Template files are there just to contain action files, and other template files. They are similar to directories which contain files and other directories.
3. Data layer - Data files contain the data of a template file. Parameters of the template file, and the data file should exactly be the same. Data in the data files will be copied to templates, and then to action files.

Let me give three sample action files here. Name of the action is the name of that particular file.

Name of the action file: OpenURL 
param:URL
<tr>
   <td>open</td>
   <td>#URL#</td>
   <td></td>
</tr>

Name of the action file:TypeSearchItem
param:SearchItem
<tr>
  <td>type</td>
<td>id=lst-ib</td>
<td>#SearchItem#</td>
</tr>

Name of the action file: ClickGoogleSearch 
param:
<tr>
<td>clickAndWait</td>
<td>btnK</td>
<td></td>
</tr>


The below template file could hold the above action files.

Name of the template file: SearchGoogle

param: URL SearchItem

OpenURL URL
TypeSearchItem SearchItem
ClickGoogleSearch 


Then I create a data file to hold the data of the above template. It would look like below.

param: URL SearchItem
google.com,mailtoirs.blogspot.com
google.com,orange
google.com,apple
If I run the tool, it will map the data file to template file, correctly replace the parameters in the action files and produce one selenese script which can search google for "mailtoirs.blogspot.com", "orange", and "apple", one after the other.
  • Action files are usually created by recording in the Selenium IDE, and then modifying it a bit for parameterizing, and saving as different files. Creating the above example took me less then 5 minutes. 
  • The final resulting selenese script is also run using the Selenium IDE. 
  • If google changed the name of the search box one day, I would have to rename it simply in one action file (TypeSearchItem), and run the tool to regenerate the selenese script. Had this been a manual recording, I would have to replace it in all three searches manually. 

What I described so far is the essence, and a simplified view of the tool I created. The tool actually contained another layer, suite, which puts templates together and generate a selenium suite.

We got a project where the tool could be used immediately. The project was fairly complex, and the duration was 2-3 months. Myself and another new person, who was a fresher to the field, had to complete the manual testing as well as the automation within the duration of the project. The concept and tool became very handy, and with some struggling, we were able to successfully automate the product to a certain level.

I was hoping to automate the entire base product using the tool. But, as usual manual testing were prioritized, and I did not have a chance to automate for a while. Then, as days passed, the initial concerns and assumptions changed, and that paved the way to another technology to be used. Details will follow in the next post.

Wednesday, August 10, 2011

Automating Web Applications - How I Got Started - 2

If you have'nt read part-1 of the story, please read it so that you will get the full picture.

I appreciate the good design in IBM three tiered architecture, but I believed there could be better object oriented ways. The three tiered architecture gave me some good insights on how to maintain reusability, maintainability and the importance of a good design. It actually inspired me towards a different design.

I imagined a page as an object containing three other objects. componets, actions, and verifications. Each of these will have respective page specific items. Test cases are put in a different layer. A simple test case would look like the following. Think of the below as a psuedo code, just for explaining the concept, not a real one.
Login login = new Login("URL");
login.actions.login(username, password);
if(!login.verifications.verifySuccessfulLogin())
  System.out.println("login no successful");
else
  System.out.println("Successfully logged in as " + user );
I designed this without knowing that there is a similar, but better pattern called pageobject design.

As I told in the previous post, this was a slack-time task, and though I was doing it with a lot of hope and passion, I was the only one doing it. A lot of code representing a lot of pages need to be complete to cover even smoke testing level. But, if the classes are ready, and API is ready, progress from Smoke Testing level to Medium/Thorough testing would be much quicker. The point is, a lot of coding needs to happen to achieve some minimal real progress. No one in the management realized that this is another development project, which demands a lot of programming skills and resources (people). After almost 1.5 years, I still seriously doubt that  they have a good understanding of the load of the task.

After about three months, my supervisor, who is also a very good friend of mine asked a simple question. "Do you think we would be able to make it by the end  of the year if we go in this pace". This let me re-think the whole progress and the target I would achieve at the end of the year.

By that time, only one test case was done. I had managed to ramp up another colleague, the one and only resource I had for sharing the work (only if he was free of other tasks). He was struggling to catch up with Java, and not so enthusiastic because the company is not Java based, rather PHP based. When we got into any Java specific issues, none was there to help. Another major risk was the entire product, the web application, was being re-written using symfony framework at that time. So, the product was changing. One traditional rule in Automation is "Not to Automate Against A Changing Product". The product has to be stable, before starting automation. So, by the time I write another ten more test cases, most probably the entire module would have been re-written making the automation code outdated.

Given all the above facts, I decided this is not the way. This prompted me to go for another solution. I'll explain that in the next post.

Automating Web Applications - How I Got Started

I am in software QA stream. And an Open Source company whose main product was a web application. I was asked to write functional test automation for the web application as the company wants to push in that direction. At the time of the request, i.e. early in 2010, functional test automation was not a high priority, but completing manual testing on new releases had higher priority. Functional test automation was a slack time task, and I was new to the company and web applications.

I had hands on experience in working in a full fledged functional test automation project, trying to automate IBM DataStage using Rational Functional Tester. We were doing automation as per the three tiered architecture. Three tiered architecture separates, appobjects into one layer, tasks into another and test cases into another. Test cases call tasks, and tasks are achieved by manipulating appobjects. Check this link out for more details on the architecture. Though I find the concept not being very much object oriented, still that solution was a good one, scalable and maintainable. So, my whole experience was around IBM DataStage, which is a desktop application.

Now, in the new company, it was about web applications. It is not a web site, to emphasize, but a real desktop like web application. They had done some automation already, which was selenium IDE recordings. I was told that selenium scripts would fail sometimes without proper reasons. I was OK with it because that is something common to any automation suite. But, the degree of emphasize they put on that fact was quite puzzling, and then when I tried things out some other interesting facts also came along. One of the colleagues, who had contributed a lot to the scripts, told me that when the scripts are run in high speed, things often fail. So, running in a slower speed would make many of the test cases pass. I did some googling and could not find such an issue with Selenium. And the scripts did not have verifications built in. Renaming a single texbox in the application would necessitate updating so many places in the scripts.

Slowly the responsibility of automating the entire product came unto my head. My previous experience and expertise taught me that record and play back is not the solution. A definite NO to that direction. Then I had to do some research, to find out a better way to automate the application. The company was willing to invest in commercial products, even though open source technologies are preferred. But, If I pushed them towards big commercial products, I knew there would be too much expectation on me. And if I later find out that we are not going anywhere with that tool, that would impact my career negatively. I wanted to stick to Open Source solutions for so many reasons, including my love towards Open Source. And I am still glad, that I didn't go behind any commercial software.

My research suggested WebDriver would be the best. I started with that, but there were two main problems. I was just a QA guy with some programming knowlege, and WebDriver was just a jar file without any IDEs and frameworks to kickstart. There was no one in the QA team, who could guide me how to proceed in this direction. We had a development team, and I had a good relationship with them, but they don't have the slightest idea of how a functional testing framework would look like. So, I could not talk to them about my needs. As I had been in an IBM Rational Functional Tester project, I knew how a matured functional test project would look like. The pretty fancy test reports, the ant commands that would let us run the test suite with different configurations, the object mapper interface which would give us the properties of the components, and so many other stuff. You can check this link to have a smell of it. All of them are missing, and all I was left with was one lonely jar file and the task of automating the entire product.

My stubbornnes asked me to write all the verifications using if conditions, and some research pointed me that firebug could show me the properties of the components. The dear Eclipse IDE was already there. And I started writing the code for functional testing.

That's how my journey began. Read the next post to see how things moved on.