Hans Buwalda-通過測試設(shè)計改善自動化測試_第1頁
Hans Buwalda-通過測試設(shè)計改善自動化測試_第2頁
Hans Buwalda-通過測試設(shè)計改善自動化測試_第3頁
Hans Buwalda-通過測試設(shè)計改善自動化測試_第4頁
Hans Buwalda-通過測試設(shè)計改善自動化測試_第5頁
已閱讀5頁,還剩37頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

.TestDesignforBetterTestAutomation.Whoisyour

speaker?LogiGear

Corporation?

SiliconValley

andVietnam?

Testing

andtest

automationservices:?

consultancy,

training?

test

developmentandautomationservices?

"test

integrated"

developmentservices?

Products:?

TestArchitect?,

TestArchitect

for

VisualStudio??

integratingtest

developmentwithtest

managementandautomationHans

Buwaldahans@@hansbuwalda?

Dutchguy,

inCaliforniasince2001?

Backgroundinmath,computerscience,management?

Focusingonkeyword

testing,agiletesting,bigtestingFrom

TheNetherlands(Holland)ZwolleZwolle

(茲沃勒)We

like

to

ridebikesAmericaNetherlandsOften

hard

to

keep

upfor

QASCRUMPROJECTSprintSprintSprintSPOPOPOPODevDevDevDevQAQAQACooperationinateamisimportantfor

QA.Ifthatsuffers

QAwillfall

evenfurtherbehind...Tests

andtheirscalabilityDon'tjust

automate

manualtestingDon'tjust

automate

manualtestingDon'tjust

automate

manualtestingGoodautomatedtestingisnotthesameasautomatinggoodmanualtesting...Example

Scripting(Selenium)WebElementelement=driver.findElement(B(name));element.sendKeys("mysterymagic");element.submit();???(newWebDriverWait(driver,10)).until(newExpectedCondition<Boolean>(){publicBooleanapply(WebDriverd){returnd.getTitle().toLowerCase().startsWith("mystery");}});System.out.println(driver.getTitle());UsingActionsfragmentfromatest

withactionsreadfromtopto

bottom4actions,eachwithanactionkeywordandarguments?

Writethetestasactions,inaspreadsheet?

Eachactionhasanameandarguments?

Automatetheactions,notthetests?

Eachactionisautomatedonlyonce,easytomaintainVariables

andexpressions

withkeywords?

Use">>"to

assignavalue

to

avariable?

Use"#"to

start

anexpressionUseexisting

actionsto

make

new

actions?

We

use"enter","click"and"check"to

make

anewaction?

Thenewactioniscalled"checkbalance"?

Argumentsare

usedwith"#"defineinoneplace:usemany

timesintests:3ways

to

implementactions?

Withactiondefinitions?

useexisting

actionsto

create

newones?

seethepreviousslide?

Low

level

(UI,etc)

actionscan

bebuilt-ininthetool?

like

"click","selectmenuitem",etc?

TestArchitect

has381ofsuchbuilt-inactions?

Canprogram

inaprogramming

language?

like

C#,PythonorJavaExample

actionimplementationinPythonScriptfor

anactionchecksortorder,to

verifywhethertherows

inatableare

sorted:defaction_checkSortOrder():#gettableobject,columnnumberandcolumncountwindowName=LIBRARY.NamedArgument("window")get

argumentsfromthetest

linefindthetableintheUItableName=LIBRARY.NamedArgument("table")columnName=LIBRARY.NamedArgument("column")table=ABT.OpenElement(windowName,tableName)column=table.GetColumnIndex(columnName)rowCount=table.GetRowCount()#checkthesortorder,rowbyrowprevious=table.GetCellText(0,column)foriinrange(1,rowCount):ifavalueissmallerthanbefore,

failthetestcurrent=table.GetCellText(i,column)if

current<previous:LIBRARY.AdministerCheck("order","sorted",

"fails

"

+

str(i+1),

0)returnprevious=currentifallrows

areascending,passthetestLIBRARY.AdministerCheck("order","sorted",

"all

rows

in

order",

1)Usingthenew

action?

By

keeping

anactiongenericitcan

beappliedfor

avariety

ofsituations?

Someexamples

ofusing"checksortorder":Behavior

DrivenDevelopment

(BDD)?

Usesnatural

languagescenarios"sweater"

--毛線衣?

Tools

like

JBehave

andCucumbermaptheseto

code?

Structureis"Given-When-Then"(GWT)?

Example:Given

acustomerpreviouslyboughtablacksweater

from

meAndIcurrentlyhave

three

blacksweaters

left

instockWhenhereturns

thesweater

for

arefundThenIshouldhave

four

blacksweaters

instock(source:Wikipedia)BDDwithactions(example

1)BDDwithActions(example

2)Givenacustomerpreviouslyboughtablacksweater

frommeAndIcurrentlyhave

threeblacksweaters

leftinstockWhenhereturnsthesweater

for

arefundThenIshouldhave

four

blacksweaters

instockRisks

ofkeyword

approaches?

Keywords

are

notamagicsolutionto

allproblems?

Withmany

tests

andkeywords

maintenance

can

stillbehardThemethodIwillshowyou

today:"ActionBasedTesting"Mystatement

ontest

automation...Issuesare

notalways

obvious...DowntonAbbey(唐頓莊園)Why

Better

Test

Design?QualitywillbebetterAutomationwillbeeasierExample

ofaTestisthisagoodtest?isitgoodfor

automation?BDDscenario...GivenUserturnsoff

PasswordrequiredoptionforDrive

TestAndUserhasloggedinby

Traffic

ApplicantaccountAndUserisatthe

Assessments

Take

a

Test

pageAndUserclicksthe

TrafficTest

linkAndUserclickstheNextbuttonAndUserclickstheSheetradiobuttoninModepageifdisplayedAndUserclickstheStartbuttonAndUserwaitsforteststartAndUserclickstheStop

Test

buttonWhenUserclickstheConfirmStop

Test

buttonAndUserentersthecorrectapplicantpasswordAndUserclickstheConfirmStop

Test

buttonThen

The

Test

isOvershouldbedisplayedintheMessagelabelAndthevalueoftheMessagelabelshouldbe

ThetestisoverAnd

TheWelcometo

TrafficTesting

pageshouldbedisplayedTheTest

AutomationDesignParadox悖論Test

ModuleObjectivesInitial-setupTest

casesFinal-cleanup(1)Early

intheproject:identifythetest

modulesthesebecometheclosettester,

engineersandproductownerscandothistogetherwithlabeled(empty)shelvesthatthetestswillbestored

inlater(2)Duringtheproject:fitthetests

into

themodulesbutdon'thidetoomuch,infothatisneededto

understandatest

shouldbevisibleonlyuseactionsandchecksthatfitthescopeofthemoduleavoidunnecessarydetails,hidethemintheactionsOverview

ActionBased

TestingHighLevelTest

DesignTest

Module1Test

Module2ObjectivesTest

ModuleNObjectives...ActionsAUTOMATIONinteractiontestbusinesstestBreakdown

Criteria?

CommonCriteria?

Functionality

(customers,finances,managementinformation,UI,...)?

Architectureofthesystem

undertest

(client,server,

protocol,subsystems,components,modules,...)?

Kindoftest

(navigationflow,

negative

tests,

responsetime,...)?

AdditionalCriteria?

Stakeholders

(like

"Accounting","Compliance","HR",...)?

Complexityofthetest

(putcomplextestsinseparate

modules)?

Executionaspects(specialhardware,

multi-station,...)?

Projectplanning(availabilityofinformation,timelines,sprints,...)?

Risks

involved

(extra

test

modulesfor

highriskareas)?

Ambitionlevel

(smoke

test,

regression,aggressive,…)For

moreinformation,andexamples,seethearticlesonmy

website:Eye

ontheball,Scope?

Always

knowthescope

ofthetest

module?

Thescope

shouldbeclearandunambiguous?

Thescope

determines

many

things:?

whatthetest

objectivesare?

whichtest

casesto

expect?

whatlevel

ofactions

to

use?

whatthechecks

are

aboutandwhichevents

shouldgenerate

awarningorerror(ifa“l(fā)ower”

functionalityiswrong)Usetheright

level

actionsHidedetailsiftheydon'tmatter

(don'tfitthescopeofthetest):however

......showdetailsiftheydomatter.

Thislinefor

example

isunclear:???Tip:have

default

values

for

argumentsACTIONDEFINITIONloginnameargument

userargument

passworddefaultvaluetestertesterpwwindowloginwindow

usernameloginwindow

passwordcontrolvalue#user#passwordenterenterwindow

controlloginwindow

loginclickSometimesexplicitvaluesare

needed:Usuallydefaultvaluesare

goodenough:datepayeemake

payment

1/1/12

GasCo.

85.00amounttextHelloTamaracheckmessageNon-UI?

Examples?

web

services(RESTandSOAP)?

applicationprogramminginterfaces

(API’s)?

embeddedsoftware?

protocols?

files,batches?

databases,SQL?

commandlineinterfaces

(CLI’s)?

multi-media?

Canbetarget

oftests,

and/or

automationinterfaces?

Non-UIautomationcan

speedupfunctionaltests

that

donotaddress

theUI?

butitcan

alsocomplicatethemMultipleSystem

AccessTest

Modules,drivingeitheroneormultipleinterfacesAutomationprotocolaccessUIaccessSystem

UnderTestAPIaccessdatabaseaccessExample

approach:usinganagentdoasmuchaspossibleheredoaslittleaspossiblehereHostDeviceABTAutomationAgentSoftwareUnderTestInterfaceInfoAndroidCarDiagnosticMobileDevicesPoint

ofSaleTerminalsGames,VRSystemsMultimedia:The"checkpicture"Approach?

Approachapplicablefor

pictureslike

graphicsoricons?

Thetester

willaddaline"checkpicture",thatincludesa"question"asoneofthearguments?

Whilethetest

isexecuted

TA

keeps

therecordedpictures?

Afterexecutionthepicturesare

shownto

amanualtestingfor

approval?

Onceapprovedunchangedsamepictureswon'tbepresented

to

themanualtester

againinfuturerunsAbsolute

andrelative

picture

checks?

Relativepicturechecksare

partoftest

module?

Theydepictimagesthatare

specificfor

thatmodule?

Exampleachartbasedoncalculations.Inanothermodulethechartwilltypicallybedifferent

(basedonadifferent

calculation)?

Absolutepicturechecksrefer

to

picturesthatoccurinmultipletests,

basedonconditions,butalways

thesameimage?

Theirnamesstart

with"/"?

Typical

use:iconsorpictograms:?

asatester

you

usuallydon'tcare

aboutthedesignofanicon,butwhetheritappearsw

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論