Friday, 17 August 2012

Website Cookie Testing

What is Cookie?
Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve information from that machine. Generally cookie contains personalized user data or information that is used to communicate between different web pages.
Why Cookies are used?
Cookies are nothing but the user’s identity and used to track where the user navigated throughout the web site pages. The communication between web browser and web server is stateless.
For example if you are accessing domain http://www.example.com/1.html then web browser will simply query to example.com web server for the page 1.html. Next time if you type page as http://www.example.com/2.html then new request is send to example.com web server for sending 2.html page and web server don’t know anything about to whom the previous page 1.html served.
What if you want the previous history of this user communication with the web server? You need to maintain the user state and interaction between web browser and web server somewhere. This is where cookie comes into picture. Cookies serve the purpose of maintaining the user interactions with web server.
How cookies work?
The HTTP protocol used to exchange information files on the web is used to maintain the cookies. There are two types of HTTP protocol. Stateless HTTP and Stateful HTTP protocol. Stateless HTTP protocol does not keep any record of previously accessed web page history. While Stateful HTTP protocol do keep some history of previous web browser and web server interactions and this protocol is used by cookies to maintain the user interactions.
Whenever user visits the site or page that is using cookie, small code inside that HTML page (Generally a call to some language script to write the cookie like cookies in JAVAScript, PHP, Perl) writes a text file on users machine called cookie.
Here is one example of the code that is used to write cookie and can be placed inside any HTML page:
Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME;
When user visits the same page or domain later time this cookie is read from disk and used to identify the second visit of the same user on that domain. Expiration time is set while writing the cookie. This time is decided by the application that is going to use the cookie.
Generally two types of cookies are written on user machine.
1) Session cookies: This cookie is active till the browser that invoked the cookie is open. When we close the browser this session cookie gets deleted. Some time session of say 20 minutes can be set to expire the cookie.
2) Persistent cookies: The cookies that are written permanently on user machine and lasts for months or years.
Where cookies are stored?
When any web page application writes cookie it get saved in a text file on user hard disk drive. The path where the cookies get stored depends on the browser. Different browsers store cookie in different paths. E.g. Internet explorer store cookies on path “C:\Documents and Settings\Default User\Cookies”
Here the “Default User” can be replaced by the current user you logged in as. Like “Administrator”, or user name like “Vijay” etc.
The cookie path can be easily found by navigating through the browser options. In Mozilla Firefox browser you can even see the cookies in browser options itself. Open the Mozila browser, click on Tools->Options->Privacy and then “Show cookies” button.
How cookies are stored?
Lets take example of cookie written by rediff.com on Mozilla Firefox browser:
On Mozilla Firefox browser when you open the page rediff.com or login to your rediffmail account, a cookie will get written on your Hard disk. To view this cookie simply click on “Show cookies” button mentioned on above path. Click on Rediff.com site under this cookie list. You can see different cookies written by rediff domain with different names.
Site: Rediff.com Cookie name: RMID
Name: RMID (Name of the cookie)
Content: 1d11c8ec44bf49e0… (Encrypted content)
Domain: .rediff.com
Path: / (Any path after the domain name)
Send For: Any type of connection
Expires: Thursday, December 31, 2020 11:59:59 PM
Applications where cookies can be used:
1) To implement shopping cart:
Cookies are used for maintaining online ordering system. Cookies remember what user wants to buy. What if user adds some products in their shopping cart and if due to some reason user don’t want to buy those products this time and closes the browser window? When next time same user visits the purchase page he can see all the products he added in shopping cart in his last visit.
2) Personalized sites:
When user visits certain pages they are asked which pages they don’t want to visit or display. User options are get stored in cookie and till the user is online, those pages are not shown to him.
3) User tracking:
To track number of unique visitors online at particular time.
4) Marketing:
Some companies use cookies to display advertisements on user machines. Cookies control these advertisements. When and which advertisement should be shown? What is the interest of the user? Which keywords he searches on the site? All these things can be maintained using cookies.
5) User sessions:
Cookies can track user sessions to particular domain using user ID and password.
Drawbacks of cookies:
1) Even writing Cookie is a great way to maintain user interaction, if user has set browser options to warn before writing any cookie or disabled the cookies completely then site containing cookie will be completely disabled and can not perform any operation resulting in loss of site traffic.
2) Too many Cookies:
If you are writing too many cookies on every page navigation and if user has turned on option to warn before writing cookie, this could turn away user from your site.
3) Security issues:
Some times users personal information is stored in cookies and if someone hack the cookie then hacker can get access to your personal information. Even corrupted cookies can be read by different domains and lead to security issues.
4) Sensitive information:
Some sites may write and store your sensitive information in cookies, which should not be allowed due to privacy concerns.
This should be enough to know what cookies are. If you want more cookie info see Cookie Central page.
Some Major Test cases for web application cookie testing:
The first obvious test case is to test if your application is writing cookies properly on disk. You can use the Cookie Tester application also if you don’t have any web application to test but you want to understand the cookie concept for testing.
Test cases: 
1) As a Cookie privacy policy make sure from your design documents that no personal or sensitive data is stored in the cookie.
2) If you have no option than saving sensitive data in cookie make sure data stored in cookie is stored in encrypted format.
3) Make sure that there is no overuse of cookies on your site under test. Overuse of cookies will annoy users if browser is prompting for cookies more often and this could result in loss of site traffic and eventually loss of business.
4) Disable the cookies from your browser settings: If you are using cookies on your site, your sites major functionality will not work by disabling the cookies. Then try to access the web site under test. Navigate through the site. See if appropriate messages are displayed to user like “For smooth functioning of this site make sure that cookies are enabled on your browser”. There should not be any page crash due to disabling the cookies. (Please make sure that you close all browsers, delete all previously written cookies before performing this test)
5) Accepts/Reject some cookies: The best way to check web site functionality is, not to accept all cookies. If you are writing 10 cookies in your web application then randomly accept some cookies say accept 5 and reject 5 cookies. For executing this test case you can set browser options to prompt whenever cookie is being written to disk. On this prompt window you can either accept or reject cookie. Try to access major functionality of web site. See if pages are getting crashed or data is getting corrupted.
6) Delete cookie: Allow site to write the cookies and then close all browsers and manually delete all cookies for web site under test. Access the web pages and check the behavior of the pages.
7) Corrupt the cookies: Corrupting cookie is easy. You know where cookies are stored. Manually edit the cookie in notepad and change the parameters to some vague values. Like alter the cookie content, Name of the cookie or expiry date of the cookie and see the site functionality. In some cases corrupted cookies allow to read the data inside it for any other domain. This should not happen in case of your web site cookies. Note that the cookies written by one domain say rediff.com can’t be accessed by other domain say yahoo.com unless and until the cookies are corrupted and someone trying to hack the cookie data.
8 ) Checking the deletion of cookies from your web application page: Some times cookie written by domain say rediff.com may be deleted by same domain but by different page under that domain. This is the general case if you are testing some ‘action tracking’ web portal. Action tracking or purchase tracking pixel is placed on the action web page and when any action or purchase occurs by user the cookie written on disk get deleted to avoid multiple action logging from same cookie. Check if reaching to your action or purchase page deletes the cookie properly and no more invalid actions or purchase get logged from same user.
9) Cookie Testing on Multiple browsers: This is the important case to check if your web application page is writing the cookies properly on different browsers as intended and site works properly using these cookies. You can test your web application on Major used browsers like Internet explorer (Various versions), Mozilla Firefox, Netscape, Opera etc.
10) If your web application is using cookies to maintain the logging state of any user then log in to your web application using some username and password. In many cases you can see the logged in user ID parameter directly in browser address bar. Change this parameter to different value say if previous user ID is 100 then make it 101 and press enter. The proper access message should be displayed to user and user should not be able to see other users account.
These are some Major test cases to be considered while testing website cookies. You can write multiple test cases from these test cases by performing various combinations. If you have some different application scenario, you can mention your test cases in comments below.

Mobile Application Testing

Unique Challenges in Testing

Mobile business applications can be classified into standalone applications and enterprise applications. Standalone applications reside in the device and do not interface with external systems. Conversely, enterprise applications are built to perform resource-intensive transactions that are typical of corporate computing environments. Enterprise applications also interface with external systems through Wireless Application Protocol (WAP) or Hyper Text Transfer Protocol (HTTP).

The unique challenges in testing mobile applications arise from the diversity of the device environment, hardware and networking considerations, and Rapid Application Development (RAD) methodologies. These challenges are outlined below:

Diversity of the Device Environment
The realm of mobile computing is composed of various types of mobile devices and underlying software (hundreds of device types, more than 40 mobile browsers). Some of the unique challenges involved in mobile testing as a result of this condition are:

  • Rendering of images and positioning  of elements on the screen may be unsuitable in some devices due to the difference in display sizes across mobile devices and models. Exhaustive testing of user interfaces is necessary to ensure compatibility of the application.
  • Mobile devices have different  application runtimes. Binary Runtime Environment for Wireless (BREW), Java, and embedded visual basic runtime are just some of the runtimes commonly available in mobile devices. Applications should be tested exhaustively for the variations specific to runtime.

Hardware Configuration & Network-related Challenges

The mobile environment offers lesser memory and processing power for computing when compared with the traditional PC environment. Unlike the network landscape of the PC environment, the network landscape of a mobile device may have gateways (access points between the wireless internet and the cable internet). Some of the drawbacks of diverse hardware configurations and the network landscape of mobile devices are:

  • Limitations in processing speed and memory size of mobile devices lead to variations in performance of applications across different types of devices. Testing programs should ensure that the applications deliver optimum performance for all desired configurations of hardware.
  • Some devices communicate through WAP while some others use HTTP to communicate. Applications should be tested for their compatibility with WAP-enabled as well as HTTP-enabled devices.
  • Network latency (time taken for data transfer) will be unpredictable when applications communicate over network boundaries, leading to inconsistent data transfer speeds. Testing should measure the performance of applications for various network bandwidths.
  • Gateways in a wireless network may act as data optimizers that deliver content more suitable for specific devices. This data optimization process may result in decreased performance for heavy traffic. Testing should determine the network traffic level at which gateway capabilities will impact the performance of the mobile application.

Rapid Application Development (RAD) Methodologies


In order to deliver the benefits of faster time to market, RAD environments are used for mobile application development. Since the time taken for development is reduced by the introduction of RAD tools, builds will be available for testing much earlier. Therefore, a RAD methodology imposes an indirect pressure on testing teams to reduce the testing cycle time without compromising quality and coverage.

Mobile Application Testing


The critical factors that determine the success of a mobile testing program are:

  • Use of test automation
  • Use of emulators and actual devices
  • Testing for mobile environment and application complexity

In this section, we discuss these critical success factors and present our recommendations for mobile application testing.

Use of test automation


Testing of mobile applications is traditionally done by manual execution of test cases and visual verification of the results. However, it is an effort-intensive and time-consuming process. Automating the appropriate areas of a testing program can yield quantifiable benefits.

Use of emulators and actual devices

Emulators can be beneficial for testing features of the application that are device independent. However, actual devices should be used for validating the results.

Testing for mobile environment and application complexity

Due to diversity in mobile hardware and platforms, testing programs need to incorporate GUI and compatibility tests

Friday, 29 June 2012

Why backend testing is required?

Assume that you're thinking client-server or web. If you test the application on the front end only you can see if the data was stored and retrievd correctly. You can't see if the servers are in an error state or not. many server processes are monitored by another process. If they crash, they are restarted. You can't see that without looking at it.
The data may not be stored correctly either but the front end may have cached data lying around and it will use that instead. The least you should be doing is verifying the data as stored in the database.
It is easier to test data being transferred on the boundaries and see the results of those transactions when you can set the data in a driver.
Back-End testing : Basically the requirement of this testing depends on ur project. like Say if ur project is .Ticket booking system,Front end u will provided with an Interface , where u can book the ticket by giving the appropriate details ( Like Place to go, and Time when u wanna go etc..). It will have a Data storage system (Database or XL sheet etc) which is a Back end for storing details entered by the user.
After submitting the details ,U might have provided with a correct acknowledgement.But in back end , the details might not updated correctly in Database becoz of wrong logic development. Then that will cause a major problem.
and regarding Unit level testing and System testing Unit level testing is for testing the basic checks whether the application is working fyn with the basic requirements.This will be done by developers before delivering to the QA.In System testing , In addition to the unit checks ,u will be performing all the checks ( all possible integrated checks which required) .Basically this will be carried out by tester .Ever heard about divide and conquer tactic ? It is a same method applied in backend and frontend testing.
A good back end test will help minimize the burden of frontend test.
Another point is you can test the backend while develope the frontend. A true pararelism could be achived.
Backend testing has another problem which must addressed before front end could use it. The problem is concurency. Building a scenario to test concurency is formidable task.
A complex thing is hard to test. To create such scenarios will make you unsure which test you already done and which you haven't. What we need is an effective methods to test our application. The simplest method i know is using divide and conquer.

Saturday, 2 June 2012

Testing Cloud

Cloud Testing or Testing Cloud Services is like testing software. It comprises of test measures that are similar to what you are used to, like performance testing, testing functionality (such as testing APPS, web services and configurations), testing security and more. Other test measures are more explicit, like testing continuity. Also new test measures are introduced, like testing against laws and regulations. Important is that testing cloud services needs to start during the selection, since many risks are either covered or just introduced in that phase. Interesting is the necessity to keep testing even in the production phase, since there is no guarantee that what works today also works tomorrow... Many changes happen that are not under your control.

Testing Cloud is referring to USING cloud services FOR testing. For instance for renting infrastructure for test environments. Or outsource testing to the cloud (Testing as a Service).

how to make regression testing creative

a. If you have manual testcases identify an opensource or any other tool to automate those testcases
b. Identify new scenarios that will add value to test your product such as IT Standards, Usability, Security
c. Identify new envionments that your application needs to be run and prepare system testcases
d. Go through requirements and existing testcases and add new test techniques to your test conditions and improve the testcase
e. Incase of automation scripts enhance the scripts in terms of framework, areas of testing and defect capture

What is Recovery Testing

Usage
“Recovery is ability to restart the operation after integrity of application is lost.
" It includes reverting to a point where integrity of system is known , then reprocessing up until the point of failure.
" The time taken to recover depends upon :the number of restart points
volume of application
training and skill of people conducting recovery activities
tools available for recovery
Objectives
“To ensure operations can be continued after a disaster .
" Recovery testing verifies recovery process and effectiveness of recovery process.
" Adequate back up data is preserved and kept in secure location.
" Recovery procedures are documented.
" Recovery personnel have been assigned and trained.
" Recovery tools have been developed and are available.
How to Use
“Procedures , methods , tools and techniques are assessed to evaluate the adequacy.
" After system is developed a failure can be introduced in the system and check whether the system can recover.
" A simulated disaster is usually performed on one aspect of application system.
" When there are no. Of failures then instead of taking care of all recovery testing should be carried out for one segment and then another i.e. structured fashion.
Who uses it
“System Analysts
" Testing professionals
“management personnel.
When to use
“When user says that the continuity of the system is needed inorder for system to perform or function properly.
" User then should estimate the losses, time span to carry out recovery testing.
Examples
“Loss of communication , loss of database integrity.
" Evaluate adequacy of back up data.

when reopen bug be cancel bug

We can 'Reopen' a closed bug based on the following:

- If the bug is same as old
- If the environment to test/the URL is same
- If the steps to reproduce are exactly the same
- If the old bug does not have more threads and more screenshots
- If the bug is somewhat recent one(May be less than two or three months old)
- If the bug tracking tool is same

Disadvantage of opening the closed bugs:
- Person may forget to change the assignee name to the currently active person, as there are chances for a dev team member may not be in the current project/he may have left the organization
- If the version id/affects version is not marked for the current id, then that bug may be left unnoticed for the current sprint cycle

Note: If we are going to open a new bug, its better if we reference the old bug id in the new one.