Вы находитесь на странице: 1из 37

LabManual:SoftwareTesting&QualityAssurance)

MahatmaGandhiMissions

JawaharlalNehruEngineeringCollege

LaboratoryManual

SOFTWARE TESTING AND QUALITY ASSURANCE


For Third Year CSE Students Dept: Computer Science & Engineering (NBA Accredited)

Author JNEC, Aurangabad

LabManual:SoftwareTesting&QualityAssurance)

FOREWORD It is my great pleasure to present this laboratory manual for THIRD YEAR COMPUTER SCIENCE engineering students for the subject of Software testing and Quality Assurance. As a student, many of you may be wondering with some of the questions in your mind regarding the subject and exactly what has been tried is to answer through this manual.

As you may be aware that MGM has already been awarded with ISO 9001:2000 certification and it is our endure to technically equip our students taking the advantage of the procedural aspects of ISO 9001:2000 Certification.

Faculty members are also advised that covering these aspects in initial stage itself, will greatly relived them in future as much of the load will be taken care by the enthusiasm energies of the students once they are conceptually clear.

Dr. S. D. Deshmukh Principal


Jawaharlal Nehru Engineering College, Aurangabad

LabManual:SoftwareTesting&QualityAssurance)

LABORATORY MANUAL CONTENTS

This manual is intended for the Third year students of CS & Engineering branch in the subject of Software Testing and Quality Assurance. This manual typically contains practical/Lab Sessions related Software Testing and Quality Assurance covering various aspects related the subject to enhanced understanding. Although, as per the syllabus, software testing examples are prescribed, we have made the efforts to cover various aspects of Software Testing and Quality Assurance. Students are advised to thoroughly go through this manual rather than only topics mentioned in the syllabus as practical aspects are the key to understanding and conceptual visualization of theoretical aspects covered in the books.

Good Luck for your Enjoyable Laboratory Sessions

Ms. D. S. Deshpande
Head of Department Computer Science & Engg. Dept.

Ms. R.M.Oberoi
Lecturer Computer Science & Engg. Dept.

LabManual:SoftwareTesting&QualityAssurance)

DOs and DONTs in Laboratory:

1. Make entry in the Log Book as soon as you enter the Laboratory.

2. All the students should sit according to their roll numbers starting from their left to right.

3. All the students are supposed to enter the terminal number in the log book.

4. Do not change the terminal on which you are working.

5. All the students are expected to get at least the algorithm of the program/concept to be implemented.

6. Strictly observe the instructions given by the teacher/Lab Instructor.

Instruction for Laboratory Teachers:

1.

Submission related to whatever lab work has been completed should be done

during the next lab session. The immediate arrangements for printouts related to submission on the day of practical assignments.

2. Students should be taught for taking the printouts under the observation of lab teacher.

3. The promptness of submission should be encouraged by way of marking and evaluation patterns that will benefit the sincere students.

LabManual:SoftwareTesting&QualityAssurance)

SUBJECT INDEX
Lab Exercises 1. Study of Testing tools Lab Exercises 2. Introduction to Win runner Lab Exercises 3. Recording test in analog and context sensitive mode Lab Exercises 4. Synchronizing test Lab Exercises 5. Checking GUI Objects Lab Exercises 6. Checking Bitmap Objects Lab Exercises 7. Creating data driven test Lab Exercises 8. Maintaining test script Lab Exercises 9. Project (Creating test report) Lab Exercises 10. Developing test cases for a particular task

LabManual:SoftwareTesting&QualityAssurance)

LABEXCERCISES1:
[PurposetheseexercisesistomakefamiliarthestudentstoTestingtools.]

ExerciseNo1:(2Hours)1StudyPractical Aim:Purposetheseexercisesistomakefamiliarthestudentstotestingtools.
Testingtools:Programtestingandfaultdetectioncanbeaidedsignificantlybytestingtoolsand debuggers.Testing/debugtoolsincludefeaturessuchas:

Programmonitors,permittingfullorpartialmonitoringofprogramcodeincluding:
o InstructionSetSimulator,permittingcompleteinstructionlevelmonitoringand

tracefacilities
o Programanimation,permittingstepbystepexecutionandconditional breakpoint

atsourcelevelorinmachinecode
o Codecoveragereports

Formatteddumpor Symbolicdebugging,toolsallowinginspectionofprogramvariables onerrororatchosenpoints AutomatedfunctionalGUItestingtoolsareusedtorepeatsystemlevelteststhroughthe GUI Benchmarks,allowingruntimeperformancecomparisonstobemade Performanceanalysis(orprofilingtools)thatcanhelptohighlighthotspotsandresource usage

Input: ReferenceWebsites:
1.www.onestoptesting.com 2.www.wikipedia.org

Conclusion:Awarenessiscreatedaboutdifferentautomatedtestingtoolsavailableinmarket.

LabManual:SoftwareTesting&QualityAssurance)

LabExercises2: ExerciseNo2:(2Hours)1Practical Aim:PurposeoftheseexercisestomakefamiliarstudentstoWinrunnertestingTool.


Describesthebenefitsofautomatedtesting IntroducestheWinRunnertestingprocess takesyouonashorttouroftheWinRunneruserinterface

Input:
A]IntroductiontoWinrunner B]Comparesautomatedandmanualtestingmethods. C]UnderstandingtheTestingProcess Introducing

ExploringtheWinRunnerWindow
Beforeyoubegincreatingtests,youshouldfamiliarizeyourselfwiththeWinRunnermain window. TostartWinRunner: ChoosePrograms>WinRunner >WinRunnerontheStartmenu. 7

LabManual:SoftwareTesting&QualityAssurance)

ThefirsttimeyoustartWinRunner,theWelcometoWinRunnerwindowopens. Fromthe welcomewindowyoucancreatea newtest,openanexistingtest,orviewanoverviewof WinRunnerinyourdefaultbrowser

Thefirsttimeyouselectoneoftheseoptions,theWinRunnermainscreenopenswiththeWhatsNewin WinRunnersectionofthehelpfileontop.Ifyoudonotwantthewelcomewindowtoappearthenext timeyoustartWinRunner,clearthe Showonstartup checkbox. EachtestyoucreateorrunisdisplayedbyWinRunnerinatestwindow.Youcanopenmanytestsatone time.

LabManual:SoftwareTesting&QualityAssurance)

The Standardtoolbarprovideseasyaccesstofrequentlyperformedtasks,suchasopening,executing,and savingtests,andviewingtestresults.

Output

Output:ClearunderstandingabouthowtostartupWinnRunnertestingtool. Conclusion:Differencebetweenautomatedandmanualtestingisclearedandhandson
WinRunnertestingtool.

LabManual:SoftwareTesting&QualityAssurance)

LabExercises3:
[Beforetheseexercises,studentsshouldbewellconversantforusingwinrunner software.]

ExerciseNo3:(2Hours)1Practicals Aim: PurposeoftheseexercisestomakefamiliarstudentswithRecordingtestinanalogand


contextsensitivemode A]Recordingtestinanalogandcontextsensitivemode B]ChoosingaRecordMode Byrecording,youcanquicklycreateautomatedtestscripts.Youworkwithyourapplication asusual,clickingobjectswiththemouseandenteringkeyboardinput.WinRunnerrecordsyour operationsandgeneratesstatementsinTSL,MercuryInteractivesTestScriptLanguage.These statementsappearasascriptinaWinRunnertestwindow.Beforeyoubeginrecordingatest,you shouldplanthemainstagesofthetestandselecttheappropriaterecordmode.Tworecord modesareavailable:ContextSensitiveandAnalog. ContextSensitive Context Sensitive mode records your operations in terms of the GUI objects in your application. WinRunner identifies each object you click (such as a window, menu, list, or button), andthe type of operation you perform (such as press, enable, move, or select).For example, if you record a mouse click on the OK button in the Flight Reservation Login window,WinRunnerrecordsthefollowingTSLstatementinyourtestscript: button_press("OK") Whenyourunthescript,WinRunnerreadsthecommand,looksfortheOK button,andpressesit. Analog InAnalogmode,WinRunnerrecordstheexactcoordinatestraveledbythemouse,aswellas mouse clicks and keyboard input. For example, if you click the OK button in the Login window,WinRunnerrecordsstatementsthatlooklikethis: Whenthisstatementisrecorded.............itreallymeans: move_locator_track(1) mousetrack mtype("<T110><kLeft>") leftmousebuttonpress mtype("<kLeft>+") leftmousebuttonrelease When you run the test, WinRunner retraces the recorded movements using absolute screen coordinates.If yourapplication is located inadifferentpositiononthedesktop,ortheuser interfacehaschanged,WinRunnerisnotabletoexecutethetestcorrectly.

10

LabManual:SoftwareTesting&QualityAssurance)

In this exercise you will create a script that tests the process of opening an order in the FlightReservationapplication.YouwillcreatethescriptbyrecordinginContextSensitive mode. 1StartWinRunner. IfWinRunnerisnotalreadyopen,choosePrograms>WinRunner>WinRunnerontheStart menu. 2Openanewtest. IftheWelcomewindowisopen,clicktheNewTestbutton.Otherwise,choose File>New.AnewtestwindowopensinWinRunner. 3.StarttheFlightReservationapplicationandlogin. ChoosePrograms>WinRunner>SampleApplications>Flight1AontheStartmenu.Inthe Loginwindow,typeyournameandthepasswordmercury,andclickOK.Thenameyoutype must be at least four characters long.Position the Flight Reservation application and WinRunnersothattheyarebothclearlyvisibleonyourdesktop

4.StartrecordinginContextSensitivemode. InWinRunner,chooseCreate>RecordContextSensitiveorclicktheRecordbuttononthe toolbar.Fromthispointon,WinRunnerrecordsall mouse clicks andkeyboard input.Note thatthetext,Rec appears in blue abovetherecording button.This indicatesthat youare recording in Context Sensitive mode. The status bar also informs you of your current recordingmode. 5.Openorder#3. IntheFlightReservationapplication,chooseFile>OpenOrder.IntheOpenOrderdialog box,selecttheOrderNo.checkbox.Type3 intheadjacentbox,andclickOK.Watchhow WinRunnergeneratesatestscriptinthetestwindowasyouwork. 6.Stoprecording. InWinRunner,chooseCreate>StopRecordingorclicktheStopbuttononthetoolbar. 7.Savethetest. Choose File > Save or click the Save button on the toolbar. Save the test as lesson3 in a convenient locationon yourharddrive.ClickSavetoclosetheSaveTestdialogbox.Note 11

LabManual:SoftwareTesting&QualityAssurance)

thatWinRunnersavesthelesson3testinthefilesystemasafolder,andnotasanindividual file.This foldercontainsthetestscriptandtheresultsthataregeneratedwhen yourunthe test. Output:WinRunnerTestResultswindowisopenanddisplaysthetestresults.

Conclusion:RecordinginContextSensitivemodeisclearedandtestresultsarealsoseen.

12

LabManual:SoftwareTesting&QualityAssurance)

.LabExercises 4: ExerciseNo4:(2Hours)1Practicals Aim:PurposeofthisexerciseistoStudySynchronizingtest


A]Synchronizingtest Whenyouruntests,yourapplicationmaynotalwaysrespondtoinputwiththesamespeed.For example,itmighttakeafewseconds: toretrieveinformationfromadatabase forawindowtopopup foraprogressbartoreach100% forastatusmessagetoappear

WinRunnerwaitsasettimeintervalforanapplicationtorespondtoinput.Thedefaultwait intervalisupto10seconds.Iftheapplicationrespondsslowlyduringatestrun,WinRunners defaultwaittimemaynotbesufficient,andthetestrunmayunexpectedlyfail. Ifyoudiscoverasynchronizationproblembetweenthetestandyourapplication,youcaneither: IncreasethedefaulttimethatWinRunnerwaits.Todoso,youchangethevalueoftheTimeout forCheckpointsandCSStatementsoptionintheRuntaboftheGeneralOptionsdialogbox (Settings>GeneralOptions).Thismethodaffectsallyourtestsandslowsdownmanyother ContextSensitiveoperations

Insertasynchronizationpointintothetestscriptattheexactpointwheretheproblemoccurs.A synchronizationpointtellsWinRunnertopausethetestruninordertowaitforaspecified 13

LabManual:SoftwareTesting&QualityAssurance)

responseintheapplication.Thisistherecommendedmethodforsynchronizingatestwithyour application.Inthefollowingexercisesyouwill: createatestthatopensaneworderintheFlightReservationapplicationandinsertsthe orderintothedatabase changethesynchronizationsettings identifyasynchronizationproblem synchronizethetest runthesynchronizedtest Input: CreatingaTest InthisfirstexerciseyouwillcreateatestthatopensaneworderintheFlightReservation applicationandinsertstheorderintoadatabase. 1StartWinRunnerandopenanewtest. IfWinRunnerisnotalreadyopen,choosePrograms>WinRunner>WinRunneronthe Startmenu.IftheWelcomewindowisopen,clicktheNewTestbutton.Otherwise,chooseFile> New.Anewtestwindowopens.

2StarttheFlightReservationapplicationandlogin. ChoosePrograms>WinRunner>SampleApplications>Flight1AontheStartmenu.Inthe Loginwindow,typeyournameandthepasswordmercury,andclickOK.RepositiontheFlight ReservationapplicationandWinRunnersothattheyarebothclearlyvisibleonyourdesktop. 3StartrecordinginContextSensitivemode. ChooseCreate>RecordContextSensitiveorclicktheRecordbuttononthe toolbar.WinRunnerwillstartrecordingthetest. 14

LabManual:SoftwareTesting&QualityAssurance)

4Createaneworder. ChooseFile>NewOrderintheFlightReservationapplication

5Fillinflightandpassenger information.

6Inserttheorderintothedatabase. ClicktheInsertOrderbutton.Whentheinsertioniscomplete,theInsertDonemessageappears inthestatusbar

7Deletetheorder. ClicktheDeleteOrderbuttonandclickYesinthemessagewindowtoconfirmthedeletion.

15

LabManual:SoftwareTesting&QualityAssurance)

8Stoprecording. ChooseCreate>StopRecordingorclicktheStopbutton. 9Savethetest. ChooseFile>Save.Savethetestaslesson4inaconvenientlocationonyourharddrive.Click SavetoclosetheSaveTestdialogbox.

Output:WinRunnerTestResultswindowisopenanddisplays thetestresults. Conclusion:ImportanceofSynchronizingtestisclearedandtestresultsarealsoseen.

16

LabManual:SoftwareTesting&QualityAssurance)

LabExercises5: ExerciseNo5:(2Hours)1Practicals Aim:Whenworkingwithanapplication,youcandeterminewhetheritisfunctioningproperly


accordingtothebehaviorofitsGUIobjects. A]CheckingGUIObjects

Input:
AddingGUICheckpointstoaTestScript In this exercise you will check that objects in the Flight Reservation Open Order dialog box functionproperlywhenyouopenanexistingorder. 1StartWinRunnerandopenanewtest. If WinRunner is not already open, choose Programs > WinRunner > WinRunner on the Start menu. If the Welcome window is open, click the New Test button. Otherwise, choose File > New.Anewtestwindowopens. 2StarttheFlightReservationapplicationandlogin. Choose Programs > WinRunner > Sample Applications > Flight 1A on the Start menu. In the Loginwindow,typeyournameandthepasswordmercury,andclickOK.RepositiontheFlight ReservationapplicationandWinRunnersothattheyarebothclearlyvisibleonyourdesktop. 3StartrecordinginContextSensitivemode. ChooseCreate>RecordContextSensitiveorclicktheRecordbuttononthetoolbar. 4OpentheOpenOrderdialogbox. ChooseFile>OpenOrderintheFlightReservationapplication.

5CreateaGUIcheckpointfortheOrderNo.checkbox. Choose Create > GUI Checkpoint > For Object/Window, or click the GUI Checkpoint for Object/WindowbuttonontheUsertoolbar UsethepointertodoubleclicktheOrderNo.checkbox.TheCheckGUIdialogboxopensand displaystheavailablechecks.Notethatthisdialogboxdoesnotopenifyouonlysingleclicked theOrderNo.checkbox.Acceptthedefaultcheck,State.Thischeckcapturesthecurrentstate (off)ofthecheckboxandstoresitasexpectedresults.ClickOKintheCheckGUIdialogboxto insertthecheckpointintothetestscript.Thecheckpointappearsasanobj_check_guistatement. 17

LabManual:SoftwareTesting&QualityAssurance)

6Enter4astheOrderNo. SelecttheOrderNo.checkboxandtypein4intheOrderNo.textbox. 7CreateanotherGUIcheckpointfortheOrderNo.checkbox. ChooseCreate>GUICheckpoint>ForObject/Windoworclickthe GUICheckpointforObject/WindowbuttonontheUsertoolbar.Usethepointertosingleclick the Order No. check box. WinRunner immediately inserts a checkpoint intothe test script (an obj_check_gui statement) that checks the default check State. (Use this shortcut when you wanttouseonlythedefaultcheckforanobject.)Thischeckcapturesthecurrentstate(on)ofthe checkboxandstoresitasexpectedresults. 8CreateaGUIcheckpointfortheCustomerNamecheckbox. Choose Create > GUI Checkpoint > For Object/Window or click the GUI Checkpoint for Object/WindowbuttonontheUsertoolbar.UsethepointertodoubleclicktheCustomerName check box. The Check GUI dialog box opens and displays the available checks. Accept the defaultcheckStateandselectEnabledasanadditionalcheck.TheStatecheckcapturesthe currentstate(off)ofthecheckboxtheEnabledcheckcapturesthecurrentcondition(off)ofthe check box.Click OK in the Check GUI dialog box to insert the checkpoint intothetest script. Thecheckpointappearsasanobj_check_guistatement. 9ClickOKintheOpenOrderdialogboxtoopentheorder. 10.Stoprecording. ChooseCreate>StopRecordingorclicktheStopbutton. 11Savethetest. ChooseFile>SaveorclicktheSavebutton.Savethetestaslesson5inaconvenientlocationon yourharddrive.ClickSavetoclosetheSaveTestdialogbox. 12IfyouareworkingintheGlobalGUIMapFilemode,savethenewobjectstotheGUI map. ChooseTools>GUIMapEditor.ChooseView>GUIFiles.ChooseFile>Save.ClickYesor OKtoaddthenewobjectornewwindowtoyourGUImap. ChooseFile>ExittoclosetheGUIMapEditor.

InRunningtheTest Youwillnowrunthelesson5testinordertoverifythatthetestrunssmoothly. 1MakesurethattheFlightReservationapplicationisopenonyourdesktop. 2InWinRunner,checkthatVerifymodeisselectedintheStandardtoolbar. 3ChooseRunfromTop. ChooseRun> RunfromTop,orclicktheRunfromTopbutton.TheRunTest dialogboxopens.Acceptthedefaulttestrunnameres1.Makesurethatthe Displaytestresultsatendofruncheckboxisselected. 18

LabManual:SoftwareTesting&QualityAssurance)

4Runthetest. ClickOKintheRunTestdialogbox. 5Reviewtheresults. Whenthetestruniscompleted,thetestresultsappearintheWinRunnerTest Resultswindow.InthetestlogsectionallendGUIcheckpointeventsshouldappearingreen (indicatingsuccess). CheckingGUIObjects In DoubleclickanendGUIcheckpointeventtoviewdetailedresultsofthatGUIcheckpoint.The GUICheckpointResultsdialogboxopens.SelectCustomer Nametodisplaythedialogboxas follows: Output:

Conclusion: ExplainshowtocheckthebehaviorofGUIobjects&
showsyouhowtocreateatestthatchecksGUIobjects

19

LabManual:SoftwareTesting&QualityAssurance)

LabExercises6: ExerciseNo6:(2Hours)1Practicals Aim:Purposeoftheseexercisestostudyabitmapcheckpointcomparescapturedbitmapimages


pixelbypixel.

Input:
A]CheckingBitmapObjects AddingBitmapCheckpointstoaTest Script InthisexerciseyouwilltesttheAgentSignatureboxintheFaxOrderdialogboxYouwillusea bitmapcheckpointtocheckthatyoucansignyournameintheboxThenyouwilluseanother bitmapcheckpointtocheckthattheboxclearswhenyouclicktheClearSignaturebutton. 1StartWinRunnerandopenanewtest. IfWinRunnerisnotalreadyopen,choosePrograms>WinRunner>WinRunnerontheStart menu.IftheWelcomewindowisopen,clicktheNewTestbutton.Otherwise,chooseFile> New.Anewtestwindowopens. 2StarttheFlightReservationapplicationandlogin. ChoosePrograms>WinRunner>SampleApplications>Flight1AontheStartmenu.Inthe Loginwindow,typeyournameandthepasswordmercury,andclickOK.RepositiontheFlight ReservationapplicationandWinRunnersothattheyarebothclearlyvisibleonyourdesktop. 3StartrecordinginContextSensitivemode. ChooseCreate>RecordContextSensitiveorclicktheRecordbuttononthetoolbar. 4Openorder#6. IntheFlightReservationapplication,chooseFile>OpenOrder.IntheOpenOrderdialogbox, selecttheOrderNo.checkboxandtype6intheadjacentbox.ClickOKtoopentheorder. 5OpentheFaxOrderdialogbox. ChooseFile>FaxOrder. 6Entera10digitfax numberintheFaxNumberbox. Youdonotneedtotypeinparenthesesordashes. 7MovetheFaxOrderdialogbox. PositionthedialogboxsothatitleastobscurestheFlightReservationwindow.

20

LabManual:SoftwareTesting&QualityAssurance)

8SwitchtoAnalogmode. PressF2onyourkeyboardorclicktheRecordbuttontoswitchtoAnalogmode. 9SignyournameintheAgentSignaturebox. 10SwitchbacktoContextSensitivemode. PressF2onyourkeyboardorclicktheRecordbuttontoswitchbacktoContextSensitivemode. 11Insertabitmapcheckpointthatchecksyoursignature. ChooseCreate>BitmapCheckpoint>ForObject/WindoworclicktheBitmapCheckpointfor Object/WindowbuttonontheUsertoolbar.UsethepointertoclicktheAgentSignaturebox. WinRunnercapturesthebitmapandinsertsanobj_check_bitmapstatementintothetestscript. 12ClicktheClearSignaturebutton. ThesignatureisclearedfromtheAgentSignaturebox. 13InsertanotherbitmapcheckpointthatcheckstheAgentSignaturebox. ChooseCreate>BitmapCheckpoint>ForObject/WindoworclicktheBitmapCheckpointfor Object/WindowbuttonontheUsertoolbar. UsethepointertoclicktheAgentSignaturebox.WinRunnercapturesabitmapandinsertsan obj_check_bitmapstatementintothetestscript. 14ClicktheCancelbuttonontheFaxOrderdialogbox. 15Stoprecording. ChooseCreate>StopRecordingorclicktheStopbutton. 16Savethetest. ChooseFile>SaveorclicktheSavebutton.Savethetestaslesson6inaconvenientlocationon yourharddrive.ClickSavetoclosetheSaveTestdialogbox. 17IfyouareworkingintheGlobalGUIMapFilemode,savethenewobjectstotheGUI map. ChooseTools>GUIMapEditor.ChooseView>GUIFiles.ChooseFile> Save.ClickYesorOKtoaddthenewobjectornewwindowtoyourGUImap. ChooseFile>ExittoclosetheGUIMapEditor.

Output:
ViewingExpectedResults Youcannowviewtheexpectedresultsofthelesson6 test. 1OpentheWinRunnerTestResultswindow. ChooseTools>TestResultsorclicktheTestResultsbutton.TheTestResultswindowopens.

21

LabManual:SoftwareTesting&QualityAssurance)

2Viewthecapturedbitmaps. Inthetestlogsection,doubleclickthefirstcapturebitmapevent,orselectitandclickthe Displaybutton.

Next,doubleclickthesecondcapturebitmapevent,orselectitandclicktheDisplaybutton.

3ClosetheTestResultswindow. ClosethebitmapsandchooseFile>ExittoclosetheTestResultswindow.

Conclusion: Bitmapcheckpointcomparescapturedbitmapimagescapturedbitmapimages
pixelbypixel.

CheckingBitmaps

22

LabManual:SoftwareTesting&QualityAssurance)

LabExercises7: ExerciseNo7:(2Hours)1Practicals Aim: PurposeoftheseexercisestostudyshowsyouhowtousetheDataDriverWizardtocreate


adatadriventest

Input:
A]Creatingdatadriventest ConvertingYourTesttoaDataDrivenTest StartbyopeningthetestyoualreadycreatedandusingtheDataDriverWizardto parameterizethetest. 1Createanewtestfromthelesson7test. IfWinRunnerisnotalreadyopen,choosePrograms>WinRunner>WinRunneronthe Startmenu.IftheWelcomewindowisopen,clicktheOpenTestbutton.Otherwise,chooseFile >Openandselectthetestyoucreatedpreviously.Thetestopens. ChooseFile>SaveAsandsavethetestaslesson8inaconvenientlocationonyourhard drive. 2RuntheDataDriverWizard. ChooseTools>DataDriverWizard.TheDataDriverWizardwelcomewindowopens. ClickNexttobegintheparameterizationprocess 3Createadatatableforthetest. IntheUseaneworexistingExcel tablebox,typelesson8.TheDataDriverWizard createsanExceltablewiththisnameandsavesitthetestfolder.

4Assignatablevariablename. Acceptthedefaulttablevariablename,table. Atthebeginningofadatadriventest,theExceldatatableyouwishtouseisassignedas thevalueofthetablevariable.Throughoutthescript,onlythetablevariablenameisused.This makesiteasyforyoutoassignadifferentdatatabletothescriptatalatertimewithoutmaking changesthroughoutthescript. 23

LabManual:SoftwareTesting&QualityAssurance)

5Selectglobalparameterizationoptions. SelectAddstatementstocreateadatadriventest.ThisaddsTSLstatementstothetestthat definethetablevariablename,openandclosethedatatable,andruntheappropriatescript selectioninaloopforeachrowinthedatatable. SelectParameterizethetestandchoosetheLinebylineoption.Whenyouselect Parameterizethetest,youinstructWinRunnertofindfixedvaluesinrecordedstatementsand selectedcheckpointsandtoreplacethemwithparameters.TheLinebylineoptioninstructsthe wizardtoopenascreenforeachlineoftheselectedtestthatcanbeparameterizedsothatyou canchoosewhetherornottoparameterizethatline.ClickNext. 6Selectthedatatoparameterize. Thefirstlinebylinescreenopens.ItreferstotheOrderNumberradiobutton.

AddingDatatotheDataTable Nowthatyouhaveparameterizedyourtest,youarereadytoaddthedatathe parameterizedtestwilluse. 1Openthedatatable. ChooseTools>DataTable.Thelesson8.xlstableopens.Notethatthereisonecolumn namedOrder_Num,andthatthefirstrowinthecolumncontainsvalue4. 2.Adddatatothetable. Inrows2,3,4,and5oftheOrder_Numcolumn,enterthevalues,1,6,and10 respectively.

3Saveandclosethetable. ClickanemptycellandchooseFile>Savefromthedatatablemenu.ThenchooseFile> Closetoclosethetable. 4Savethetest. ChooseFile>SaveorclicktheSavebutton.ClickSavetoclosetheSaveTestdialog box. 24

LabManual:SoftwareTesting&QualityAssurance)

Output:
Reviewtheresults. Whenthetestruniscompleted,thetestresultsappearintheWinRunnerTest Resultswindow.

Notethatthetl_stepeventislistedfivetimesandthatthedetailsforeachiterationincludethe actualnumberoftickets,priceandtotalcostthatwaschecked.

Conclusion:UseDataDriverWizardtocreateadatadriventest.

25

LabManual:SoftwareTesting&QualityAssurance)

LabExercises8: ExerciseNo8:(2Hours)1Practicals Aim:ExplainshowtheGUImapenablesyoutocontinueusingyourexistingtestscriptsafter


theuserinterfacechangesinyourapplication.

Input:
Maintainingtestscript EditingObjectDescriptionsintheGUIMap SupposethatinanewversionoftheFlightReservationapplication,theInsertOrderbuttonis changedtoanInsertbutton.InordertocontinuerunningteststhatusetheInsertOrderbutton, youmusteditthelabelinthebuttonsphysicaldescriptionintheGUImap.Youcanchangethe physicaldescriptionusingregularexpressions. 1StartWinRunnerandopenanewtest. IfWinRunnerisnotalreadyopen,choosePrograms>WinRunner>WinRunnerontheStart menu.IftheWelcomewindowisopen,clicktheNewTestbutton.Otherwise,chooseFile> New.Anewtestwindowopens. IfyouareworkingintheGUIMapFileperTestmode,openthelesson4test. 2OpentheGUIMapEditor. ChooseTools>GUIMapEditor.TheGUIMapEditoropens.Makesurethat View>GUIMapisselected.TheWindows/Objectlistdisplaysthecurrent contentsoftheGUIMap.(IfyouareworkingintheGUIMapFileperTestMode,theGUIMap Editorwillcontainfewerobjectsthanasshownbelow).

26

LabManual:SoftwareTesting&QualityAssurance)

TheGUIMapEditordisplaystheobjectnamesinatree.Precedingeachnameisanicon representingtheobjectstype.Theobjectsaregroupedaccordingtothewindowinwhichthey arelocated.Youcandoubleclickawindowicontocollapseorexpandtheviewofitsobjects. . 3FindtheInsertOrderbuttoninthetree. IntheGUIMapEditor,chooseView>CollapseObjectsTreetoviewonlythe windowtitles.(IfyouareworkingintheGUIMapFileperTestMode,theGUI MapEditorwillcontainfewerobjectsthanasshownbelow.)

27

LabManual:SoftwareTesting&QualityAssurance)

MaintainingYourTestScripts In DoubleclicktheFlightReservationwindowtoviewitsobjects.Ifnecessary, scrolldownthealphabeticalobjectlistuntilyoulocatetheInsertOrderbutton. 4.ViewtheInsertOrderbuttonsphysicaldescription. ClicktheInsertOrder buttoninthetree.(IfyouareworkingintheGUIMapFileperTest Mode,theGUIMapEditorwillcontainfewerobjectsthanasshownbelow.)

28

LabManual:SoftwareTesting&QualityAssurance)

In ThephysicaldescriptionobjectisdisplayedinthebottompaneoftheGUI MapEditor. 5. ModifytheInsertOrderbuttonsphysicaldescription. ClicktheModifybuttonordoubleclicktheInsertOrder button.TheModify dialogboxopensanddisplaysthebuttonslogicalnameandphysical description.

MaintainingYourTestScripts In InthePhysicalDescriptionbox,changethelabelpropertyfromInsertOrderto Insert.

29

LabManual:SoftwareTesting&QualityAssurance)

ClickOKtoapplythechangeandclosethedialogbox. 6ClosetheGUIMapEditor. IntheGUIMapEditor,chooseFile>Savetosaveyourchangesandthen chooseFile>Exit.IfyouareworkingintheGUIMapFileperTestMode, chooseFile>ExitintheGUIMapEditorandthen File>SaveinWinRunner. ThenexttimeyourunatestthatcontainsthelogicalnameInsertOrder, WinRunnerwilllocatetheInsertbuttonintheFlightReservationwindow. IfyouareworkingintheGUIMapFileperTestMode,gobackandperformsteps1through6 forthelesson9test.Inpractice,allmapscontainingthemodifiedobject/windowmustbe changed. MaintainingYourTestScripts AddingGUIObjectstotheGUIMap Note:IfyouareworkingintheGUIMapFileperTestmode,skipthisexercise, sincenewobjectsaresavedinyourtestsGUImapautomaticallywhenyousaveyourtest. Ifyourapplicationcontainsnewobjects,youcanaddthemtotheGUImapwithoutrunningthe RapidTestScriptwizardagain.YousimplyusetheLearnbuttonintheGUIMapEditortolearn descriptionsoftheobjects.Youcanlearnthedescriptionofasingleobjectoralltheobjectsina window. InthisexerciseyouwilladdtheobjectsintheFlightReservationLoginwindowtotheGUImap. 1OpentheFlightReservationLoginwindow. ChoosePrograms>WinRunner >SampleApplications>Flight1A onthe Startmenu. 2OpentheGUImap. InWinRunner,chooseTools>GUIMapEditor.TheGUIMapEditoropens. 3Learnalltheobjectsin theLoginwindow. ClicktheLearnbutton.UsethepointertoclickthetitlebaroftheLogin window. Amessagepromptsyoutolearnalltheobjectsinthewindow.ClickYes.

30

LabManual:SoftwareTesting&QualityAssurance)

WatchasWinRunnerlearnsadescriptionofeachobjectintheLoginwindow andaddsittothetemporaryGUIMap. 4SavethenewobjectsintheGUImap. ChooseTools>GUIMapEditor.ChooseView>GUIFiles.ChooseFile> Save.ClickYesor OK toaddthenewobjectornewwindowtoyourGUImap. ChooseFile>ExittoclosetheGUIMapEditor. 5ClosetheLoginwindow. ClickCancel. UpdatingtheMapwiththeRun GUIWizard Note:IfyouareworkingintheGUIMapFileperTestmode,skipthisexercise, sincenewobjectsareautomaticallysavedinyourtestsGUImapwhenyousaveyourtest. Duringatestrun,ifWinRunnercannotlocateanobjectmentionedinthetest script,theRunwizardopens.TheRunwizardhelpsyouupdatetheGUImapsothatyourtests canrunsmoothly.Itpromptsyoutopointtotheobjectinyourapplication,determineswhyit couldnotfindtheobject,andthenoffersasolution.InmostcasestheRunwizardwill automaticallymodifytheobjectdescriptionintheGUImaporaddanewobjectdescription. Forexample,supposeyourunatestthatclickstheInsertOrderbuttoninthe FlightReservationwindow: button_press("InsertOrder") MaintainingYourTestScripts In IftheInsertOrderbuttonischangedtoan Insertbutton,theRunwizardopensduringatestrun anddescribestheproblem.

MaintainingYour TestScripts In YouclickthehandbuttoninthewizardandclicktheInsertbuttonintheFlightReservation program.TheRunwizardthenoffersasolution:

31

LabManual:SoftwareTesting&QualityAssurance)

WhenyouclickOK,WinRunnerautomaticallymodifiestheobjectsphysical descriptionintheGUImapandthenresumesthetestrun. IfyouwouldliketoseeforyourselfhowtheRunwizardworks: 1OpentheGUImap. ChooseTools>GUIMapEditor.ChooseView>GUIFiles. 2DeletetheFlyFromlistobjectfromtheGUIMapEditortree. TheFlyFromobjectislistedundertheFlightReservationwindow.Selectthis objectandclicktheDeletebuttonintheGUIMapEditor. 3OpenFlightReservation1A. ChoosePrograms>WinRunner >SampleApplications>Flight1A onthe Startmenu.IntheLoginwindow,typeyournameandthepasswordmercury, andclickOK.RepositiontheFlightReservationapplicationandWinRunnerso thattheyarebothclearlyvisibleonyourdesktop. 4InWinRunner,openthe lesson4testandrunit. WatchwhathappenswhenWinRunnerreachesthestatement list_select_item("FlyFrom:","LosAngeles") 5.FollowtheRunwizardinstructions. TheRunwizardasksyoutopointtotheFlyFromobjectandthenaddsthe objectdescriptiontotheGUImap.WinRunnerthencontinuesthetestrun. 6FindtheobjectdescriptionintheGUImap. WhenWinRunnercompletesthetestrun,returntotheGUIMapEditorandlook fortheFlyFromobjectdescription.YoucanseethattheRunwizardhasadded theobjecttothetree. 7ClosetheGUIMap. In theGUIMapEditor,chooseFile>Exit. 32

LabManual:SoftwareTesting&QualityAssurance)

8ClosetheFlightReservationapplication. ChooseFile>Exit.

Conclusion:GUImapenablesusingexistingtestscriptsaftertheuserinterfacechangesin
application.

33

LabManual:SoftwareTesting&QualityAssurance)

LabExercises9:

ExerciseNo9:(2Hours)1Practicals
Project(Creatingtestreport) ofdifferentformatslikedefect reporting,testreporting.

Input: Pastproject
Output: Differentfordifferentprojects

34

LabManual:SoftwareTesting&QualityAssurance)

LabExercises10:

ExerciseNo10:(2Hours)1Practicals Aim:Developingtestcasesforaparticulartask Input:Pastprojectoranyalreadyexistingproductinmarket


Valuescanbefilledandcomparedinthefollowingtable: Modulename Inputdata Expectedresult Actualresult Remark

Output: Actualresultandexpectedresultiscomparedandbugsarefoundinprojectasitcan
bedeterminedfromwhethertestispassorfail.

Conclusion:Testcasesaredevelopedaccordingtologicalreasoningandthenfromtestcases
itisdeterminedwhethertestispassorfail.

35

LabManual:SoftwareTesting&QualityAssurance)

WARMUPEXCERCISES:

DefineSoftwareEngineering DefineSoftwareTesting DiscusswithexampleManualtesting DiscussAutomatedtesting DifferencebetweenAutomatedandManualtesting Discussdifferenttestingtools Whatissoftwaretestinglifecycle Whatisbuglifecycle ImportanceofSoftwaredocumentation Whentostartandstoptesting Importanceofsoftwaretesting DifferencebetweenQualityAssuranceandQualityControl WhatisReview DifferentLevelsoftesting Whatistestcase,testdataandtestreporting

36

LabManual:SoftwareTesting&QualityAssurance)

10.Quizonthesubject:
Quiz should be conducted on tips in the laboratory, recent trends and subject knowledge of subject. The quiz questions should be formulated such that questions are normally are from scope outside of the books. However twisted questions and self formulated questions by faculty can be asked but correctness of it is necessarily to be thoroughly checked before conduction of the quiz. the the the the

11.ConductionofVivaVoceExaminations:
Teacher should oral exams of the students with full preparation. Normally, the objective questions with guess are to be avoided. To make it meaningful, the questions should be such that depth of the students in the subject is tested Oral examinations are to be conducted in co-cordial environment amongst the teachers taking the examination. Teachers taking such examinations should not have ill thoughts about each other and courtesies should be offered to each other in case of difference of opinion, which should be critically suppressed in front of the students.

12.Evaluationandmarkingsystem:
Basic honesty in the evaluation and marking system is absolutely essential and in the process impartial nature of the evaluator is required in the examination system to become popular amongst the students. It is a wrong approach or concept to award the students by way of easy marking to get cheap popularity among the students to which they do not deserve. It is a primary responsibility of the teacher that right students who are really putting up lot of hard work with right kind of intelligence are correctly awarded. The marking patterns should be justifiable to the students without any ambiguity and teacher should see that students are faced with unjust circumstances. The assessment is done according to the directives of the Principal/ Vice-Principal/ Dean Academics.

37

Вам также может понравиться