Pages

Monday, April 22, 2013

You Are Not Done Yet - checklist


You Are Not Done Yet- checklist

Pick something. Anything. A feature in your favorite software application, your favorite toy, your favorite piece of furniture. Now start brainstorming things you could do to test it. Think of as many different things to do to that object as you can. Come back and continue reading when you’re done.

 

What’s that? You’re back already? There are test cases you haven’t thought of, I guarantee it. How do I know? Because for even the tiniest bit of something – the Find dialog box in your web browser, say, there are billions of possible test cases. Some of them are likely to find interesting issues and some of them aren’t. Some of them we execute because we want to confirm that certain functionality works correctly. These latter cases are the basis of my You Are Not Done Yet list.

 

This list is large and can be overwhelming at first. Fear not. You have probably already covered many of these cases. Others won’t be applicable to your situation. Some may be applicable yet you will decide to pass on them for some reason or other. Verifying you have executed each of these test cases is not the point of the list. The point is to get you thinking about all of the testing you have and have not done and point out areas you meant to cover which you haven’t yet.

 

So don’t quail at the thought of all this testing you haven’t done yet. Instead, customize this list to your context. Scratch off items which do not apply. Use the list as a launch point for finding items not on it which do apply. Use it to organize your testing before you start. Use it as a last-minute checklist before you finish. How you use it is not nearly as important as that you use it in the first place.

 

Input Methods

You are not done testing yet unless...you have tested the following input methods:

Keyboard. Duh, right? But it's important to remember that testing keyboard input doesn't just mean verifying you can type into text boxes. Scour your application for every different control that accepts text - not just as a value, but also shortcut key sequences and navigation. (Yes, there's some overlap here with Dialog Box Navigation and Accessibility.) If your application uses any custom controls, pay them especial attention as they are likely to use custom keystroke processing. Make those mouse-hating keyboard wizards happy!

 

Mouse. Duh again, but again it's so obvious that it's easy to miss. And again, pay especial attention custom controls as they are likely to do custom mouse handling.

 

Pen input. Depending on your target platform(s), this could mean pen input direct to your application, filtered through the operating system (e.g., the Tablet Input Panel on Microsoft Windows), and/or filtered through third-party input panels. Each input source has its own quirks that just might collide with your application's own quirks.

 

Speech input. Depending on your target platform(s), this could mean speech input direct to your application, filtered through the operating system, and/or filtered through third-party speech processors.

 

Foreign language input. On Microsoft Windows this usually means an Input Method Editor (IME), either the one that comes with the operating system or one provided by a third party. These can be troublesome even for applications that do not do any custom keystroke processing. For example, a Japanese-language input processor likely traps all keystrokes, combines multiple keystrokes into a single Japanese character, and then sends that single character on to the application. Shortcut key sequences should bypass this extra layer of processing, but oftentimes they don't. (Note: turning off the IME is one solution to this quandary, but it is almost never the right answer!)

 

Assistive input devices such as puff tubes. The operating system generally abstracts these into a standard keyboard or mouse, but they may introduce unusual conditions your application needs to handle, such as extra-long waits between keystrokes.

 

Random other input sources. For example, I have seen games where you control the action by placing one or more sensors on your finger(s) and then thinking what you want the program to do. Some of these devices simply show up as a joystick or mouse. What happens if someone tries to use such a device in your application?

 

Multiple keyboards and/or mice. Microsoft Windows supports multiple mice and keyboards simultaneously. You only ever get a single insertion point and mouse pointer, so you don't have to figure out how to handle multiple input streams. You may, however, need to deal with large jumps in e.g., mouse coordinates. Oh the testing fun!

 

Files

You are not done testing unless...you have looked at each and every file that makes up your application, for they are chock full of information which is often ignored. And we all know what happens when things are ignored - bugs appear! I remember one bug bash where a developer chalked up over fifty bugs simply by going through this list!

 

 Verify the version number of each file is correct.

 Verify the assembly version number of each managed assembly is correct. Generally the assembly version number and the file version number should match. They are specified via different mechanisms, however, and must explicitly be kept in sync.

 Verify the copyright information for each file is correct.

 Verify each file is digitally signed - or not, as appropriate. Verify its digital signature is correct.

 Verify each file is installed to the correct location. (Also see the Setup YANDY.)

 Verify you know the dependencies of each file. Verify each dependency is either installed by your setup or guaranteed to be on the machine.

 Check what happens when each file - and each of its dependencies - is missing.

 Check each file for recognizable words and phrases. Determine whether each word or phrase you find is something you are comfortable with your customers seeing.

 

Filenames

 

You are not done testing yet unless...you have tested the following test cases for filenames:

 Single character filenames

 Short filenames

 Long filenames

 Extra-long filenames

 Filenames using text test cases

 Filenames containing reserved words

 Just the filename (file.ext)

 The complete path to the file (c:\My\Directory\Structure\file.ext)

 A relative path into a subfolder (Sub\Folder\file.ext)

 A relative path into the current folder (.\file.ext)

 A relative path into a parent folder (..\Parent\file.ext)

 A deeply nested path (Some\Very\Very\Very\Very\Very\Deeply\Nested\File\That\You\Will\Never\Find\Again\file.ext)

 UNC network paths (\\server\share\Parent\file.ext)

 Mapped drive network paths (Z:\Parent\file.ext)

 

Filenames are interesting creatures and a common source of bugs. Microsoft Windows applications that don't guard against reserved words set themselves up for a Denial Of Service attack. Applications on any operating system that allow any old file to be opened/saved/modified leave a gaping hole onto "secured" files. Some users stuff every document they've ever created into their user folder. Other users create a unique folder for each document. Certain characters are allowed in filenames that aren't allowed elsewhere, and vice versa. Spending some focused time in this area will be well worth your while.

Filename Invalid Characters and Error Cases

You are not done testing yet unless...you have checked for invalid characters in filenames, and for reserved filenames. Operating systems tend to get grumpy if you try to use wildcards (e.g., '*') in filenames. They may also treat certain filenames specially. For example, Microsoft Windows provides a single API for creating/opening files, communication ports, and various other cross-process communication mechanisms. Well-known communication ports (e.g., COM1) are addressed by "filename" just as though they were a file - kinda handy, but it means that you can't use "COM1" for a physical file on disk.

Testing for this is easy: brainstorm a list of interesting test cases, then slap each one into each of your application's dialog boxes, command line arguments, and APIs that take a filename. Illegal characters will probably throw an error, but trying to open a reserved filename is likely to hang your app.

See the MSDN topic "Naming a file" [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp] for the full skinny on reserved characters and filenames on Microsoft operating systems.

 


File Operations

You are not done testing unless...you have thoroughly tested your application's Open, Save, and Save As functionality. I don't know about you, but I get grumpy when my work disappears into thin air! For many applications, if data cannot be saved and later regurgitated with full fidelity, the application may as well not exist. Thus it is important to verify the correct thing happens under the following conditions:

Open each supported file type and version and Save As each supported file type and version. Especially important is to open from and save as the previous version of your native format. Customers tend to get grumpy if upgrading to a new version means they can no longer open old documents! And they tend to not upgrade if they do not have a simple way to share documents created in the new version of your application with those poor souls still languishing on the old version.

 

 Open each supported file type and version and Save. If the file type and version can be selected during a Save operation (as opposed to a Save As operation), Save to each supported file type and version. More usually, Save saves to the current version only.

 

 Roundtrip from each supported version to the current version and back to the previous version. Open the resulting file in that version of your application. Does it open correctly? Are new features correctly converted to something the previous version understands? How are embedded objects of previous versions handled?

 

 Open files saved in the current version of your application in previous versions of your application. If the document opens, how are features added in the new version handled? If the document does not open, is the resulting error message clear and understandable?

 

 Open from and Save and Save As to different file systems (e.g., FAT and NTFS) and protocols (e.g., local disk, UNC network share, http://). The operating system generally hides any differences between types of file systems; your application probably has different code paths for different protocols however.

 

 Open, Save, and Save As via the following mechanisms (as appropriate):

o Menu item

o Toolbar item

o Hot key (e.g. Control+S for Save)

o Most Recently Used list

o Microsoft SharePoint document library

o Context menu(s)

o The application’s Most Recently Used list

o The operating system’s Most Recently Used list

o Drag-and-drop from the file system explorer

o Drag-and-drop from your desktop

o Drag-and-drop from another application

o Command line

o Double-click a shortcut on your desktop

o Double-click a shortcut in an email or other document

o Embedded object

 

  Open from and Save and Save As to the following locations:

o Writable files

o Read-only files

o Files to which you do not have access (e.g., files whose security is set such that you cannot access them)

o Writable folders

o Read-only folders

o Folders to which you do not have access

o Floppy drive

o Hard drive

o Removable drive

o USB drive

o CD-ROM

o CD-RW

o DVD-ROM

o DVD-RW

 

   Open from and Save and Save As to various types and speeds of network connections. Dial-up and even broadband has different characteristics than that blazing fast one hundred gigabyte network your office provides!

 Open files created on (and Save and Save As to as appropriate):

o A different operating system

o An OS using a different system locale

o An OS using a different user locale

o A different language version of your application

 Open from and Save and Save and Save As to filenames containing

o The Text Entry Field YANDY list, as appropriate

o The Filenames YANDY list, as appropriate

o The Invalid Filenames YANDY list

o Spaces

 

 Cause the following to occur during Open, Save, and Save As operations:

o Drop all network connections

o Fail over to a different network connection

o Reboot the application

o Reboot the machine

o Sleep the machine

o Hibernate the machine

 

 Put AutoSave through its paces. What happens when you AutoSave every zero minutes? Every minute? With a very big document? If the AutoSave timer is per document, what happens when multiple AutoSaves kick off simultaneously, or while another AutoSave is in progress? Does file recovery from AutoSave work as you expect? What happens if the application crashes during an AutoSave? During recovery of an AutoSaved document?

 

 Save and Save as in the following conditions:

o No documents are dirty

o One document is dirty

o Multiple documents are dirty and the user chooses to save all of them

o Multiple documents are dirty and the user chooses to save none of them

o Multiple documents are dirty and the user chooses to save only some of them

 

 

 

 

 

Monday, March 25, 2013

Difference between client-server testing and web based testing and what are things that we need to test in such applications?



Projects are broadly divided into two types of:
  • 2 tier applications
  • 3 tier applications
CLIENT / SERVER TESTING
This type of testing usually done for 2 tier applications (usually developed for LAN)
Here we will be having front-end and backend.
The application launched on front-end will be having forms and reports which will be monitoring and manipulating data
E.g: applications developed in VB, VC++, Core Java, C, C++, D2K, PowerBuilder etc.,
The backend for these applications would be MS Access, SQL Server, Oracle, Sybase, Mysql, Quadbase
The tests performed on these types of applications would be
- User interface testing
- Manual support testing
- Functionality testing
- Compatibility testing & configuration testing
- Intersystem testing
WEB TESTING
This is done for 3 tier applications (developed for Internet / intranet / xtranet)
Here we will be having Browser, web server and DB server.
The applications accessible in browser would be developed in HTML, DHTML, XML, JavaScript etc. (We can monitor through these applications)
Applications for the web server would be developed in Java, ASP, JSP, VBScript, JavaScript, Perl, Cold Fusion, PHP etc. (All the manipulations are done on the web server with the help of these programs developed)
The DBserver would be having oracle, sql server, sybase, mysql etc. (All data is stored in the database available on the DB server)
The tests performed on these types of applications would be
- User interface testing
- Functionality testing
- Security testing
- Browser compatibility testing
- Load / stress testing
- Interoperability testing/intersystem testing
- Storage and data volume testing
A web-application is a three-tier application.
This has a browser (monitors data) [monitoring is done using html, dhtml, xml, javascript]-> webserver (manipulates data) [manipulations are done using programming languages or scripts like adv java, asp, jsp, vbscript, javascript, perl, coldfusion, php] -> database server (stores data) [data storage and retrieval is done using databases like oracle, sql server, sybase, mysql].
The types of tests, which can be applied on this type of applications, are:
1. User interface testing for validation & user friendliness
2. Functionality testing to validate behaviors, i/p, error handling, o/p, manipulations, services levels, order of functionality, links, content of web page & backend coverage’s
3. Security testing
4. Browser compatibility
5. Load / stress testing
6. Interoperability testing
7. Storage & data volume testing
A client-server application is a two tier application.
This has forms & reporting at front-end (monitoring & manipulations are done) [using vb, vc++, core java, c, c++, d2k, power builder etc.,] -> database server at the backend [data storage & retrieval) [using ms access, sql server, oracle, sybase, mysql, quadbase etc.,]
The tests performed on these applications would be
1. User interface testing
2. Manual support testing
3. Functionality testing
4. Compatibility testing
5. Intersystem testing
Some more points to clear the difference between client server, web and desktop applications:
Desktop application:
1. Application runs in single memory (Front end and Back end in one place)
2. Single user only
Client/Server application:
1. Application runs in two or more machines
2. Application is a menu-driven
3. Connected mode (connection exists always until logout)
4. Limited number of users
5. Less number of network issues when compared to web app.
Web application:
1. Application runs in two or more machines
2. URL-driven
3. Disconnected mode (state less)
4. Unlimited number of users
5. Many issues like hardware compatibility, browser compatibility, version compatibility, security issues, performance issues etc.
As per difference in both the applications come where, how to access the resources. In client server once connection is made it will be in state on connected, whereas in case of web testing http protocol is stateless, then there comes logic of cookies, which is not in client server.
For client server application users are well known, whereas for web application any user can login and access the content, he/she will use it as per his intentions.
So, there are always issues of security and compatibility for web application.

Website Cookie Testing



We will first focus on what exactly cookies are and how they work. It would be easy for you to understand the test cases for testing cookies when you have clear understanding of how cookies work? How cookies stored on hard drive? And how can we edit cookie settings?
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. Sometime 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 last 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 Mozilla browser, click on Tools->Options->Privacy and then “Show cookies” button.

How cookies are stored?
Let’s 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 cannot 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:
Sometimes 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.

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 behaviour 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: Sometimes 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 says 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.