49
How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz)

Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

HowILearnedtoStopWorrying&LovetheBug

Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz)

Page 2: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨ Cannotprovetherearenobugs¤ Canonlyshownobugsexistonthosetests

HowToWriteTests

Testingshowsthepresence,nottheabsence

ofbugs

Page 3: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  20%ofcodehas80%ofbugs¤ Modulesthataremostcomplex,intricate,ordetailed¤ Locationswhereexpectationsofdatamightdiffer¤ Codeintransition:frequentlychangedmodules¤ Anyplacewhereprogramrequiresuserinput

¨  Focustestingeffortstoconcentrateonthesebugs¤ Tests(&testing)expensive&simplertoolsforeasycode¤ Automationmatters;errorsoftenoccuratjoinpoints

WhatToTest&Why

Page 4: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

Assumetheworst:Focustestingon

unlikelysituations

TestsKeyConcept

Page 5: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

InputTests…

Page 6: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

…andFinally

Page 7: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Inrealworld,somecasesmaynotbeworthtesting¤ Mustassumebugsexistsoideallytesteverything¤ Savetime,donotchangeinputtochecksameidea¤ Simplegetters&setterseasy,butcheckbeforecommit¤ Focusonpossibilities,donotcheckimpossiblecases

WheretheBugsAren’t

Page 8: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

GoodTests

public class Stock { private double cost; //Constructor&gettersimple&skippedforspace

//Decreasescostofastock;deltaismax.dropincost //Returnsupdatedvalueofcost public double reduceCost(double delta) { }

//Evenmorecodewouldbehere,werethisnotanexampleforclass

public class StockTest { @Test public void t1() { Stock ibm = new Stock(141.31); assertEquals(141.31, ibm.reduceCost(0), 0.001); assertEquals(141.31, ibm.getCost(),0.001); }

Page 9: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

MoreGoodTests

public class StockTest { @Test public void t2() { Stock siri = new Stock(7.10); assertEquals(0.0, siri.reduceCost(8), 0.001); assertEquals(0.0, siri.getCost(),0.001); }

public class Stock { private double cost; //Constructor&gettersimple&skippedforspace

//Decreasescostofastock;deltaismax.dropincost //Returnsupdatedvalueofcost public double reduceCost(double delta) { }

//Evenmorecodewouldbehere,werethisnotanexampleforclass

Page 10: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

NotaGoodTest

public class StockTest { @Test public void t3() { Stock htz = new Stock(15.09); assertEquals(?????, htz.reduceCost(-100), 0.001); assertEquals(?????, htz.getCost(),0.001); }

public class Stock { private double cost; //Constructor&gettersimple&skippedforspace

//Decreasescostofastock;deltaismax.dropincost //Returnsupdatedvalueofcost public double reduceCost(double delta) { }

//Evenmorecodewouldbehere,werethisnotanexampleforclass

Page 11: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

NotaGoodTest

public class Stock { private double cost; //Constructor&gettersimple&skippedforspace

//Differencefromcostatwhichpeoplesoldstock;deltaismax.dropincost //Returnsupdatedvalueofcost public double reduceCost(double delta) { }

//Evenmorecodewouldbehere,werethisnotanexampleforclass

public class StockTest { @Test public void t3() { Stock htz = new Stock(15.09); assertEquals(?????, htz.reduceCost(-100), 0.001); assertEquals(?????, htz.getCost(),0.001); }

Page 12: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

TestsKeyConcept

Assumetheworst:Focustestingon

unlikely(butNOTimpossible)situations

Page 13: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Smallbugsinloopscancreatehugeerrors¤ Lotsoftimeexecutingincreasesoddsofhittingrarecase¤ Oftenerroronlyappearswhenresultsused,notinloop¤ Debuggingoftentricky,sincemanyscenariostotestout

¨  Runoften+hard-to-debug==criticaltotestwell¤ Findingbugsimportant,sincequalitydependsonthis¤ Knowingbugsexistsuseless;mustalsosimplifyfixes¤ Sonarrowingbug'scausejustasneededasfindingbug

LoopTestingImportant

Page 14: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

TypesofLoops

Page 15: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Forallsimpleloops,tryinputsthat:¤ Skiploopentirely¤ Make1passthroughtheloop¤ Make2passesthroughtheloop¤ Makempassesthroughtheloop,where(m>2)

¨  Ifloopexecutedatmostntimes,tryinputsthat:¤ Maken-1&npassesthroughtheloop

SimpleLoop

Page 16: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Firsttestsetrunsallouterloopsexactlyonce¤  Innerloopruns(min+1),average,(max-1)&maxtimes

¨  Thenrunallbuttwoinnermostloopsexactlyonce¤  Innerloopsrun(min+1),average,(max-1)&maxtimes

¨  Testsshouldcontinuegrowingloop-by-loop

NestedLoops

Page 17: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

TypesofLoops

Page 18: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

ConcatenatedLoops

¨  Ifloopsareentirelyindependent¤ Noconditions,variables,orvaluesincommon¤ Woo-hoo!Justperformsinglelooptestsoneach

¨  Otherwisetreatasnestedloops&makelifeeasier¤ Workasifthefirstloopistheoutermostloops

Page 19: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

UnstructuredLoops

¨  Figureouttheprocessleadingtothisdecision¤  Burnartifactsandcoderesultinginthisabomination

Page 20: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

UnstructuredLoops

¨  Figureouttheprocessleadingtothisdecision¤  Burnartifactsandcoderesultinginthisabomination¤ Anyoneinvolvedshouldterminatedimmediately

Page 21: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

UnstructuredLoops

¨  Figureouttheprocessleadingtothisdecision¤  Burnartifactsandcoderesultinginthisabomination¤ Anyoneinvolvedshouldterminatedimmediately

¨  ReWrite“missing”documents,startingfromscratch

Page 22: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Unittestsgoodforsometasksworkingonback-end¤ Butwhatabouttasksimplementingfront-endcode?¤ Userwantsresultsandonlyknowswhattheycansee¤ Correctresultsimpossibleifback-endfailsunittests

¨  Back-endcodeveryimportantsocannotskiptests¤ Butinvisibletouserandclientdoesnotcareaboutcode

Back-EndTesting

Page 23: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Needtotestfront-endtasksthatdisplayinformation¤ GUIclassescanbecheckedagainstuserstories¤ JUnittestcaseslessusefulperformingthesetests¤ Automationlackshumantouch;cannotcheckaesthetics

Front-EndTesting

Page 24: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Worstapproach:Clickingaround&seewhatbreaks¤ Simple&fast,butmaynotdiscoveractualcauseofbugs¤ Unrepeatable&slowwhencheckingentiresystem¤ Donebydevelopers,tendstofollowexpecteduses

Front-End"Testing"

Page 25: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Betterapproach:Step-by-stepscripttestsforerrors¤ Lowoverhead&simple,butalsoeasytoforgettorun¤ Discoverunexpectedbugsbyhavingtestersrunscripts¤ Goodrules-of-thumbexisttofindmanycommonerrors¤ ListintaskinZenHub;manywantfilestoholdscripts

Front-EndTesting

Page 26: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Betterapproach:Step-by-stepscripttestsforerrors¤ Lowoverhead&simple,butalsoeasytoforgettorun¤ Discoverunexpectedbugsbyhavingtestersrunscripts¤ Goodrules-of-thumbexisttofindmanycommonerrors¤ ListintaskinZenHub;manywantfilestoholdscripts

Front-EndTesting

Page 27: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Bestapproach:AutomatetestingwithUItool/code¤ Createssetupcosts,butguaranteespredictableresults¤ Cancompensateforloadtimes&otherrealissues¤ Oftenincludebothprogramming&scriptingsetups

ValidationTesting

Page 28: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Allowsautomatedtestingofweb-basedapplications¨  Testsuitereportsresultsofrunning1ormoretests¨  Oftencreatemanytestcases;eachexposes1bug

¨  AddtestsinJava/C#/PythonwithWebDrivermodule¤ ManylanguageshaveSeleniumlibrariestodrivetests¤ Loadspage&definesAPIusedtoevaluateitscontents

¨  IfusingIDE,abletocreate&runsinbrowser¤  IDEeasiertouse:canrecordactionsinbrowserastest¤ WillalsoallowupdatingorrewritingSelenesescript

Selenium

Page 29: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Easiestmoduletouse,butneedsChrome*towork¤ DownloadviaChromeWebStoretobereadytouse¤ Scriptsmostlyrecordedbyclickingonelementstotest

¨  Startprocessusingthecommandopentoloadpage¤ click[AndWait]"clicks"onitemthatyouidentify¤ Scriptcanalsoentertextintoelementusingtype

¨  LikexUnittests,reliesonassertionstodefinechecks¤ assertTitlecheckstitleofpage(textshownontab)¤ CheckiftextonpageusingverifyTextPresent ¤ verifyElementPresentchecksifelementonpage

SeleniumIDE

Page 30: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

public static void main(String[] args) { WebDriver driver = new EdgeDriver(); driver.get("http://www.google.com"); WebElement el = driver.findElement(By.name("q")); element.sendKeys("Hawaiian-Print Computer"); element.submit(); WebDriverWait stall = new WebDriverWait(driver, 10); boolean result = stall.until(

new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { return d.getTitle().startsWith("Hawaiian"); }}); System.out.println("Met expectations: " + result); driver.quit(); }

SeleniumWebDriver+Java

Page 31: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

driver = webdriver.Firefox() driver.get("https://cse.buffalo.edu/~mhertz") assert "Matthew Hertz" == driver.title crselnk = driver.find_element_by_xpath( "/html/body/table[2]/tbody/tr/td[1]/p/a") crselnk.click() result = WebDriverWait(driver, 10).until( lambda x : "CSE442" in x.title) assert result

SeleniumWebDriver+Python

Page 32: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Inputoverflows:Typestringlongerthannormal/fits¤ Checkthattextisaccepted(orprovidesGOODerror)¤  Iftextisaccepted,areresultsreadableorusable?¤ Specifytext(trymanysizes)inscriptscheckingthis

CommonFront-EndErrors(1)

Page 33: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Structureoverflow:Makepanelslargerthanpage¤ Doesthiscreateerrorsorissystemabletohandledata¤ Doitemsresize,scroll,orprovidewaytoseeeverything?¤ Similartolooptests;detailinginputstousecritical

CommonFront-EndErrors(2)

Page 34: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  ViolateAssumptions:Assumeusersjerks(ordumb)

CommonFront-EndErrors(3)

Page 35: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  ViolateAssumptions:Assumeusersjerks(ordumb)¤ Theywillmakeworstchoice.Howdoessystemreact?¤ Whatifneededfilesdeleted,networklost,orsimilar?¤ Scriptexplainhowtostart&whaterrorshouldbeshown

CommonFront-EndErrors(3)

Page 36: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  DuplicationIssues:Repeatedlyentersameinput¤  IfWhentheyadd/removemultipletimes,whatiserror?¤ Doesapphandle(orprovideclues)forimpatientusers?

CommonFront-EndErrors(4)

Page 37: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  DuplicationIssues:Repeatedlyentersameinput¤  IfWhentheyadd/removemultipletimes,whatiserror?¤ Doesapphandle(orprovideclues)forimpatientusers?¤ “Back”buttontempting,whatdoesitdotowebapp?

CommonFront-EndErrors(4)

Page 38: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  InvalidData:Intentionallyforceinvalidresults¤ Scriptactionscreatingillegalstateinwidgetattheend¤ Feb29remaininnon-leapyears?Movestartafterend?¤ Giveintothedarkside&tricksystemintobadstates

CommonFront-EndErrors(5)

Page 39: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  Resizingissues:Canithandledifferentwindowsizes¤ Scriptresizingwindow&makesureprogramstillusable¤ Setmonitortosmallerscreen&seeiflayoutworks¤ Tryforcingscrollbaruse&seehowuserswillreact

CommonFront-EndErrors(6)

Page 40: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  JavaScriptisahorrible,horriblelanguage

Non-UIJavaScriptTesting

Page 41: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  JavaScriptisahorrible,horriblelanguage¤ BrendanEichcreated&implementedJSin10days¤ Namewasbuzzword;neverrelatedtoJava¤ Notintendedasstandard;NetscapelookingtobeatIE¤  "Standards"exist,butimplementationsvarygreatly

¨  Languagecombinesmanyfeaturestoprovideitall¤ OO,functional,ordeclarativecodesupportexists¤ JSoftenimplementsmiddle-tier&front-endlayers¤ Testdifferentlevelsseparatelywouldbeideal,buthow?

Non-UIJavaScriptTesting

Page 42: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  RealweaknessofJSisdifficultyintestingcode¤ Notgreatlyused,butMochabestunittestinglibrary¤ Middle-tiertestedviafront-endinmany/mostsituations¤ Nothelpfultounderstand&fix,butshouldfindbugs

¨  GoodlanguagecompilingtoJSisalternateapproach¤ Oncecomplete,usetestsandtoolsfororiginallanguage¤ ScalaJS,TypeScript,&Dartdevelopedforthispurpose¤ Allofthisalsoassumesthatbugnotcreatedbycompiler

Non-UIJavaScriptTesting

Page 43: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

Utility:Isituseable

OtherTestingIssues

Page 44: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

Utility:IsituseableReliability:Willyouendupleadstoryonnightlynews?

OtherTestingIssues

Page 45: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

Utility:IsituseableReliability:Willyouendupleadstoryonnightlynews?Robustness:Howlongofdisclaimerwillitneed?

OtherTestingIssues

Page 46: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

Utility:IsituseableReliability:Willyouendupleadstoryonnightlynews?Robustness:Howlongofdisclaimerwillitneed?Performance:WillitfinishbeforeBuffalowinsatitle?

OtherTestingIssues

Page 47: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

KeyPoint

=

Page 48: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  "Acceptancetests"checkuserstorycomplete¤ Ensuresfeatureworksandreadyfordeployment¤ Runbyclientsohavetobescriptedtests¤ Ensurefullunderstandingofallaspectsoffeature

¨  "Tasktests"checkthatataskiscomplete¤ Ensurestaskcompleteandreadyforinclusion¤ Runbydeveloperssocanbescriptedtestsorunittests¤ Findsbugsduringcoding&throughlaterchanges¤ Alsodefineswhatsuccessliketoenableparallelwork

Terminology

Page 49: Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew ... · How I Learned to Stop Worrying & Love the Bug Picture Courtesy of: Dr. Sarah Ford (a.k.a. Mrs. Matthew Hertz) ¨ Cannot

¨  WorkonSprint1¤ Rememberthetests!Testsvalidateyourunderstanding

ForNextLecture