Saturday, April 9, 2016

Automation Testing for Manual Testing professionals


What is automation testing ?


Use of special software (separate from the software being tested) to control the execution of tests and the comparison of actual outcomes with predicted outcomes.




Automated Software Testing is the application of automation technology throughout the software testing life cycle with the goal of delivering capability faster and more afford ably.
A process in which software tools execute pre-scripted tests on a software application before it is released into production.

Using automation tools to write and execute test cases is known as automation testing.
The process of software verification in which the basic function and test steps, such as running, initialization, execution, analysis and delivery of results are performed automatically by tools for automated testing.

So whats automation testing or test automation? as per bolton and bach*

from the definitions we have seen till now, we can summarize following
  • we automate test cases, which are nothing but steps followed by end user, hence automation testing is automating user
  • we automate test cases execution , which are executed by tester manually , hence automation testing is automating tester
but that's not true
 We see at least three big problems here that underestimate testing:
  • The word “automation” is misleading. We can not automate users. We automate some actions they perform, but users do so much more than that.
  • Output checking can be automated, but testers do so much more than that.
  • Automated output checking is interesting, but tools do so much more than that.

Test automation is not human at all. It’s incredibly fast and inexpensive

We define a tool as any human device that aids in fulfilling a human purpose. A test tool could be software; hardware; a map, document, or artifact; or some other heuristic that aids in fulfilling a testing purpose.

Automation testing is we automate error prone repetitive tasks,
automated testing is not really testing. It is checking of facts.


Why Automation Testing ?

Save Time, Save Money

Automated software testing can reduce the time to run repetitive tests from days to hours.
A time savings that translates directly into cost savings.
It means you saves time required for repetitive test execution and you saves money.
  

 

Manual Testing of all work flows, all fields , all negative scenarios is time and cost consuming

 

Increase the effectiveness, efficiency

Software Test Efficiency is number of test cases executed divided by unit of time (generally per hour). 

Test effectiveness = Number of defects found divided by number of test cases executed. 





  • Automation does not require Human intervention. You can run automated test unattended (overnight)
  • Automation increases  speed of test execution
  • Automated testing can simulate tens, hundreds or thousands of virtual users interacting with a network, software and web applications.

Helps increase Test Coverage

 

  • Test coverage in particular, is a measure of the extent to which the code in question has been tested by a particular test suite
  • test coverage is a useful tool for finding untested parts of a code base.
  • Manual Testing can become boring and hence error prone.

Early Feedback

 

 

In agile context

Test automation provide early feedback, if automated tests own by both developer and tester
Test can be run on each code change.
Collaboration of developer and tester due to automation improve moral of team as well as individual

 

When and What to automate? 

In any project life-cycle, our goal should be to automate all the activities that are repeated while creating and maintaining the system

so what are repetitive activities?
  • Set up test data
  • Executing same tests on different or cross environments
  • Regression testing 
Our focus should be to create a high value test suite, which focuses on the business critical areas of our product.

 

Saturday, February 27, 2016

Locators in selenium webdriver

Lets understand locators by asking WH questions.

Locators in selenium
Click on the image to enlarge it
What are locators ?
  1. Locators are the lifeblood of the tests.
  2. Locators are different strategies for locating elements on a page
  3. Locator can be termed as an address that identifies a web element uniquely within the webpage.
  4. Locators are the HTML properties of a web element. 

When and Why they are required ? 
  1. To tell the Selenium about the web element it need to perform action on
  2. To tell Selenium which GUI elements ( say Text Box, Buttons, Check Boxes etc) its needs to operate on.
  3. To get information of an element

Who are they ?
  • Id 
  • Name
  • Linktext
  • Partial Linktext
  • Tag Name
  • Class name
  • Css selectors
    • selectors are patterns used to select the element(s) you want to style
    • is the part of a CSS rule set that actually selects the content you want to style 
  • XPath expression
    • document is parsed into a tree structure (DOM tree)
    • for selecting nodes from a document
    • is used to navigate through elements and attributes in a document.
Where are they in selenium web driver? 
  • abstract class By inside the package org.openqa.selenium
  • subclasses of By and interfaces
How to use locators, to find elements with different locator strategies ? 
  • Using developer tools available in browsers
  • Right-click --> Inspect Element or Inspect (Firefox / Crome)
  • Using browser add-on like this 
  • Example: 
    • <input name="register" class="required" type="text"/>
    • WebElement register= driver.findElement(By.name("register"));
 Which locator strategy to use?
  • There is no perfect locator
  • If you’re smart about your locators you can reduce the cost of maintenance
References
  1. http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/By.html
  2. http://www.seleniumeasy.com/selenium-tutorials/selenium-locators
  3. http://toolsqa.com/selenium-webdriver/locators/
  4. http://www.guru99.com/locators-in-selenium-ide.html




Monday, March 3, 2014

Cloud Computing

                Since we have all heard about the new age of Cloud Computing, Some of us must be wondering what kind of testing we can perform on this platform? First let’s get some insight on what is Cloud Computing?  It is a type of computing that relies on sharing computing resources rather than having local servers or personal devices to handle applications.
 In cloud computing, the word cloud (also phrased as "the cloud") is used as a metaphor for "the Internet", so the phrase cloud computing means "a type of Internet-based computing," where different services -- such as servers, storage and applications -- are delivered to an organization's computers and devices through the Internet.
There are different kinds of Clouds
Public clouds
A public cloud’s physical infrastructure is owned by a cloud service provider. Such a cloud runs applications from different customers who share this infrastructure and pay for their resource utilization on a utility computing basis.
Private clouds
A pure private cloud is built for the exclusive use of one customer, who owns and fully controls this cloud. Additionally, there are variations of this in terms of ownership, operation, etc. The fact that the cloud is used by a specific customer is the distinguishing feature of any private cloud. A private cloud might be owned by the customer, but built, installed, and managed by a third party rather than the customer. The physical servers might be located at the customer’s premises or sited in a collocation facility.
Community clouds
When several customers have similar requirements, they can share an infrastructure and might share the configuration and management of the cloud. This management might be done by themselves or by third parties.
Hybrid clouds
Finally, any composition of clouds, be they private or public, could form a hybrid cloud and be managed a single entity, provided that there is sufficient commonality between the standards used by the constituent clouds

Clouds are divided into 3 components 
· IaaS(Infrastructure as a service): Is the hardware and software that powers it all. It provides you the computing infrastructure, physical or (quite often) virtual machines and other resources like virtual-machine disk image library, block and file-based storage, firewalls, load balancers, IP addresses, virtual local area networks etc.
 Examples: Amazon EC2, Windows Azure, Rackspace. 
· PaaS(Platform as a service): Is the set of tools and services designed to make coding and deploying , programming language execution environment, database, web server etc.
Examples: AWS Elastic Beanstalk, Heroku, Force.com, Google App Engine. 
·Saas(Software as a service) Applications are designed for end-users, delivered over the web. 
in this model you are provided with access to application software’s often referred to as on-demand software’s. You don't have to worry about the installation, setup and running of the application. Service provider will do that for you. You just have to pay and use it through some client
Examples : Google Apps, Microsoft Office 365.




What is the difference between Cloud and traditional Application







The difference between Cloud and traditional method of testing, People mostly think it’s the same. But going through many articles we realize nothing can be the same there is always something different. Testing in cloud is different than out traditional on premise testing where enterprise has to set up, maintain and verify the scenarios from end to end prospective in all aspects. Cloud-based software testing refers to testing and measurement activities on a cloud-based environment and infrastructure by leveraging cloud technologies and solutions. Cloud testing exemplifies testing on demand and is perceived as future of testing services.

The following are the various types of testing performed in general for cloud testing:
·SIT/UAT: The cloud platform must be integrated with all platforms and infrastructure services so that a user can build up his data online. Testing is done to verify the current provided cloud solution from the vendor meets the business needs of the organization.
·Security testing: Ensure that all sensitive and important information which are going to be stored in the cloud will be highly secure in nature. As privacy also a key area in cloud from the user point of view, it’s important to verify   the privacy of the application users and associated information when maintained in cloud.
·Performance/Load Testing: Testing technique that measures the system performances in cloud. Verify the network latency and response time, Load balancing, peak request count by hosting subscription in different data center across the globe. Adding to these, traditional load and stress testing are required to validate business scenarios in the cloud model in terms of varying dynamic load and stress on the application.
·Stress/Recovery testing: Verify the time it takes to recover from disaster in different scenario (system crashes under high load/volume of data, hardware failures, system failures, Network outrage, insufficient bandwidth) as per SLA. Also verify is there any data loss in this process and time takes to report failure. Services must be retrieved online with minimum adverse effects on clients’ business.
·Interoperability Testing: verify moving application from one cloud to alternate cloud provider should have the flexibility to run successfully. Basically there should not be any issue if business/user is migrating from one infrastructure to another one


The infrastructure requirement for test environment is another important consideration for cloud testing. Some option can be simulating in-house test environment and choosing the right cloud service provider.
Testers should also focus in the specific requirements of the application to be tested as it is based on the cloud environment:
Supporting multiple browsers, User session management related issue, security vulnerability, in a multi-tenant environment, restricting users to access their data only and many more.
There are Various tools available in the market for cloud testing SOASTA Cloud Test, Monitis, Loadstorm, YETI(York Extensible Testing Infrastructure)and many more


Limitations noticed in cloud computing 

 "What happens if the cloud fails?" This is no idle question; a recent Amazon.com Elastic Compute Cloud outage automatically brought down a half-dozen name-brand services, including Reddit and FourSquare. The bad press appeared on mass-media outlets including CNN and The Economist magazine. Many Web 2.0 companies have decided to live with apparently random downtime for apparently random intervals; will your company be one of them?
You'll also want to worry about backups. What happens if the cloud service fails and restores from a backup that is an hour old? A day?  A week? What if some of the data is just “lost”? Who owns it? How much risk exposure will your company take on, and how can you mitigate that risk? In addition to reliability, cloud computing suffers from another challenge in security. True "cloud computing" generally involves renting servers from some outsourced provider. That means migrating your data to the provider, which can involve questions of trust, security, and, in some cases, federal regulation. Some of these are compliance issues, some legal, but a good tester who can analyze and communicate risks could be invaluable to this process.
 Conclusion:
Cloud Computing is a term that doesn’t describe a single thing – rather it is a general term that sits over a variety of services from Infrastructure as a Service at the base, through Platform as a Service as a development tool and through to Software as a Service replacing on-premise applications. For a better cloud testing experience, test team should adopt a robust strategy which caters to their business needs. Cloud computing is growing because of its scalability, availability, robustness and the lower cost for service that attracts small medium business companies to a great extent. Hybrid cloud can be deployed together to leverage the best of both cloud computing which helps organization keep secured data in the private cloud and other data’s in public cloud. Cloud Computing is a rapidly accelerating revolution within IT and will become the default method of IT delivery moving into the future – organizations would be advised to consider their approach towards beginning a move to the clouds sooner, rather than later.
References










Thursday, February 27, 2014

The Peter Principle

I was reading this1 article on HBR.org and got curious about what is Peter Principle
Here are some of my learning’s from reading about The Peter Principle2

The Peter Principle is the principle that "in a hierarchy every employee tends to rise to their level of incompetence".
It was formulated by Dr. Laurence J. Peter and Raymond Hull in their 1969 book The Peter Principle, a humorous treatise which also introduced the "salutary science of hierarchiology", "inadvertently founded" by Peter. It holds that in a hierarchy, members are promoted so long as they work competently. Sooner or later they are promoted to a position at which they are no longer competent (their "level of incompetence"), and there they remain, being unable to earn further promotions.
Peter's Corollary states that "in time, every post tends to be occupied by an employee who is incompetent to carry out their duties" and adds that "work is accomplished by those employees who have not yet reached their level of incompetence". Managing upward is the concept of a subordinate finding ways to subtly "manage" superiors in order to limit the damage that they end up doing.


In most companies, team members are rewarded for their high performance with a promotion, but if they under-perform in the new role, they are rarely demoted. Instead, companies try more training, smaller teams, or hiring assistant managers to help—all of these in order to avoid facing the painful admission that the promotion wasn’t really the best decision. Peter first proposed this theory in the 1960s mostly as satire, but more recently researchers have begun to test it scientifically.  In a statistical model of organizations that tested the traditional promotion strategy (Peter Principle) against randomly handed out promotions, researchers found not only that the Peter Principle dilemma occurred. It was practically inevitable.






Collection4: Charlie Daniel Editorial Cartoon Collection, Other No. (MS.3526)
Publisher: The University of Tennessee Libraries, Knoxville
Identifier: daniel_Causes_0172
Rights Statement: The copyright interests in this collection remain with the creator. For more information contact the Special Collections Library.



Jeffrey Meyers in his blog5 (How to Prevent Your Talent From Falling Victim to The Peter Principle) thinks,
 There are two situations in which The Peter Principle most often emerges:

1. Being promoted to a manager from a position such as top-producing sales person or brilliant engineer
2. Transitioning from individual contributor to a team leader or manager


Peter Principle fits aptly to above situations due to following:
·         Top performers lack the necessary skills (or potential to develop them) to be promoted.
·         Individual contributors lack the mindset to change from a “me” to “us.”
There are methods that organizations can use to mitigate the risk associated with the Peter Principle:
  • Refrain from promoting workers based on their current performance without proof of their abilities to succeed in the desired role. Ensure that the person has the desire and inclination to be a leader
  • Don’t assume that everyone knows how to lead. Provide in-service training for the desired roles for those being considered for promotion.
  • Provide a parallel career path for good technical staff, possibly with the offer of additional pay, perks or recognition without requiring promotion to management.
  • Implement an Up or out approach as authorized by the Defense Officer Personnel Management Act for the United States Armed Forces and by manning control policies within the British Army, in which personnel who are not promoted above certain ranks within the fixed number of years are deemed to lack the necessary competence and are likely to be dismissed. Some larger businesses, notably major international management consultancies/accountancy firms including McKinsey, BCG, and Bain use a similar method, or the 'vitality curve' or 'rank and yank' used by GE where employees who are ranked in the bottom 5-10% on performance are likely to be fired.
                                
The Peter Principle isn't a life sentence, it's a warning to pursue positions you're good at and engaged in...not just ones that move you "up."

The Peter Principle is more than just a satirical comment on large bureaucracies or a strange organizational phenomenon. It’s a symptom of a culture that over-values titles and under-values being connected to the work you’re best at. That culture drives us away from the roles in which we’d thrive all for the promise of a better-looking business card. We’re subtly influenced to believe that more responsibility, bigger offices, and better sounding titles are always better.

The truth is, working on projects you have the potential to thrive at is better than any title.

Reference and Credits