Posted by Picasa

A Tester’s perspective on agile projects

Agile is no longer a buzzword or an unknown territory in the industry. Agile has come forward leaps and bounds since last few years and has seen a great transition from a newbie to a widely accepted methodology.

Testing on agile project was a paradigm shift for the traditional testing roles. It needed a change in tester’s attitude from a laid back relay race oriented approach to an upfront involved role. No longer had QAs needed to get something over the line to know the quality, as approach was rather to do the things right first time. But it’s easier said than done, how does it happen in reality? Does it actually happen?

Agile is a philosophy which believes in delivering constant value to customers incrementally and frequently, which is based on simple values of communication and feedback. These two ingredients are the ingredients of a successful agile recipe.

A tester has an important role to play in agile projects throughout different phase of iterations. Iteration is generally a two week long activity where small requirements are analysed, coded and tested.

What QAs needs to do? I am outlining few of the basic QA activities in agile projects. Let’s simply break the QA activities in three phases in agile projects. However, this is no golden rule and it can be flexible according to the project situation. Agile QAs role is not limited to set of pre defined processes, as the methodology they are expected to play an agile role as per the situation.

Pre iteration : This is the time where requirements are analysed in detailed by the BAs and acceptance criteria are detailed out for that story. As QAs are immediate consumers of those requirements, so it is really important to verify these requirements early and often.

Story verification : Agile testing is all about giving feedback early, not necessarily only by testing the requirements, but doing requirements testing early on. What should one be focusing on while doing requirements testing?

Looking at requirements for Clarity and Testability - QAs really need to look at the requirement / stories upfront to figure out that requirement are unambiguous and testable.

Unambiguous- I think unambiguous in agile has little different context compared to typical waterfall project.

- Requirement should be small enough to make sense in the context.

- Acceptance criteria (Stories are generally broken in to acceptance criteria) should not be duplicate or overlapping from different stories.

However, doing that can be really difficult and can only be achieved with really good communication between Dev/BA/QA.

Testable: Testability aspect of the story requires QA to scan through the story to see what needs to be done to test the story. These factors can generally be.

- Finding hidden requirements

- Environment

- Test data

- Dependency on other requirement.

Getting these details early helps the story to be prioritised accordingly in the backlog, and allows smooth execution of the story in the iteration.

QAs also do participate in the iteration planning meeting to help estimating and giving testing perspective to the team to come up with developer estimate. QAs have big role to play in the iteration planning, as some of the implicit requirements gets escalated by

QAs.

a) QA Activities In The Iteration

Once QAs are happy with the acceptance criteria of the story they can work towards defining the acceptance tests for the story. Acceptance tests are requirements in terms of a test, so that it can be executed before hand to know what is expected out of requirements. These acceptance tests are generally automated and used by developers to drive development, Acceptance tests should not be covering too many corner case scenarios as this would create unnecessary delay in getting the story done by the developers and may end up in producing too many similar automated tests.

People often fail to understand that acceptance testing in agile projects is different from traditional projects, as in agile projects it happens before the software is delivered unlike traditional project where it happens at end of the software lifecycle. In agile projects acceptance tests are generally automated so that it can be run as regression tests.

Automation testing is really important for any agile project as frequent builds requires a short feedback cycle hence regression testing needs to be quick and accurate. Automation testing is different from traditional automation testing. In agile projects automation testing is practised by all levels be it Developers, QAs or BAs. It does not necessarily mean that everyone needs to be writing the test code. Involvement from everyone on automation testing increases the relevance of the tests and often helps in finding and implementing the right tests.

It’s always been debatable as who owns the automation tests in agile projects? And for me it’s more of a responsibility then a role. In my experience most effective automation tests are achieved when Dev/QAs work together on it.

Use Automation to the advantage not for sake of doing it

Automation in agile is quiet controversial, as people try to automated everything and end up in a trap of having a long feedback cycle. Automation is meant for giving early feedback on the latest code, and automation should be limited to what is worth Automating and what is not. Every automation test written has a cost against it. The cost can be seen as

Cost of continuously running it (Increased feedback cycle). This cost of automation should be compared against cost of not running it. So, a question needs to be asked what if a test is not automated. What we going to lose, what would be the cost of fixing the stuff around the code for which we are losing the coverage? Is it cheaper to test manually?

And it might not be straight forward finding the worth of a test. It’s a contextual decision and also depends on size of the project and number of people involved in it. Simply putting this in other words mean Longer feedback cycle = More people losing time in getting instant feedback.

The typical QA activities in the iteration are to continuously measure the Quality of the software. QAs participate in the story handover to the developers to make them understand the testing requirements of the story, so that developers are enabled for Test Driven Development(TDD) for their code, which is a backbone for agile development practices. Also handing over the acceptance tests and making developers understand about the testability aspect of the story often catches the most common defects even before they are delivered to QAs. These activities require a high level of communication with the developer and BAs to clarify things on the fly and making sure we are building the product right first time. QAs may also have to pair with developers work together on the story or tests for the story to get the better understanding of the requirements.

QAs try to resolve as much issue before hand by actively participating in the overall process. It also becomes imperative that once the story is delivered, it is tested properly with all the aspects and ideally on a proper environment. Once the QAs are happy with the stories/requirements, they sign off that piece of work in a typical manufacturing way and hand it over for further process in the line which generally a showcase to the business.

As a QA it is also important to think beyond the written requirements and to have a desire to break attitude, and that’s where QAs do exploratory testing to execute ‘out of the box’ scenarios and also do negative testing to make sure software is really robust. Exploratory testing is a not at all about executing a pre defined testing scenarios, it is more of exploring of software beyond test cases but at the same time keeping the focus around some specific requirements.

I have tried covering most of the aspects of the basic QA activities of a QA in an agile project, however it is not limited to these activities and QAs should play more collaborative role as and when needed to be able to provide more visible and transparent feedback.

Why QTP is anti agile?

I want to make few points quickly in favor of that.

1) No support for programming languages like Java, .Net so that it allows it to be used as an acceptance testing tool.
2) VBSCript doesn’t help in everyone’s participation in the automation process, which is a key in agile projects.
3) No IDE support : QTP’s IDE is no way near Ideal hence makes maintainable a tough battle.
4) NO support for standard IDE like eclipse //
5) Multi browser support is limited/
6) Cant execute scripts on Linux and Mac platforms.
7) No continuous integration support, makes it rally tough to be used as an acceptance testing tool.
8) And last but not the least : Bloody expensive ;)

Twist GA V1.0 - First look

I had a first look at Twist V1.0 and it looks impressive and stable.

Here are my findings.

1) After I installed, I tried installing the subclipse (After little bitof  struggle, I figured out that you need to de select the 'Revision graph module' from the subclipse, and then you can move ahead successfully with the installation

2) As soon as I checked out my old Test suite ( created from Twist beta), it asked me to upgrade the project.  It has a backup projecy feature now. But I didn't do any backup and moved ahead with the upgrade, process was quick and smooth.

3) Executed one of the scenarios and worked smoothly.  so far so great.

One quick noticeable change is speed of execution of tests and it looks much faster and smoother in V1.0

4) The Tag management featured is quiet good, now I can manage tags of multiple tests in one go.

5) Now it preserves the test execution history if tests are executed from the editor, which was really lacking in the previous versions. A Great feature to have.

Features I  have not tried so far  :  Recording, Rules table and Context but I am sure it must be good.

But overall I am delighted.

Twist GA - Update

Twist is going GA on 27th April.

Waiting eagerly for this release as it should be a much stable release. More feedback , once I give it a go..

Modern day webapps - How to approach automation testing

Web apps are getting complex with browsers getting rich in behavior at the same time diverse from diff browsers. Technologies like Ajax and J-query has given a new dimensions to web apps. But at the same time automation testing getting difficult with rich javascript pages . 

How do one cope up with this. Multiple browser, different behaviors and rich client specific technologies to write and maintain tests.

Web automation needs to be maintainable and scalable, but how does one keep these factors in mind coping up with browser's incompatibility.


1) Select a tool which behaves with different browsers naively.
2) Write scripts driven by user behavior.
3) Avoid using browser specific object identification. (e.g> X- Path)
4) Keep scripts modular and small, so that its easy to write and maintain.
5) Don't hack the stuff to make something work (E.g> using javascript to do stuff - like cookie editing), I would rather avoid doing that, as brittle scripts may lead to serious disaster, especially in agile environment.




Selenium Vs Webdriver

WebDriver is a java based libraries to write automation tests for web applications.

This an awesome driver to test application for various reasons. This is also a better alternative for selenium. Webdriver works on the Principal of talking to browser naively, unlike selenium which works through proxy using javascript. 

One thing is obvious immediately is 'speed', webdriver tests run much faster then selenium, reason explained above.


Selenium                                                   WebDriver

Works on proxy                                       Works natively with Browser

Supports Major browsers                       Supports IE, Firefox , HtmlUunit and Iphone

API  is quiet complex                               Simple API

Supports multiple language                     Only Java at the moment
to write tests

  -                                                                    Supports HtmlUnit driver to run tests faster
   
Webdriver is going to become Selenium 2.0 eventually. I personally think, webdriver is next big thing in web functional testing after selenium.

Thanks to Simon Stewart for this awesome tool.






Selenium Interview - A basic guide

One of my friend recently had to attend an interview for a company for a selenium - tester job profile. Then he asked me, what should I prepare for? Then I thought of putting together this post, as selenium is now an industry accepted tool.

Simple explanations

What is Selenium  ?

- Its a web testing tool.

How it works?

It works through a proxy, using javascript to driver the tests.

What browsers does it support?

Firefox - 3.0/2.0
IE         - 7/8
Safari

What programming languages can you use to write the tests?


LanguageSelenium IDESelenium Remote ControlSelenium Core
C#Generate codeLibrary ("driver") supportn/a
JavaGenerate codeLibrary ("driver") supportn/a
PerlGenerate codeLibrary ("driver") supportn/a
PHPGenerate codeLibrary ("driver") supportn/a
PythonGenerate codeLibrary ("driver") supportn/a
RubyGenerate codeLibrary ("driver") supportn/a


Preparing for Interview

Tips :

1) Understand the basics right :

-  Basics of Web testing
-  How selenium works?  -  http://seleniumhq.org/about/how.html

2) How selenium Indentifies web element on the page?

- By Id or Name or Using an Xpath

3) Different Flavours of selenium

- Selenium Core
- Selenium RC
- Selenium Grid

4) Selenium  - How to use IDE?


5) Is IDE good enough to automate your tests?


6) What are the practical issues, while using selenium?


7) Selenium Vs Other tools (Like QTP)


8) Multi browser testing with selenium (Or Selenium Grid)



Automation Testing - Traditional to Agile

I always wonder, how the face of automation testing has changed over the years.  Automation testing has always been perceived as post development, costly activity to be done by specialists.

Agile methodology has broken all the barriers/Myths of automation testing. From a heavy weight , System level , Regression oriented  process to Acceptance oriented, all level light weight process.

In traditional projects, automation is only used as regression testing tool, and always perceived as to be done after "Stabilisation of the product"

Automation in agile projects becomes inevitable as its a mean to reduce the feedback cycle. it reduced the regression cycle, and helps producing quality code with higher pace. it also helps system to be robust all the time.

Unlike traditional project automation, which is only participated by specialist, in agile projects automation is practiced at all levels (Unit, System, Integration) by all stake holders of the project in one form or another. 

In Agile methodology,  automation tests are treated and take care as part of the overall source code. It needs the same love and care as any other piece of code in the project.

Automation in agile project is not just about automating the test cases, but automation is any mean to convert manual process to reduce the time waste or to add value in overall process.


Testing - When, Where and How on agile projects....

I think this question haunts most of the agile QA's mind. I am going to wrote something in this post from my previous experience.

As agile is not a fixed set of processes, so its is imperative to be agile in testing as well. However, some practices help..but again everything is contextual.

1) Adding value early : Agile testing is all about giving feedback early, not necessarily only by testing the software, but in different ways as well.
  a) Looking at requirements for Clarity and Testability  - QAs really need to look at the requirement / stories upfront to figure out that requirement are  unambiguous and testable.

Unambiguous .  - I think unambiguous in agile has little different context compared to typical waterfall project.

- Requirement should be small enough to make sense in the context
- Acceptance criteria (Stories are generally broken in to acceptance criteria) should not be duplicate or overlapping from different stories.

However, doing that can be really difficult and can only be achieved with really good communication between Dev/BA/QA.

Testable : Testability aspect of the story requires QA to scan through the story to see what needs to be done to test the story. These factors can generally be.

- Finding hidden requirements
- Environment
- Test data
- Dependency on other requirement.

Getting these details early helps the story to be prioritised accordingly in the backlog, and allows smooth execution of the story in the iteration.


2) Use Automation to the advantage not for sake of doing it

Automation in agile is quiet controversial, as people try to automated everything and end up having a long feedback cycle.

Automation is meant for giving early feedback on the latest code, and automation should be limited to what is worth Automating and what is not.

Every automation test written has a cost against it. The cost can be seen as

Cost of continuously running it (Increased feedback cycle).  This cost should be compared against cost of not runing it. So, a question needs to be asked what if a test is not written? what we gonna lose, what would be the cost of fixing the stuff around the code for which we are losing the coverage?

And this might not be straight forward finding the worth of a test. Its a contextual decision and also depends on size of the project and number of people involved in it. 

Simply putting this in other words mean : 

Longer feedback cycle = More people losing time in getting instant feedback.


I will write posts on - How to write automated acceptance tests in my future posts.....

This post to be continued

 

Twist - Still waiting for GA

I am still waiting for Twist GA to continue my series on Twist features.


Till then I want to keep my mouth shut...


How much to test?

That's a question needs to be answered very early in any agile project. 

Testing costs time and money, and no doubts adds value. Then how do we get a balanced approach on testing the user stories..

These questions should be answered while writing automated test for Acceptance critera

1) Is it too low level of testing...?
  - Do I really need to check a particular link is present or not...?

2) Are there repeating tests with some diversity?

- Can it be compromised over quick turnaround of the build?

3) How do we mitigate the risk of writing less tests?

- Can we make tests precise ?
- Can we not automate unit level tests in Accpetance test.




To be continued...







Twist - Using other drivers

Twist can be used with other available drivers in Java for web .  W ehave recently tried using webdriver to migrate some of our tests and effort was painless. 


Twist allows injection of other drivers using spring. So, that means without changing the definition of the scenario the underlying code can be chaned.

Also, Selenium 2.0 is going to be webdriver primarily, so seems twist will be even powerful in coming days.

Using your customised messages in Twist assertions.

I am sure many of you would have felt the need of what I am going to write. Since, Twist uses Junit assertions methods for the assertions, so as it is dependent on Junit to pass on the error messages in case of failures.

Take an example where I am verifying a value of textbox name "Username" and use a Jnunit assertion like

assertEquals (Expected, seleneium.getText("Username"));

In case this step fails, it is going to show like ..

"Expected ['xyz'] but was ['yxz']", but this does not give me any information of the application context.

This becomes even more difficult, when we have a large test suite of big tests and looking at error message it is dificult to figure out, what failed exactly?

So, I would like to see an error message for the above example like -
"Username text expected [xyz], but was [yxz]", and this can be achieved by passing a context (String parameter), to the assertEquals method and then it will generate an error message with the context (Sring parameter). SO, I change the above bit of code to look like this....

assertEquals ("Username text", Expected, seleneium.getText("Username"));

And when this assertion fails, it will generate the error message in more meaning way, and also Twist HTML report will also change accordingly.

This is the simplest way we could do it so far, but I am sure Twist team is working on having its own assertion libraries and I am looking forward to that.

Project Migration in new Twist Beta

If you are using an older version of Twist Beta and want to migrate your test, you need not worry too much about it.

As soon as you open your project in the new Twist Beta, it will ask you to migrate the project. However, there is a manual option also available to migrate the project. (Right click on Twist project -> Migrate ).

It will update applicationcontext-suite.xml and twist.properties files, also it will add a folder names twist-conf with three configuration files in it.

New Twist Beta Update

We have upgraded ourselve to the new Twist Beta.

And this comes with some cool features.

- Inline Reporting

- Proxy settings

I have already spoken about this in my previous posts.



- Automatic variable assignment to an UI object while recording.


The way we have Incorporated the object repository concept in Twist by creating a single Java file to hold all the object information.

Rather then using object definitions directly in the script, which makes them brittle and hard to manage, we use the objects from the repository.  If something changes about that object, we know where exactly to find that object, and also that avoids making thousand changes if that particular object is being used quiet a lot.

And last not the least, recorder seems to be improved in the new Beta version and its really stable so far.

Twist - Bits - How to check selected value of a dropdown?

assertEquals(value, selenium.getSelectedLabel(locator));