Saturday, November 6, 2010

Can a Software has a Zero Defect?

http://urtesting.blogspot.com/

When I was preparing for engineering exams, in the physics book it is mentioning that an Apple and a Bird Feather if drop from the same height both will land to the ground at the same time. I got surprised, simply the answer is never possible. But  the law of motion in physics says it is absolutely possible. Reason the time being  same for the Apple and the Bird feather to reach ground is because of the physics formula  to calculate the time.It depends on the height and acceleration of gravity and it is independent of mass.For Apple and Bird Feather both are dropped from the same height and gravity acceleration g is also same for both. So the time taken is same.

But is this possible in realty no way ...

The important consideration for the above rule of physics is that it is Under Ideal Conditions, keeping the external factors away like the wind velocity , weather conditions or any unfavorable conditions and the number of such external factors are enormous and unknown .Only then the Apple and Bird Feather will land the ground at the same time.

Many time my laptops and desktops machines hangs . Many times I am unable to call my friends over mobile phones.Many times many software stops working without being the failure notice and many time the missiles and aeronautical software fails and tolls the human life's.

But why this happens. Do the manufacturers have any clue of the same?Answer is No, because the number of external factors are enormous and unknown like the dropping of Apple and Bird Feather.Most of the time manufacuring company want to know the problems when software stop working a pop up message appears stating that "DO you want to report this error?" and usually we click on NO button and close the program and again launch the program.Manufacturing company want to known all the unnotticed  external behaviours under which application failed so that they can fix it in next release.

Now come to topic of this post - Can a Software has a Zero Defect.
My answer is Yes under the ideal condition like the Apple and Bird Feather.

Tuesday, November 2, 2010

Most Used Websites

http://urtesting.blogspot.com/

Let me ask a question , Can you tell me the name of the site which is most used for  gaming or social networking or perfessional networking or QTP or Automation testing and so on..

Got puzzled...
Yes you can tell the above and also you can find the site which is most used for the particular purpose.

There are so many websites that track the traffic and analyze website for the use.

one of such site is http://www.alexa.com/

In this site type Game and see the list of of gaming site based on network traffice i.e mostly used website.

So next time when you are looking for something and want to know which is that site that is most used of a specific purpose , go to that site and used that.
That site also list the all top website based on country.

Monday, November 1, 2010

Google Search - Shortcuts

http://urtesting.blogspot.com/

Let me ask a question, how do you search in Google ?
The answer is obvious , go to google site and enter the search word and hit enter key ....
Yes thats obvious ..
But do you know , you can do the same without going to google website..
Here you  go , directly enter the seach word in internet address and hit enter key , now see the magic you directly go the search result.( without going to google website)

Like enter - selenium and you will directly lands to Selenium search result.
enter railway reservation and you will get the railways resevation site result.

Note this will happen in internet explorer - 7 and above and firefox 3 and above because in these browser after the address bar there is also google search text box. when the exact internet address is not found then this default google text box takes that values and populates the search result.

Tuesday, September 14, 2010

Database:Records Sorting


Here is my question, how do you sort the records of the displayed data of SQL query result?

Answer is simple by using the ASC and DESC keyword (i.e. Ascending and descending followed by column name or list of column name separated by comma, where ascending is default).

Absolutely correct, but have you tried it without the column name and replacing the column name by number like 1 , 2 etc. 

No, then there you go:

Traditional query,

Select columnA, columnB, columnC from tableA order by columnA, columnB

Now try this query 

Select columnA, columnB, columnC from tableA order by 1,2

Both the above query will result the same.

Here 1,2, 3 represent the column name in the select statements.

The same is true for group by also

Note: This is in Oracle DB , not sure in other DB

Tips:Open the application by finger tips


Have you ever wondered why typing cmd and enter opens the command prompt window, typing notepad opens the notepad editor, typing iexplore opens the internet explorer, typing mspaint opens Microsoft paint and so on. Do you know why this is happening?

What do you think, is this only possible with some of the thing for which operating system has given us command? Of course not , think like type o and your outlook is opened, type I and your internet explorer is opened, type f and your Firefox is opened, type w and your  Microsoft word is opened and literally anything you like to open .

This is of course possible. Here is a tip. 

Have you ever heard of Environmental Variable, if not don’t worry.

If I ask you a question how do you open (execute) a particular file or application. The answer is simple, go to the location where the application or file is and click on it. Exactly the same happens when you type cmd and enter or type notepad and enter.

Maker of Operating systems are very smart, what they have thought is, if you want to open anything either you need to do these thing
1.    
  1. Go to the location and open it
  2. Don’t go to the location and open it

Second statement is confusing, isn’t it but it is true. For this to happen they have given us a provision. They have given a text box where you enter the path of all application or files you want to open separated by semi colon. When you type and enter we will look on the present working location and if it is not found then we will look at this text box path and open it .This is known as environment variable concept.

How to open environmental variable:

Right click My Computer->Properties->advanced tab ->Environmental variable button this will open the Environment variable window




See the System variable section Path is highlighted, that has the collection of all the paths. C:\windows\system32 is default there that is why when you enter cmd and click enters, it opens the cmd.exe available in C:\windows\system32 location.

We need not to go to C:\windows\system32 and the click on cmd.exe to open the command window. Think about the pain if this functionality is not there.

Now I am going to create some batch file and show you how type i and your Internet Explorer is opened.

Here are the steps:

1.    Crate a folder in C driver and name it  BatchFiles ( C:\BatchFiles)
2.    Go to BatchFiles folder and create a notepad
3.    In the notepad enter the following lines of code

@echo off
cd C:\Program Files\Internet Explorer
iexplore.exe

4.    Save it as i.bat
5.    Go to the Environment variable window and in system variable Path enter the created folder path
i.e. (C:\BatchFiles) in Path variable (all location is separated by semicolon)

(How to open Environmental variable -Right click My Computer->Properties->advanced tab ->Environmental variable button)
6.    Click on OK button 

Now you are all set to execute it.

Click Start->Run -> type i and enter, wonder happened!!! Internet explorer is opened.
Note: i is same as the name of batchfile that is i.bat

Now what you need to do is create a notepad and enter the above code with the application location and exe name and save it as a batch file
------------------------------------------------------------------------------------
For excel – save as e.bat and enter the following code
@echo  off
cd C:\Program Files\Microsoft Office\Office12
excel.exe
For Outbool – save as o.bat and enter the following code
@echo off
cd C:\Program Files\Microsoft Office\Office12
outlook.exe
Note: you need to create the notepad file and enter and code and save it as batch, no need to go to environment variable window as you have already added it.

So if you want to open any exe of your project , creates the batch file of that and put the file inside the C:\batchFiles folder and enjoy

Tuesday, April 20, 2010

Test Data Creation

http://urtesting.blogspot.com/

Most of the time during testing we put any data in application and test the application behavior and some how thats ok as far as testing team is concern. most of the time we need the valid test data in our test cases similar to the production test data or UAT test data or infact we need the  test data  to validate from a vast array of data .
lets assume we need  the test data for address or telephone number in US or UK  - in this case  we put the test data of our nation and assume that it will workk for US or UK without knowing the pattens of US or UK address or better say the telephone number where the format vary from nation to nation.As a test engineer always in the shoes of end user must replicate the near real test data.

Same problem was with me , as I used to put any junk data and proceeds for testing ,but that was not acceptable as long as you becomes the senior in corporate ladder.

I resolve the problem of Test data that is some how the real test data.

There is a site  -http://www.generatedata.com/#generator 

that generated the test data for testing purposes . And it has the functionality of export in different format as Excel, XML ,HTML etc.


Friday, April 16, 2010

XSD to XML ( from XML schema to XML documents)

http://urtesting.blogspot.com/
We can get XML from XSD by using tools like
1. Eclipse IDE ( java Development Tool)
2. NetBeans IDE
3. Stylus studio.

Let me give the example to create an XML from XSD using tool - stylus studio.( if you don't have download the evaluation version .. I did the same (..)

Lets take an XSD ( from w3 school website- http://www.w3schools.com/schema/schema_example.asp) .. here it is
 <----




 
   
     
     
       
         
           
           
           
           
         

       

     

     
       
              


save this as schema.xsd in notepad .

now open this xsd in stylus studio , this will open the XSD in Diagram view.
select any node and right click - View sample XML.( see above  screen shot). you will get a XML document like this.


.



<?xml version="1.0"?>
<shiporder orderid="string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/Documents%20and%20Settings/sanjeevk/Desktop/schema.xsd">
    <orderperson>string</orderperson>
    <shipto>
        <name>string</name>
        <address>string</address>
        <city>string</city>
        <country>string</country>
    </shipto>
    <!--Element item, maxOccurs=unbounded-->
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
    <item>
        <title>string</title>
        <!--Element note is optional-->
        <note>string</note>
        <quantity>635000</quantity>
        <price>1.23</price>
    </item>
</shiporder>

This a default XML that is generated. Tool has  a setting to generate the other mandatory / optional elements  or attributes as well ..

Tools- Options - XML schema Editor->XML schema to XML
see the screen shot below..



Any question , please leave your comments.

Tuesday, March 30, 2010

Learn SQL

http://urtesting.blogspot.com/


LEARN SQL:
To Know all the table in the database
1. How to get all the tables name of the database:
Select  *  from tab  -- This will give you  all the table name of the database.
when we are not sure the exact name of table use like keyword  to get the table name
Select * from tab where tname like 'A%'
give me the table name that starts with A

desc tab – this will describe the tab table of database.
TNAME                          NOT NULL VARCHAR2(30)                                                                                                                                                                          
TABTYPE                                 VARCHAR2(7)                                                                                                                                                                                  
CLUSTERID                 NUMBER      
2. How to get all the column name of the table:
Desc  tablename
Use desc  to get  all the column name and data types of the column
Or
Select * from tablename where rownum <1
1.       How to get records of the table
By using select statements

Select statements :

Select  * from  tablename
Select * from (Select * from tablename)

Or
Select  *  from tablename where column1 =’…’
Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
3.       How to sort the displayed data ( ascending or descending)
By using order by keyword – default sort is ascending
Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by column1 asc ( asc is default even we don’t put it will work)

Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by 1
Select  column1, column2, column3 from tablename where column1=’…’ and column2=’…’
Order by column1  desc
Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by Lower(column1) asc
Or
Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by Upper (column1) asc
4.       How  do we do primary sort , secondary sort and tertiary sort:
Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by Upper (column1) asc, column2 desc , column3
Or

Select  column1, column2, column3 from tablename where column1=’’ and column2=’’
Order by 1,2,3
( here 1 means first column that we specified in select statements, 2 means second column that we specified in select statement i.e- column2)

5.       How to count the records:
Bu using count key words:
Just add the select count(*) from ( before your query and a
Select  count(*) from (
Put your sql query here
)
i.e
select count(* ) from (
select * from tablename where columnname=’’
)
Or

Select count(*) from table where columnname=’’
Or
Select count(;

Thursday, March 4, 2010

Part 3


Contiue from part 2 ---
My question is from where should we start if I have to do  Database testing?
My answer is first understand dataBase schema ( schems means – the way database tables are designed)
Let me give you the answer to understand the database schema.
We  have a Database that is relational database management system(RDBMS).Here Relational means it has a relation with something .That means each table in database has a relation to other table. This relation is possible with the help of Primary Key and foreign key.
primary key is a name of column that must have different values  in every rows of records.
Here is some facts of Primary key 

Primary key is a name of column that must have different values  in every rows of records.
Here is some facts of Primary key
·         Primary key is a name of  column of a table
·         Every row ot primary key column has distinct vlaue
Generally the name of primary key column is table name followd by ID. Like in employee table , primary key would be employeeid , in person table it would be persondid and so on .
Foreign key – Foreign key in Table A is  a primary key  of Table B.
Foreign key allows us to make the relation between tables ( we talked earlier about the relation ) and make the database normalized.
To understand the concept of  primary key and Foreign key , I have created a Db schema for Defect life cycle( As we all are famliar with this) 
(Click on diagram to see bigger )

And hence forth I will use this schema to write SQL and give you the scenrio based sql .Things that are in Green in a rectangle are Table Name and below that its column name.I have also maked a relation ship between the diffenent table by an arrow.Based on the above defination of Primary key and foreign key , I can tell that In Defect table , Defectid is primary key (Table Name followed by ID) and all other id columns are foreign key ( primary key of other table).

In general when ever we see a colum name as ID that might be either primary key or foreign key  and further primary key is table name followed by id.

Sunday, February 28, 2010

Test ur Testing Skill

1.      Software Testing is a process of finding that

I.       Software is working fine
II.      Software is meeting the requirement
III.     Software is user friendly and it has very high user experience
IV.     Software is not working

2. Which of the following is correct?

a.     Verification is doing the thing right way
b.     Validation is doing the right thing
c.     Testing is right thing right way
d.     Testing is validation and verification
e.     Validation does not exist without verification
I.       a, b, e
II.      c, d, e
III.     a, b, d, e
IV.     a, b ,c, d
V.     All of the above statements are correct.

3. Which of the following statements are correct in a software testing life cycle ?
a.    QA is process oriented
b.    QC is product oriented
c.    Testing is QA and QC
d.    QC does not exist without QA

I.        a, b, e
II.      c, d, e
III.     a, b, d, e
IV.     a, b ,c, d
V.     All of the above statements are correct.

4. Which of the following is non-functional Testing?

I.       Structural Testing
II.     Security Testing
III.    Black Box Testing
IV.   White Box Testing
V.    Path Coverage and Data Driven Testing

5.    Company Logo is displayed wrong in a website. What is severity and priority of this defect?

I.      High Severity and Low Priority
II.     High Severity and High Priority
III.    Low Severity and High priority
IV.    Low Severity and low Priority
V.     Medium Priority and Medium Severity

6. For a Check Box, how many boundary value is possible?

I.       Zero
II.     One
III.    Two
IV.    Three
V.     Can not define the Boundary values of Check box object

7.    Who is worst Tester ?

I.     Project Manager
II.    Stack Holders
III.   User
IV .  Developer
V.    Business Analyst


8.    Which of the following is important  in a test case without which we can not say test case is complete.

I.     Test Steps
II.    Test ScenerioID and TestCase ID
III.   Expected Result
IV.   Actual Result
V.    Pass/Fail

9.    In a Particular module of software testing ,Tester A found 60 defects, Tester B found 70 Defects,     Tester C found 80 defects , Tester D found 90 defects. Based on the above information who is  good tester?

I.      Tester A
II.     Tester B
III.    Tester C
IV.    Tester D
V.    Can’t  say

10.    Which of the following is correct?

I.    Defects always remain in system
II.    Number of Defects found in a system is directly proportional to number of defects still remain in the system
III.    Number of Defects found in a system is inversely proportional to number of defects still remain in the  system
IV.    System cannot have Zero defect
V.    Some defects cannot  be found

Wednesday, February 10, 2010

Part2: Database Testing

Part2, Continue from Part1


Let’s start with Database testing by understanding SQL (Structural Query Language, Pronounced as -sequel).

Before we start, we need 2 things

1. Database connection strings (i.e. IP of Database server , userid and Password ) to connect to database and

2. Database client tool (like Toad, SQL Developer, SQl Server client or any tool that you use...)

Now understand what happens when we execute SQL statements:

Internally 2 things happen:

1. Your executed SQL statement is going to Compile

It will check for any semantic errors on the client side .In toad tool it will check for an error like invalid table name , invalid column name , sql keywords is wrongly used etc .If any error occurs then a pop up message to correct the statement will appear. In contrary to stored procedure (SP) where sql statements are already pre- complied. That is one of the differences between SQL statements and stored procedure and hence SP provide good performance as well as security benefits -SQL injection

2. Your Complied SQL statement is going to execute on Database server

When we execute the command it sends request to execute the statement on Database server. If connection is meeting then SQL statement is executed and result appears on client tool



That was the basic what happens behind the wall when we execute the SQL Query.

As a test engineer our intention is to validate the data, for that we use the select statement. We hardly use other DML (Data Manipulation Language – Insert, delete and Update), mostly we have only read access of database and no read write access, so we cannot use other manipulation like, insert, update or delete.

Thursday, February 4, 2010

Part1 -Database Testing

Welcome!
I am starting a series of threads in database testing for software test engineers. I have seen testers are struggling for database testing and they are very keen on learning of database testing. It is not true that they don’t know the database or the SQL, but they don’t know what exactly they need to test and why they need to test (some confusion is like data is there in database and so it is coming in Application and we should not test database)
I am starting a series of database testing concepts all based on practical and only practical knowledge, and no theoretical Gyan.

Part1

Here is a million dollar question :
Why we should do database testing ?
Here below is some of the answer ( might be many more)
1. To tell that -  data appears in application is correct or not

2. To tell that - data appears in UI is coming from database or developer has hardcoded the data in code( if data is hardcoded - it’s a very high severity and priority bug)

3. How to test ADD/EDIT /DELETE functionality ( ADD/EDIT /DELETE actually update database records - In case of ADD -new record in inserted with correct values , in edit it should edit the values and no record is inserted , in case of delete , it should delete the data or mark the data disable( soft delete or hard delete))

4. To Test reports data - where lots of data appears in consolidated format( In this case there is a great need of database testing like in DataWare Housing testing or in business intelligence Testing etc., if you dont know what is a difference in DWH and DB,don't worry,i'll explain in mu blog)

5. How to manipulate the data in database and get the desire result in Application UI( Like update the disable user so that they can login again )

6. How to replicate the scenario( by reverse engineering – Query in database and knowing the probable reason for failure in production environment where we can get the production log and database entry)

Above is some of the reason for database testing and there is many more.

Next series is a contiuation of database testing - how to perform database testing