Friday, November 16, 2007

Contents of a Effective Bug Report

Some Data that should be incorporated in a Effective Bug report, this is not exhaustive but yet informational.....

The first aim of a bug report is to let the programmer see thefailure with their own eyes. If you can't be with them to make itfail in front of them, give them detailed instructions so that theycan make it fail for themselves.

In case the first aim doesn't succeed, and the programmercan't see it failing themselves, the second aim of a bugreport is to describe what went wrong. Describe everything indetail. State what you saw, and also state what you expected to see.Write down the error messages, especially if they havenumbers in.

When your computer does something unexpected, freeze. Donothing until you're calm, and don't do anything that you thinkmight be dangerous.

By all means try to diagnose the fault yourself if you think youcan, but if you do, you should still report the symptoms as well.

Be ready to provide extra information if the programmer needs it. Ifthey didn't need it, they wouldn't be asking for it. They aren'tbeing deliberately awkward. Have version numbers at your fingertips,because they will probably be needed.

Write clearly. Say what you mean, and make sure it can't bemisinterpreted.
Above all, be precise. Programmers like precision.

Annoying Issues with QTP.

Working with QTP is more fun, especially when solving many issues that you run into.
Below are a collection of some common issues that I encountered and the probable solutions....

Issue 1 : System resources problems and errors occur while testing Web applications
Solution : Optimize the system environment and minimize IE periodically during the test run..

Refer Support KB ID : 33128 for more info.

Wednesday, November 14, 2007

Software Testing..Why,How and What....!!!!

The content below is aimed to provide an insight into the perspective of testing, to someone who does not know much about ...

Introduction:

There an lot of definitions for Software testing and the way I define it is the activity performed to validate and verify the specified quality attributes and also detect the inherent flaws built in into the system. The purpose of it is definietly to certify the system is ready for use , but the approach followed is by breaking it.No wonder testers are branded as negative minded people.

History of Testing:

Testing is an inherent activity built into all living creatures, which is exactly why the supply for the testing industry is huge but the need of the hour are quality testers, which is not easy as being found by the industry. Study suggests that testing is one of the major players in the outsourcing industry and ie expecting to be 20 billion dollar market all by itself. Gone are the days when Mangers considered testing is low end work and needs no special interest.

Importance and Need for Testing:

Testing by itself is complementary activity which is gaining standaloone status as the industry matures.However there are people who argue that the testing is not required if the a process oriented model is followed to develop a software system.

I do agree with those, but to achieve a flawless process model, there has to be extensive testing done on the model itself, which calls for testers with special skills.

No model can ever eradicate the hidden defects in a system just like no system can be termed as defect free through any amount of testing.

Lets look into some of the needs for Testing:
Business Needs. Customer oriented market. System complexity. System Criticality Immature process used.

Offlate there has been ever growing demand for good Automation testers, this is has been possible mainly due to the amount of manual testing that has happened over the years, thus enabling vendors to churn out matured systems developed with matured and industry standard processes. Needless to say the bar has been raised with the inheritance of Six Sigma and also with the various CMM, CMMI models by the IT industry.

Organizations which have struggled with various process flaws have been able to gain ground with these models and you see a major thrust towards implementation of the same.

Why are the Maturity models important?

I say there are two reasons for it and the second one is tied to first:

1. Business Needs : As the market moulds into a customer oriented architecture, there is a need more than ever to deliver quality products at nominal costs without change infact expecting a major profit margin. These models help in achieveing the business motto.

2. Produce Quality products, there by not only expand their customer base but significantly retain the old customers. There are many instances of vendors losing their customers, Ex :Wallmart has a customer retention metric of 36% which is not good.

Where does Testing fit into these Models?

Testing serves as one of major measuring factor for a org to be assess at various levels of these models.One needs to understand that the quality of product is a measure of the :
1. Number of defects detected in the system by the Customer
2. % Growth increase in sales over a period of time
3. Customer response over the product.
4. Brand Value created for the vendor.

Open Test Architecture...OTA

Quality Center/Test Director is a Test Management tool provided by HP.

OTA is the QC/TD API that can be used very effectively to work with Quality Center ot Test Director.

Below are some simple example usages of OTA.
For more info, refer the OTA doc that comes along with QC/TD.
Searching the support site and sqa forums will also give valuable inputs.

1. Adding a Manual Test case through QTP
The below code can be used to create a manual test case into QC, provided QTP is already connected to QC.

Dim td 'As New TDConnection
Dim dsf 'As DesignStepFactory
Dim tf 'As TestFactory
Dim t 'As Test
Dim ds 'As DesignStep

Set td = QCUtil.TDConnection
Set tf = td.TestFactory
t = tf.AddItem("New Manual test")
t.Post
Set dsf = t.DesignStepFactory

For i = 1 To 5
Set ds = dsf.AddItem(Null)
ds.Field("DS_STEP_NAME") = "Step " & i
ds.Field("DS_DESCRIPTION") = "The design step description"
ds.Field("DS_EXPECTED") = "The expected"
ds.Post
Next

Calling Macro in QTP or VBS

'Run Macros from VBS

Function callMacro(strFilePath)
Set XLApp = CreateObject("Excel.Application")
XLApp.Application.DisplayAlerts = False
Set XLBook = XLApp.Workbooks.Open(strFilePath, readOnly=False)
XLBook.Sheets("Sheet1").Activate
'call Excel macro
XLApp.run "Macro1"
XLBook.Save
XLApp.Quit
Set XLBook = nothing
Set XLApp = nothing
End Function

Useful Scripting Links

For working effectively with Expert view in QTP, a strong scripting knowledge is essential.
Below sites can be very useful as I have found out...

MS Script Center..
http://www.microsoft.com/technet/scriptcenter/resources/qanda/all.mspx

Good Site for Wscript
http://www.computerperformance.co.uk/Logon/Logon_Remove.htm

Usage of fso(file system objects)
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/filesfolders/files/#EnumAllFilesInFolder.htm

Scriping Answers Forum where an active online community can be found
http://www.scriptinganswers.com/vault/Files%20and%20Folders/

SQA forums is a great place to start learning most of these as well.....
http://sqaforums.com/

Good portal to Learn VBScript
http://www.visualbasicscript.com/

We are progammers, look up Advanced QTP site for very advanced information about QTP
Ankur's Site, one of my collegue, maintains updated and useful information
http://www.advancedqtp.com/home/

MSDN Library
http://msdn.microsoft.com/en-us/library/ms632678(VS.85).aspx

QAI : Testing Institue
http://www.qaiworldwide.org/qai.html

Usage of Excel COM

Integration b/w QTP and Excel is more important in todays world of Data driven testing and other advanced frameworks being in use.
Here are some basic examples of the usage of Excel COM model.

These can be used within QTP or also in a independent manner by saving them as vbs and calling functions.
More functions will be added on a regular basis.


Function BIP_xlsCreateExcelObject() 'As Excel.Application
Set oExcel = CreateObject("Excel.Application") 'Create a new excel Object
oExcel.Workbooks.Add
oExcel.Visible = True
Set BIP_xlsCreateExcelObject = oExcel
End Function

' ___________________________________________________________________' ___________________________________________________________________
'DESC: 'The OpenWorkbook method opens a previously saved Excel oWorkBook and adds it to the Application
'ARG(s):
'sPath - the path of the oWorkBook that will be opened 'Note - returns Nothing on failure
' ___________________________________________________________________
Function BIP_xlsOpenExcel(oExcel, sPath)
Set oBook = oExcel.Workbooks.Open(sPath)
Set BIP_xlsOpenBook = oBook
End Function

' ___________________________________________________________________' ___________________________________________________________________
'DESC: 'This function deletes a specified range of rows
'ARG(s):
'oExcel - Reference to the Excel object 'sStartRow - Starting row to start deleting from 'sEndRow - last row to delete.
'Note - Deletes everything inbetween.
' ___________________________________________________________________
Public Function BIP_xlsDeleteRowRng(oExcel, sStartRow, sEndRow)
Set oSheet = oExcel.Activesheet 'Delete rows above headers '
oSheet.Rows("1:4").Delete
oSheet.Rows(sStartRow +":"+ sEndRow).Delete
End Function

' ___________________________________________________________________' ___________________________________________________________________
'DESC: 'This function saves Excel with Save As
'ARG(s):
'oExcel - Reference to the Excel object 'sPath - Full path, including file name to save to
'Note - Automatically overwrites files with matching names
' ___________________________________________________________________

Public Function BIP_xlsSaveAs(oExcel, sPath) 'Save excel
oExcel.DisplayAlerts = False
oExcel.ActiveWorkbook.SaveAs (sPath)
oExcel.DisplayAlerts = True
End Function

' ___________________________________________________________________' ___________________________________________________________________
'DESC: 'This function closes Excel and ignofes any messages - does not save
'ARG(s):
'oExcel - Reference to the Excel object
'Note - closes app without saving
' ___________________________________________________________________
Public Function BIP_xlsCloseExcel(oExcel) 'Close Excel
oExcel.DisplayAlerts = False
oExcel.Quit
End Function


' ___________________________________________________________________ 'Retrieve the names of all the worksheets in an excel file

Public Function retrievSheetName(strPath)
Set objExcel = CreateObject("Excel.Application")

objExcel.Workbooks.Open strPath
NoSheets= objExcel.ActiveWorkbook.Worksheets.count
msgbox NoSheets
For iSheet = 1 To NoSheets
objExcel.ActiveWorkbook.Worksheets(iSheet).Activate
SheetName =objExcel.ActiveWorkbook.Worksheets(iSheet).name
msgbox SheetName
Next
End Function


Disclaimer: Some function are mostly written as it is and are obtained while browsing through various sites for information.
Any discrepancy noticed can be suggested and will updated on a regular basis.