Tuesday, 27 December 2011

How Bad Economy Bridges Gap Between Nations?

Article written by Sreenivas Mothukuru

Is it “Sun rises in the east and sets in the west” or "Son(/daughter) raises in the east and settles in the west" or "Son(/daughter) raises in the west and settles in the east”?

"Sun rises in the east and sets in the west”
is the known fact. Nobody can deny it and there is nothing new to blog on it.

In general, most of the people living in Asian (eastern) countries feel that America is the destination of quality life, dominant technologies, bubbling opportunities, source of unimaginable income, blah, blah, blah. From the last 2 decades I have seen many young Indian graduates going to western countries (USA) in the name of higher education and eventually making a living by finding some or other jobs.
This behavior or trend made me rewrite my earlier statement to "Son(/daughter) raises in the east and settles in the west".

Now the situation is different and scene is reversed. USA, which is one of the world’s most dominant countries is in financial crises and is struggling hard with unemployment problem. With the economy at US showing no signs of improving, an increasing number of recent graduates from United States are job-hunting to work in India!

Kunal Bahl, the co-founder of Snapdeal, an Indian e-commerce company, recently returned from a recruiting trip to the United States with stops at Columbia, the University of Pennsylvania, Northwestern and Stanford. Snap deal recruitment drive has received over 2000 resumes, out of which 30% of them are non Indians.

Indian companies Mahindra & Mahindra, Flip Kart, InfoTech Enterprises, Zindal Steel & Power, Tata Motors, etc., participated in job fairs held in New Jersey and California recently to recruit fresh talent Overseas.

Every year Infosys company recruit 100+ Americans from Stanford University, Harvard University, Massachusetts Institute of Technology, etc.

HCL Technologies has planned to recruit 10,000+ American and European engineers by 2015. HCL has around 3000 non-Indian engineers working and has plans to recruit 1500 in coming year.

Tata Groups planned to recruit 1200 US engineers by March 2012.

Not only Americans, Indians who have lived abroad for some time (and graduated in US) are also aggressively looking for work back at home says Hitesh Oberoi, Naukri.com CEO.

If the same trend continues for long a day will come when most of the foreign companies stretch branches in developing countries like India and start pushing their University Graduates to work in developing countries. In my opinion this will not only solve the growing unemployment problem, but also help countries and individuals fight against financial crisis.

I wish all countries make necessary amendments in employment law guide and encourage employers to swap employees between countries frequently. This helps employees of different countries understand and appreciate the culture, traditions, values, beliefs of people living at different parts of the world. This would definitely bridges gap between developing and developed nations.

Down the lane people might even start saying "Son raises in the west and settles in the east” (instead of “Sun rises in the east and sets in the west”) ;)

Friday, 16 December 2011

Ever tried adding 2K+ comments to an article?

A few days back I encountered a strange behavior while working on an issue which I feel worth sharing. 

The test case is to check comments section when number of comments for an article are ‘n-1’, ‘n’ and ‘n+1’ (where n = 2000,  3000, etc.). My goal is to identify the point where the comment section breaks in lower environment with ‘n’ comments. I queried QA database and didn’t find much data to check all scenarios. Now my challenge is to quickly create dummy data in QA environment to identify the point where comment section breaks. 

How to quickly add bulk comments to an article?

To do this there are several approaches … some of them are
a)   Add entries (comments) manually till required number of comments were added.
Cons: Clumsy and time taking process.

b)   Write DB scripts to populate numerous records on one go.
Pros: Quick and efficient.
Cons: This approach works in most of the cases but not always. Also, it doesn’t seem to work when lot of tables re involved in the update. Moreover, it doesn’t mimic real time “add comment” functionality.

c)   Browser level automation script.
Pros: Quick and efficient.
Cons: Although this approach is far better when compared with (a) and (b) but, not the best! If we realize the fact that request / response at browser level will take good amount of time!

If not manually ... if not at DB level ... if not via. automation@browser level then what is the best approach to add bulk comments?

Automation at HTTP level is the best optimized way to deal in such scenarios. I chose HTTP level automation because comments can be quickly added at http level. Since the tests are done directly at HTTP level, http level test script doesn’t care about downloading all the embedded objects, rendering issues, HTML/JS changes on the page.

Refer below links for more information.
Rock & Roll With Http Level Testing

In the first attempt http test script ran for almost 18 hours and posted 2000 comments to an article.

Statistics (First Run):
No. of comments added: 2000
Min response time: 28.31 Seconds
Avg. response time: 33.25 Seconds
Max response time: 121.27 Seconds
Total run time: 66505.20 seconds (i.e. ~18 hours)

Good thing: I was able to add comments at http level :)
Bad thing: Http tests took much more time than I anticipated :(

I was very disappointed after looking at the response time as response time (Minimum, Average & Maximum) was huge! Keeping HTTP level tests aside, if I start posting comments manually I can comfortably post more than 2000 comments in less than 18 hours!

Question: Why http level test was damn slow? Why huge response time? What went wrong?

After looking at the huge response times for each http request I strongly felt that something went wrong and started analyzing the script and results. After some research I made a small change in test script and executed the tests. Interestingly, I observed drastic decrease in response time and tests completed in 49 minutes (i.e. less than an hour).

Statistics (Second Run):
No. of comments added: 2000
Min response time: 1.49 Seconds
Avg response time: 1.49 Seconds
Max response time: 2.97 Seconds
Total run time: 2994.84 seconds (i.e. 49.914 minutes)

One small change made Second test run 22 times faster compared with previous (First) test.
Do you like to know what the change is? Check below comments …

In the first run I used '%2F', '%3F', ‘%26', %2D encoded values in POST request body.

In the second run I replaced '%2F', '%3F', ‘%26', %2D  with  ‘/’, ‘?’, ‘&’, ‘=’ in POST request body.

Simple change resulted in the Second test run 22 times faster compared with First test!

Comparison …

Statistics (First Run)
Statistics (Second Run)
No. of comments added: 2000
Min response time: 28.31 Seconds
Avg. response time: 33.25 Seconds
Max response time: 121.27 Seconds
Total run time: 66505.20 seconds 
                               (i.e. ~18 hours)
No. of comments added: 2000
Min response time: 1.49 Seconds
Avg. response time: 1.49 Seconds
Max response time: 2.97 Seconds
Total run time: 2994.84 seconds 
                               (i.e. 49.914 minutes)

Lesson learned:Do not use encoded values in POST request as most of the application servers take long time to decode and process any request”

Other related articles

Share this article with your friends/colleagues if it is worth sharing J

My Approach Towards Automation

Article written by Sreenivas Mothukuru

Anybody can develop software applications but only QA can better test and certify applications.

During QA validation test engineers perform various types of tests to ensure developed application is as per the requirements/specifications. The tests include manual checks to some extent and automation then onwards. Now days the term "automation" has gained lot of significant in Software Industry. Most of the Software professional’s know automaton as some kind of testing done at browser level. At Browser level automation QA engineers automate repetitive tasks and test operations performed on the web browser. Test Engineers have to constantly adapt and modify the script if the web page layout changes. Good number of tools such as QTP, Silk Test, Selenium, etc. support automation. But, are we doing good job testing web applications only at browser level? The answer is NO. This approach is like taking same pill for any illness! Choosing the right testing approach at right time saves lot of QA time and helps team identify bugs in advance. After all “Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives”.

Let us consider some real time scenarios …

a) A project has 10 automation (browser level) test suites covering 10 modules with total 300 cases. If all test suites are run one after another the tests will complete in around 150 minutes. If all suites execute well, with all PASS then no issues. With this approach we can identify failures only when some or other suite fails. What if 9th or 10th suite fail? We will come to know about the failures only at the end. This is a blind way of executing browser level automation tests. Unknowingly, most of the Test Engineers follow similar approach, which means, testers are unnecessarily spending their valuable time and expensive resources on failure cases, rather than identifying such cases in the beginning. A Test Engineer can better plan browser level tests if he/she knows the failure cases in advance. But how?

b) For a project assume that developers are making configuration changes to implement Apache level redirections for huge number of newly added web pages. As always, apache changes are very critical and for every small development change testers must ensure that all existing and newly created redirection rules work fine. Also, the same amount of testing is required in various environments i.e. QA, Stage and Production."To Err is human". It would be error prone and very laborious if checks are done manually. Automation is the right approach, but, automation at browser level consumes some amount of QA time. Because for every page request apache redirection will happen and automation checkpoint will execute only when entire page renders on the browser. We can quickly test apache level page redirections if any testing approach proves faster compared to browser level automation tests.

c) In most of the web applications form validations play a critical role in ensuring correct data is processed by the system. Interestingly, it was found that form validation cases consume lot of QA time during regression testing. If the logic to show error messages after form submission is controlled at only business layer (service API's) then what is the advantage in automating all form validation cases at browser layer?

Is there any testing approach which helps us
>> identify
failure cases in advance to better plan browser level automation tests?
>> quickly test apache level page redirections other than browser level automation tests?
>> test form validations faster compared to browser level automation tests?

The perfect solution to the above questions is Http Level Testing.

Any Test Engineer can do testing task, but only a few can perform intelligent testing. Trust me, intelligent way of testing doesn’t cost much, when carefully done make the tester’s life simple.

Http Level Testing:
Checking individual system components at http level which have HTTP interfaces (JSP, ASP, CGI, PHP, AJAX, Servlets, HTML Forms, XML/SOAP Web Services, REST, etc). Http level tests can be used as a test harness to create a suite of [HTTP level] automated functional, acceptance, and regression tests.

Since the tests are done directly at HTTP level and http level scripts doesn’t care about
- Downloading all the embedded objects (i.e. images, advertisements, js, css, etc.,)
- Rendering issues
- HTML/JS changes on the page

Http level tests are not the replacement to browser level tests. In some scenarios http level tests work better compared to browser level tests. One must be intelligent enough to decide when manual, http and browser level tests are apt during SDLC.

In recent past, I performed some tests at both browser level and http level and below are my observations.

Module \ Method of Execution
Selenium (Execution Time)
Http Level (Execution Time)
Module A (Form Validation)
7 Minutes 1 Second
2 Minutes 5 Seconds
Module B (Basic Functionality)
3 Minutes 47 Second
57 Seconds
Module C (Apache Redirections)
2 Minutes 5 Second
25 Seconds
Total Execution Time
12 Minutes 53 Seconds
3 Minutes 45 Seconds

Total execution time for 3 scripts at browser level is 12 Minutes 53 Seconds.
Total execution time for 3 scripts at http level is 3 Minutes 45 Seconds.

After some R&D interestingly I found that http level tests run 70% faster compared to browser level tests. In the word of Information Technology where time is money, effectively managing the time using intellegent testing approaches will defintely result in greater productivity.

Question: "Is there any testing approach which helps us identify failure cases in advance to better plan browser level automation tests?"
Answer: Http test scripts can be used to do initial checks to know the state of AUT (applications and web services). The outcome of http level tests must govern what browser level automation test suite(s) to kick off. This approach helps test engineer to know the failure modules/cases in advance and target applications which are up and running.
Question: "Is there any testing approach which helps us
>> quickly test apache level page redirections other than browser level automation tests?
>> test form validations faster compared to browser level automation tests?
Answer: Since the tests are done directly at HTTP level and http level scripts doesn’t care about "Downloading all the embedded objects (i.e. images, advertisements, js, css, etc.,)", "Rendering issues" and "HTML/JS changes on the page", apache level redirection and form validation cases can be tested much faster compared to browser level tests.

To become an expert at http level testing one should know http protocol, http request & response formats/types, a few add-ons (Firebug, Fiddler, etc.) to monitor http request & response code and the attitude to learn & implement new concepts.
I hope the time you spent on reading this blog didn't disappoint you!
Please share your feedback on this topic and let me know if you have any questions.

Sunday, 11 December 2011


Chapter 16
1.       The heart of a woman is not united; it is divided. While she is talking with one man, she looks lustfully at another and thinks fondly of a third in her heart.
2.      The fool (mudha) who fancies that a charming young lady loves him, becomes her slave and he dances like a shakuntal bird tied to a string.
3.      Who is there who, having become rich, has not become proud? Which licentious (Free) man has put an end to his calamities (A grievous disaster)? Which man in this world has not been overcome by a woman? Who is always loved by the king? Who is there who has not been overcome by the ravages of time? Which beggar has attained glory? Who has become happy by contracting the vices of the wicked?
4.      A man attains greatness by his merits, not simply by occupying an exalted seat. Can we call a crow an eagle (garuda) simply because he sits on the top of a tall building.
5.      The man who is praised by others as great is regarded as worthy though he may be really void of all merit. But the man who sings his own praises lowers himself in the estimation of others though he should be Indra (the possessor of all excellences).
6.      If good qualities should characterise a man of discrimination, the brilliance of his qualities will be recognised just as a gem which is essentially bright really shines when fixed in an ornament of gold.
7.      Even one who by his qualities appears to be all knowing suffers without patronage; the gem, though precious, requires a gold setting.
8.      I do not deserve that wealth which is to be attained by enduring much suffering, or by transgressing the rules of virtue, or by flattering an enemy.
9.      Those who were not satiated with the enjoyment of wealth, food and women have all passed away; there are others now passing away who have likewise remained unsatiated; and in the future still others will pass away feeling themselves unsatiated.
10.   All charities and sacrifices (performed for fruitive gain) bring only temporary results, but gifts made to deserving persons (those who are Krishna consciousness) and protection offered to all creatures shall never perish.
11.    A blade of grass is light, cotton is lighter, the beggar is infinitely lighter still. Why then does not the wind carry him away? Because it fears that he may ask alms of him.
12.   It is better to die than to preserve this life by incurring disgrace. The loss of life causes but a moment's grief, but disgrace brings grief every day of one's life.
13.   All the creatures are pleased by loving words; and therefore we should address words that are pleasing to all, for there is no lack of sweet words.
14.   There are two nectarean fruits hanging from the tree of this world: one is the hearing of sweet words (such as Krishna-katha) and the other, the society of saintly men.
15.   The good habits of charity, learning and austerity practised during many past lives continue to be cultivated in this birth by virtue of the link (yoga) of this present life to the previous ones.
16.   One whose knowledge is confined to books and whose wealth is in the possession of others, can use neither his knowledge nor wealth when the need for them arises.
Chapter 17
1.       The scholar who has acquired knowledge by studying innumerable books without the blessings of a bonafide spiritual master does not shine in an assembly of truly learned men just as an illegitimate child is not honoured in society.
2.      We should repay the favours of others by acts of kindness; so also should we return evil for evil in which there is no sin, for it is necessary to pay a wicked man in his own coin.
3.      That thing which is distant, that thing which appears impossible, and that which is far beyond our reach, can be easily attained through tapasya (religious austerity), for nothing can surpass austerity.
4.      What vice could be worse than covetousness? What is more sinful than slander? For one who is truthful, what need is there for austerity? For one who has a clean heart, what is the need for pilgrimage? If one has a good disposition, what other virtue is needed? If a man has fame, what is the value of other ornamentation? What need is there for wealth for the man of practical knowledge? And if a man is dishonoured, what could there be worse in death?
5.      Though the sea, which is the reservoir of all jewels, is the father of the conch shell, and the Goddess of fortune Lakshmi is conch's sister, still the conch must go from door to door for alms (in the hands of a beggar). It is true, therefore, that one gains nothing without having given in the past.
6.      When a man has no strength left in him he becomes a sadhu, one without wealth acts like a brahmacari, a sick man behaves like a devotee of the Lord, and when a woman grows old she becomes devoted to her husband.
7.      There is poison in the fang of the serpent, in the mouth of the fly and in the sting of a scorpion; but the wicked man is saturated with it.
8.      The woman who fasts and observes religious vows without the permission of her husband shortens his life, and goes to hell.
9.      A woman does not become holy by offering by charity, by observing hundreds of fasts, or by sipping sacred water, as by sipping the water used to wash her husbands feet.
10.   The hand is not so well adorned by ornaments as by charitable offerings; one does not become clean by smearing sandalwood paste upon the body as by taking a bath; one does not become so much satisfied by dinner as by having respect shown to him; and salvation is not attained by self-adornment as by cultivation of spiritual knowledge.
11.    The eating of tundi fruit deprives a man of his sense, while the vacha root administered revives his reasoning immediately. A woman at once robs a man of his vigour while milk at once restores it.
12.   He who nurtures benevolence for all creatures within his heart overcomes all difficulties and will be the recipient of all types of riches at every step.
13.   What is there to be enjoyed in the world of Lord Indra for one whose wife is loving and virtuous, who possesses wealth, who has a well-behaved son endowed with good qualities, and who has a grandchildren born of his children?
14.   Men have eating, sleeping, fearing and mating in common with the lower animals. That in which men excel the beasts is discretionary knowledge; hence, indiscreet men who are without knowledge should be regarded as beasts.
15.   If the bees which seek the liquid oozing from the head of a lust-intoxicated elephant are driven away by the flapping of his ears, then the elephant has lost only the ornament of his head. The bees are quite happy in the lotus filled lake.
16.   A king, a prostitute, Lord Yamaraja, fire, a thief, a young boy, and a beggar cannot understand the suffering of others. The eighth of this category is the tax collector.
17.   O lady, why are you gazing downward? Has something of yours fallen on the ground? (She replies) O fool, can you not understand the pearl of my youth has slipped away?
18.   O ketki flower! Serpents live in your midst, you bear no edible fruits, your leaves are covered with thorns, you are crooked in growth, you thrive in mud, and you are not easily accessible. Still for your exceptional fragrance you are as dear as a kinsmen to others. Hence, a single excellence overcomes a multitude of blemishes.


Content copied for other sources

Thursday, 8 December 2011



Chapter 14
1.   Poverty, disease, sorrow, imprisonment and other evils are the fruits borne by the tree of one's own sins.
2.   Wealth, a friend, a wife, and a kingdom may be regained; but this body when lost may never be acquired again.
3.   The enemy can be overcome by the union of large numbers, just as grass through its collectiveness wards off erosion caused by heavy rainfall.
4.   Oil on water, a secret communicated to a base man, a gift given to a worthy receiver, and scriptural instruction given to an intelligent man spread out by virtue of their nature.
5.   If men should always retain the state of mind they experience when hearing religious instruction, when present at a crematorium ground, and when in sickness -- then who could not attain liberation.
6.   If a man should feel before, as he feels after, repentance -- then who would not attain perfection?
7.   We should not feel pride in our charity, austerity, valour, scriptural knowledge, modesty and morality for the world is full of the rarest gems.
8.   He who lives in our mind is near though he may actually be far away; but he who is not in our heart is far though he may really be nearby.
9.   We should always speak what would please the man of whom we expect a favour, like the hunter who sings sweetly when he desires to shoot a deer.
10. It is ruinous to be familiar with the king, fire, the religious preceptor, and a woman. To be altogether indifferent of them is to be deprived of the opportunity to benefit ourselves, hence our association with them must be from a safe distance.
11. We should always deal cautiously with fire, water, women, foolish people, serpents, and members of a royal family; for they may, when the occasion presents itself, at once bring about our death.
12. He should be considered to be living who is virtuous and pious, but the life of a man who is destitute of religion and virtues is void of any blessing.
13. If you wish to gain control of the world by the performance of a single deed, then keep the following fifteen, which are prone to wander here and there, from getting the upper hand of you: the five sense objects (objects of sight, sound, smell, taste, and touch); the five sense organs (ears, eyes, nose, tongue and skin) and organs of activity (hands, legs, mouth, genitals and anus).
14. He is a pandit (man of knowledge) who speaks what is suitable to the occasion, who renders loving service according to his ability, and who knows the limits of his anger.
15 One single object (a woman) appears in three different ways: to the man who practices austerity it appears as a corpse, to the sensual it appears as a woman, and to the dogs as a lump of flesh.
16. A wise man should not divulge the formula of a medicine which he has well prepared; an act of charity which he has performed; domestic conflicts; private affairs with his wife; poorly prepared food he may have been offered; or slang he may have heard.
17. The cuckoos remain silent for a long time (for several seasons) until they are able to sing sweetly (in the Spring ) so as to give joy to all.
18. We should secure and keep the following: the blessings of meritorious deeds, wealth, grain, the words of the spiritual master, and rare medicines. Otherwise life becomes impossible.
19. Eschew (Avoid) wicked company and associate with saintly persons. Acquire virtue day and night, and always meditate on that which is eternal forgetting that which is temporary.

Chapter 15
1.  For one whose heart melts with compassion for all creatures; what is the necessity of knowledge, liberation, matted hair on the head, and smearing the body with ashes.
2.  There is no treasure on earth the gift of which will cancel the debt a disciple owes his guru for having taught him even a single letter ( that leads to Krishna consciousness).
3.  There are two ways to get rid of thorns and wicked persons; using footwear in the first case and in the second shaming them so that they cannot raise their faces again thus keeping them at a distance.
4.  He who wears unclean garments, has dirty teeth, as a glutton, speaks unkindly and sleeps after sunrise -- although he may be the greatest personality -- will lose the favour of Lakshmi.
5.  He who loses his money is forsaken by his friends, his wife, his servants and his relations; yet when he regains his riches those who have forsaken him come back to him. Hence wealth is certainly the best of relations.
6.  Sinfully acquired wealth may remain for ten years; in the eleventh year it disappears with even the original stock.
7.  A bad action committed by a great man is not censured (as there is none that can reproach him), and a good action performed by a low-class man comes to be condemned (because none respects him). Just see: the drinking of nectar is excellent, but it became the cause of Rahu's demise; and the drinking of poison is harmful, but when Lord Shiva (who is exalted) drank it, it became an ornament to his neck (nila-kanta).
8.  A true meal is that which consists of the remnants left after a brahmana's meal. Love which is shown to others is true love, not that which is cherished for one's own self. to abstain from sin is true wisdom. That is an act of charity which is performed without ostentation.
9.  For want of discernment the most precious jewels lie in the dust at the feet of men while bits of glass are worn on their heads. But we should not imagine that the gems have sunk in value, and the bits of glass have risen in importance. When a person of critical judgement shall appear, each will be given its right position.
10. Sastric knowledge is unlimited, and the arts to be learned are many; the time we have is short, and our opportunities to learn are beset with obstacles. Therefore select for learning that which is most important, just as the swan drinks only the milk in water.
11. He is a chandala who eats his dinner without entertaining the stranger who has come to his house quite accidentally, having travelled from a long distance and is wearied.
12. One may know the four Vedas and the Dharma-sastras, yet if he has no realisation of his own spiritual self, he can be said to be like the ladle which stirs all kinds of foods but knows not the taste of any.
13. Those blessed souls are certainly elevated who, while crossing the ocean of life, take shelter of a genuine brahmana, who is likened unto a boat. They are unlike passengers aboard an ordinary ship which runs the risk of sinking.
14. The moon, who is the abode of nectar and the presiding deity of all medicines, although immortal like amrta and resplendent in form, loses the brilliance of his rays when he repairs to the abode of the sun (day time). Therefore will not an ordinary man be made to feel inferior by going to live at the house of another.
15. This humble bee, who always resides among the soft petals of the lotus and drinks abundantly its sweet nectar, is now feasting on the flower of the ordinary kutaja. Being in a strange country where the lotuses do not exist, he is considering the pollen of the kutaja to be nice.
16. (Lord Visnu asked His spouse Lakshmi why She did not care to live in the house of a brahmana, when She replied) " O Lord a rishi named Agastya drank up My father (the ocean) in anger; Brighu Muni kicked You; brahmanas pride themselves on their learning having sought the favour of My competitor Sarasvati; and lastly they pluck each day the lotus which is My abode, and therewith worship Lord Shiva. Therefore, O Lord, I fear to dwell with a brahmana and that properly.
17. There are many ways of binding by which one can be dominated and controlled in this world, but the bond of affection is the strongest. For example, take the case of the humble bee which, although expert at piercing hardened wood, becomes caught in the embrace of its beloved flowers (as the petals close at dusk).
18. Although sandalwood be cut, it does not forsake its natural quality of fragrance; so also the elephant does not give up sportiveness though he should grow old. The sugarcane does not cease to be sweet though squeezed in a mill; so the man of noble extraction does not lose his lofty qualities, no matter how pinched he is by poverty.


Content copied for other sources