Showing posts with label test scripts. Show all posts
Showing posts with label test scripts. Show all posts

Tuesday, January 20, 2009

Benefits of Automating Software Processes

Contributed by Marcus Tettmar

Perhaps the most obvious reason for automating software is to speed up a process and remove mundane, repetitive manual tasks. Software automation therefore saves time and resources, which equates to cost savings. Examples of this abound. But in this article I'd like to talk about some other good reasons for automating software, beyond the obvious benefits of saving time and money.

One consequence of software automation is an improved understanding of the software's interface. One of the best ways to learn to use a software product fully is to try to automate it. Testers and automation engineers have to learn the software's interface really well, possibly better than the people who wrote it. The developers may well know the algorithms better than anyone else, but it is the person automating it who knows the ins and outs, pitfalls, and quirks of the interface.

We all know how badly designed some Windows programs are. And in these days of fancy hi-res graphics and snazzy toolbar buttons, it's easy for the designers to forget about shortcut keys and keyboard navigation. The most productive way to use a PC is to forget the mouse and learn the keyboard shortcuts. You can get things done much more quickly. Yet even the most experienced Windows users don't know half the keyboard shortcuts that exist in Windows. For tips on keyboard navigation in Windows, click here.

Knowing these shortcuts makes automation so much easier and more reliable. Automating an application by sending mouse events and mouse clicks is unreliable and depends on the screen resolution never changing. Although you can use relative mouse coordinates, sooner or later something is going to change and the button you want to click is not in the place it was when the script was created.

The automation/test engineer is the one who figures out the keyboard shortcuts and finds the simplest, most reliable way of navigating an application. People who automate applications regularly have a good understanding of the different ways to move around Windows and Windows applications. Automated Software Testing can help find issues in the interface just from the process of building the automated test, even before the test script has been run. Building an automation routine for an application will help you find those missing or duplicated shortcut keys and other objects that can't be driven by the keyboard.

Automation script developers spend so much time fiddling with the software's interface that they will often become more knowledgeable than the "power-users". Testers also have the great advantage of being allowed to try unusual scenarios that developers never think about or are too busy to try. They are allowed to break things!

So it goes both ways. Find out the Windows keyboard shortcuts and the hot-keys for the application you're scripting and you can create a better script. Build an application with good keyboard support and your application can be automated more easily. If it can be automated easily it will be easy to use!

Software automation can also lead to improved documentation. Automation scripts are the ultimate way to document a process. A script that automates a process describes how to carry it out properly. Businesses need to document all their manual processes so that other people can carry out the task. By scripting the process, it is being described at the same time. As well as saving time by automating it, it is also now easy for someone else to see how the process is carried out.

Finally, an important benefit of software automation is in contingency planning. Contingency goes hand in hand with documentation. If only one person in the organisation knows how to carry out a task, there will be problems if and when that person is sick, on vacation, or leaves the company. Not all absences are planned. By documenting a process, the business is ensuring that someone else can carry it out should the usual task owner be unavailable.

Automation takes that one stage further. If the process is scripted and automated, it is easy for someone else to take on ownership of the task in the future. The task will continue to run and the script itself describes how the task works.

Therefore, software process automation not only allows businesses to save considerable time and human resource, but it can also improve documentation and contingency; aid in software development and testing; and help build better user interfaces.

About the Author:

Marcus Tettmar is founder and CEO of MJT Net Ltd, specialists in windows automation and publishers of Macro Scheduler, the leading automation tool for Microsoft Windows; and WebRecorder for Web Application Automation.

For more information on Software Testing visit http://www.qa-software-testing.com


Tuesday, November 4, 2008

Automating Website Functional Testing

contributed by Umair Khan; edited by Doug Anderson

You just finished building your company's website. You have tested it yourself and had other company employees test it. The website now goes live. A few weeks later you start getting emails from irate customers who complain that they are unable to place their orders because certain steps in the "Buy Now" process give errors. You quickly fix the problem. A few days later you get complaints about some other issue and you again react quickly to fix the website. This continues for a few months until the complaints finally halt and things stabilize.

At this point, you make some enhancements to your website. A few days later, a customer e-mail alerts you to the fact that, in the process of making this enhancement, you "broke" something else on the website. Again you spend time to find and fix the problem but by now you are perplexed and not a little frustrated.

These issues have cost you many customers in the last few months and potentially spread ill will across the broader customer community. It seems to you that the only way to have detected these issues before they went "live" was to have employed a large army of software testers, something your company is unable to afford.

Enter automated software testing. While nothing can replace good human testers, broad test coverage requires some degree of software automation for it to be economically feasible. Automated testing tools can provide a huge workforce multiplier and do a very good job complimenting human testers.

Every change to your website no matter how small requires thorough testing to ensure that nothing else was affected. This becomes very time consuming very quickly due to the large number of possible cases to test. A strategy whereby tests are automated using software becomes an economic necessity.

Regression Testing

There are two classes of automated testing tools. The first kind, functional and regression testing tools, helps to make sure that the website behaves as it should: for example if a customer clicks on button X, page Y is displayed without errors. Functional and regression testing tools are able to automate a large number of scenarios to ensure that your website works as intended.

Load Testing

The second type, load testing tools, gauge how well your website performs when subjected to a large stress, such as a large number of simultaneous users. In this article, I will be discussing functional testing only, leaving load testing for a separate article.

Functional Testing Concepts

I will now give you an overview of the basic characteristics of functional testing. Before you can begin any kind of functional test automation, you will need to identify the test scenarios you wish to automate. Once this is done, you will need to generate test scripts that cover these scenarios.

The reason you create a script is so that the same test can be repeated later, in exactly the same process. Scripts may be written by hand or automatically recorded by a software program that captures keystrokes and mouse movements around the screen.

An automated functional testing tool will typically record user interactions with a website. As you perform various operations on your website or application, the tool records every step. When you finish recording, it generates an automated script from your interactions with your website. Alternatively you could use the tool to construct the script by hand. Typically testers tend to do a combination of the two. They will use the recorder to generate the basic framework of their scripts and then tweak the scripts by hand to incorporate special cases.

Scripts can be graphical and/or text based in nature. A good functional testing tool does not require users to have a programming background. Users not proficient in programming will work predominantly with graphical scripts. In most tools, graphical scripts will typically show all interactions in a tree structure and users can edit any node of the tree to modify the script. Some users, however, who have programming backgrounds, may wish to program their scripts. These users will typically work with a text script written in a standard language such as JavaScript or VBScript.

Once you have generated your script, you will need to insert checks in your scripts to test if your website is functioning correctly. Such checks are usually called checkpoints. A checkpoint verifies that values of a property obtained when testing the website match expected values. Checkpoints enable you to set the criteria for comparing expected values with obtained values. The expected value of a property is derived from recording interactions with the web site. It is viewed and modified from checkpoints. The current value is retrieved during replay (i.e. during the execution of the test case).

There are many different kinds of checkpoints. A page checkpoint verifies the source of a page or frame as well as its statistical properties. You can check for broken links, verify link URLs, image sources, the hierarchy of HTML tags or even the entire HTML source of the Web page or frame. You can also set thresholds for the loading time of a page. A text checkpoint verifies that a given text is displayed or is not displayed in a specified area on a web page. A web object checkpoint verifies the properties of a web object e.g. the value of an HTML INPUT field. A database checkpoint verifies the contents of a database used by your website.

When you replay a test script, the testing tool will open the recorded application and perform the recorded steps in the same sequence they were specified in the script. As it replays the script, it will also run through all the checkpoints you have inserted into the script. In addition, you can test your application's behaviour with varying data inputs. For example, you can try to submit a page after entering different values in the edit box of a web page. At the end of the replay, a detailed report is typically be generated.

Functional test automation allows you to automate the repetitive testing of a large number of scenarios across your website. Functional testing tools are an important weapon in your development arsenal whose use provides a huge productivity gain and allows for small testing groups to accomplish significantly more work. There is a very strong economic case for the use of Functional Testing Tools as part of the development and deployment cycle of a website.


About the Author:

Umair Khan is Founder and Chairman of Verisium, Inc., a provider of products for automated functional and regression testing, load testing, bug tracking, and test and requirement management.

Verisium is the maker of vTest, an automated functional and regression testing tool for web applications.

For more information on Software Testing visit http://www.qa-software-testing.com