Thursday, May 27, 2010

Black box testing design techniques

Black box testing is testing based upon requirement.In this we don't consider the internal logic structure.
For example, here in black box testing, if any input is passed into the system and if the result is what was expected, then the test is passed.

Following are the design techniques for black box tests:
1- Equivalence class partitioning
2- Boundary value analysis
3- decision tables
4- Orthogonal arrays.

Now we will cover one by one in detail.

1- Equivalence class partitioning:
This technique is based on mathematical set theory. When your input domain is too large
then you break down this domain into finite number of sub domains (or sets). Now when you test you software, every value in
these set will be treated as same value. So you can pick one value from each set and test you software. This way you are
able to test the large set of data with few number of test only.

So the motive behind using the techniques is clear and that is to reduce the number of test cases to save time and cost.

Example:
Suppose in a software there is a field which except numbers from 1-100. now the range 1-100 is called as partition which is
a valid partition. Other than this there are two more invalid partition and they are: <=0 and >=101 . Now we can choose one
value from each of these partitions.

Valid partition is (1,2,3...............98,99,100)
Invalid partition 1 is (0,-1,-2,-3......... so on)
Invalid partition2 is (101,102,103,......so on)

Further Equivalence partitioning is no stand alone method to determine test cases. It has to be supplemented by boundary
value analysis.


2- Boundary value analysis:
In this case, we use the term boundary conditions to identify the set of allowable or inputs,
for a particular function. Testing boundary conditions includes testing inputs that fall outside the boundaries.
The boundaries are the values on around of the beginning and end of the partitions.
Here in a valid partition the beginning value is 1 and end value is 100. so the testable values will be like 0,1,2 and 99,100,101.

so this is something the boundary values for X will be X-1, X and X+1.


3- decision tables:

This technique of decision tables can be used as a method to identify all possible inputs or combination of inputs
for a test case.
A decision table is typically divided into four quadrants, as shown below

----------------------------
=
Condition = Input values
=
----------------------------
=
Action = Output values
=
----------------------------

4- Orthogonal arrays:
This is also known as taguchi method.

Let me explain why this comes into picture. The equivalence class portioning and boundary value analysis allow u test only
single value at a time and after that decision table start to look at combination of variables. But here the combination
can becomes very large very quickly. Thus the question becomes: how do you limit the combination without compromising
the quality.
Now the orthogonal arrays technique addresses this problem. The use of this is to determine the number of experiments require
to find best solution to given design problem by testing many variables at once.

An orthogonal array is a subset of combination of values for variables such that for every pair of variables,
every pair of values occurs an equal number of times.As an example, consider a module of code that has
three decision statements where variables A, B, and C can be true (T) or false (F)
All possible combination of the three variables A, B, and C with two possible values, true and false,
can give you eight test variations.(The number of combination is the number of values raised to
the number of possible variables, or 23 = 8.)

TTT
TTF
TFT
TFF
FTT
FTF
FFT
FFF

The orthogonal array for this example offer you only following four cases.
TTF
TFT
FTT
FFF


for the rule applied here and detail pls visit
http://www2.research.att.com/~njas/oadir/oa.4.3.2.2.txt

Wednesday, October 21, 2009

Web 2.0 security testing oversight

Working in era of web 2.0 is more challenging for QA/testers. specially when you need to be care of security. Here we wil discuss the importance of security testing tools and their availability. also we will try to find out the "Web vulnerabilities " which affect most.
This post is for them who want to take an overview on security testing of web 2.0 applications.

so lets start with the question 'Can automated tool be used for securing a website from hacking inexpensively and easily and what they are ?' so there are numbers of such tools available in market. many of them are free. one can search in internet. there are so many which are paid but parallel they provide their free version also.

But my concern over here is , we should not overestimated the value of such tools or scanner. The manual activities also important to find out the securities vulnerabilities. so just do not underestimate the manual effort given to your testing activities.
The firefox plugin or extension can help us to find this. Most developer use such extension. firebug is one of them. SQL injection is one of the best method to

lets now try to see the most vulnerabilities discovered. I would like to thanks Kevin Beaver, one of the best author I used to read the article. he also given the below fact which i am going to describe.

here re the few most affective
Web vulnerabilities according to the order:
1- Cross site scripting (CSS also known as XSS)
2- Broken session management
3- Improper error handling
4- Unvalidated input
5- Injection flaws
6- Insecure config management
7- Broken access control
and many more.

so from this it is very clear that XSS is very common
Web vulnerabilities. I have already posted one article on XSS. you can find this here

I have also manage to write white paper on web testing which may help you to understand the whole process of testing web application. That can be find on clicking here.

Thank you for using my blog. I will really appreciate if you write few comments and suggestion to improve it.

Friday, September 4, 2009

using selenium RC in your java project - How to run your script in different browser

I have been using selenium IDE fro last 1 year or so. In fact I just use this to automate few of our module. I was not so active user of selenium in this period.
Few months back my company placed me in a java project. I wanted to work with some automation tool not exactly play back and recording. There for I tried my hand in selenium RC. Recently I successfully managed to install RC with eclipse (Java IDE used in my project) and ran some of test case recorded in IDE. I am trying my hand to make them data driven and more specific. For that one should be good in java programming. I am also trying to be good in that.

I have seen many of us seeking help to configure RC in their project. All they want to run very first test case. for that, I decided to write some thing which may help to begin with the very first etst case in RC.
Here in my article I will explain how to configure RC with eclipse and how to run the test case recorded in IDE.
I am assuming that you are good in using IDE record and playback.
So once you done your recording with IDE convert your recorded script in java. for this click on OPTIONS->FORMAT and choose java. save this test case as simple java file.

so you have your test case say test.java.

Now follow the steps to configure Rc and java client driver with eclipse.

1- Download Selenium-RC from the SeleniumHQ downloads page and save this some where you want.

2- launch eclipse
3- Create a new java project (I guess you are aware of creating a new project in eclipse. If not then take help from developer or visit documentation section in http://seleniumhq.org/)
4- Add external jar files. (from the location where you have already saved downloaded selenium rc)
5- Add your saved java file(which you have saved after recording in IDE) to this project
6- Now run this as Junit test


here I am giving some explanation which might help you to get the things easily.


This is the java code which i have recorded using IDE to test the search in Google.

import junit.framework.*;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

import com.thoughtworks.selenium.SeleneseTestCase;
public class test1 extends SeleneseTestCase {

public void setUp() throws Exception {
setUp("http://www.google.co.in/", "*firefox");
}
public void testVishal() throws Exception {
selenium.open("/");
selenium.type("q", "vishal sachan");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("vishal sachan"));
}

}

Running your test in multiple browser:
You can now run this test in different browse by initializing the desired browser info like firefox, iexplorer, chrome..
setUp("http://www.google.co.in/", "*firefox") ;

I hope this will help you to get started with you very first test using selenium RC.