TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

46
World ® ’1 6 Tech Talk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again James Walker – Principal Software Engineer – CA Technologies DO5T05 DEVOPS

Transcript of TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

Page 1: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

World®’16

TechTalk:GoingFullCircle- LinkingCodetoTeststoRequirementsandBackAroundAgainJamesWalker– PrincipalSoftwareEngineer– CATechnologies

DO5T05

DEVOPS

Page 2: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.

Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.

ForInformationalPurposesOnlyTermsofthisPresentation

Page 3: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Abstract

Dependencymappinglinksrequirements,codeandtests,andiscentraltogooddevelopmentpractice.

Thissessionwillshow:

§ HowCAAgileRequirementsDesignercanbeusedtocreateathreewaybindbetweentherequirements,codeandtests.

§ Howformalmodeling canbeusedtocreateafulldependencymapofeventhemostcomplexsystems,whileintroducingtraceabilitybetweenthedesign,codeandtests.

Withfulldependencymapping,whenachangeismadetoagivencomponentintherequirements,itsimpactacrosstheentiresystemcanbeidentified,informingthedevelopersofexactlywhatneedschangingandwhere.Testscanbeautomaticallygeneratedfromtheformalmodel,andcanbeupdatedautomaticallytovalidatethatthischangehasbeensuccessfullyimplementedinthecode.

Whenanotherchangeismade,rounditgoesagain…

James

WalkerCATechnologiesPrincipalSoftwareEngineer

Page 4: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SOFTWAREDEVELOPMENTCHALLENGES

MODELBASEDTESTING(MBT)

FEEDBACKDRIVENTESTING

CONCLUSION

1

2

3

4

Agenda

Page 5: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AboutMe– JamesWalker

§ BSc,MRes,PhD– SwanseaUniversity,Wales

§ ResearchinDataVisualisation/BigDataproblems

§ Grid-Tools– SoftwareEngineer(2012– 2015)

§ CATechnologies– LeadEngineeronCAARD(2015)

Page 6: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Maybeyouwon’tquitegettoenjoyyourweekendyet!

Page 7: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TypicalProject

Requirements

Design

Development

QA

Release

Analyst&Customer

Architect

Developer

Tester

Release

Page 8: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Waterfall

Page 9: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Problematic...§ Inflexible(linear)

§ Fewbusinesssystemshavestablerequirements

§ Longreleasecycle– Expensive– Faillate

Page 10: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

WaterfallProjectRequirements

Design

Development

QA

Release

Analyst&Customer

Architect

Developer

Tester

Release

Months/Years

WinstonRoyce– demonstratedthewaterfallasacriticismforhownotto

developsoftware!

Page 11: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ContinuousDelivery

Page 12: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ContinuousDeliveryProjectRequirements

Design

Development

QA

Release(MVP)

Months/Years

Requirements

Design

Development

QA

Release(MVP)

Requirements

Design

Development

QA

Release(MVP)

Weeks

Page 13: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

InTheoryThisisGreat…§ Eachtimewetestthedeliverable

§ Highlyadaptivetochange

§ Deliverfaster

§ Earlierfeedback(failfast)

Page 14: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

InReality…Heroculture— Fullthrottletosavetheproject

Page 15: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheProblem:Alackofclarityandvisionduringeachiteration

BusinessAnalyst Programmer TesterUser

TheUserKnowswhattheywantTheAnalystspecifieswhatthatis

TheProgrammerwritesthecode

TheTesterteststheprogram

Thefurtherthevisionsdiverge

Page 16: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Traditionaltestingmethodsaretooslow,manual,andlinear forContinuesdelivery,compromisingspeedandquality

0% 10% 20% 30% 40% 50% 60% 70%

Time/resourcesintestdatacompliance(PII)

Defectsstemmingfromambiguousrequirements

Testinginnefficienciesleadingtohighercost

Lackoftestcoveragecreatingdefects/rework

Difficultyfindingtherightdataforaparticulartest

Manualtestingleadingtoprojectdelays

What'sthebiggestproblemyouface?

Page 17: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

1– PoorRequirements

§ Aplethoraoftechniquesexist,mostarewritteninambiguousnaturallanguage

§ Therequirementsare“static”- theyoffernowaytoderivetestsdirectlyfromthem…

§ …nowaytoupdatetestswhentherequirementschange– thishastobedonemanually

Bottlenecks

Page 18: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

2– ManualTestCaseDesign§ Currentlymanual– atimeconsuming,error-prone process

§ Isunsystematic,adhoc,andhasnorealnotionof“coverage”

§ Over-testing andunder-testing – 10-20%coveragewith4timesover-testing

§ Poorrequirementsleadtopooroveralltesting,withtestershavingtofillinthegaps

§ Nolinkagetotestdata – processismanual,painstakingandverytime-consuming

§ Noflexibilityforchangerequests:acriticalweaknessinanagileorcontinuousdeliveryenvironment.Changestakelongerthantheoriginalrequirement.

Page 19: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

3– PoorTesting->AutomatedtestingAutomatedtesting:Manualscriptgeneration

§ Automatedtestingframeworksareheavilyscripted

§ Scriptgenerationisusuallydonemanually

§ Aswellasthemaintenanceofscripts

§ Alternativesolutionsuse:

§ Recordplayback

§ Script-lessautomationframeworks(keyword)

Butyou’restilldoingmanualtestcasedesign!

Page 20: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheVisionClarityandVisionDuringDevelopment

BusinessAnalyst Programmer TesterUser

Therearelessbugsandtheproductisdeliveredfaster

Thecloserthevisionmeanstheusergetsaqualityproduct

Page 21: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ModelBasedTesting

Page 22: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Modelbasedtestinglet’syoudefinethebehaviorofasystemundertest– inotherwordswhatissupposedtohappen.

WhatisModelBasedTesting?

Model

System

Themodelisthenusedtotesttheactualsystemtoseeifitdoeswhatitismeantto.

Page 23: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ModelRequirementsasan“Active”Flowchart

§ AformalmodelthatisaccessibletothebusinesswhoalreadyuseVISIO,BPM,etc.

§ Whichisalsoamathematicallyprecisemodelofasystem,sothatiteliminatesambiguityandincompleteness

§ Itcanbeusedbytestersanddevelopers– itbringstheend-user,businessandITintoclosealignment

Page 24: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

NewDeliveryParadigm:FromIdeationtoDesign,DevelopmentandTesting

Page 25: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TestingWiththe“Active”Flowchart

§ Testerscanoverlaytheflowchartwithallthefunctionallogicanddatainvolvedinasystem

§ Testscanthereforebeautomaticallyderivedfromit

Page 26: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

§ Exhaustivelytestamodel– extractallpossibleroutesfromstart->end

§ Eachroute/pathbecomesatestcase

§ Numberofroutesgrowsexponentiallywitheveryaddeddecision

32nodes+62edges=1,073,741,824 possibleroutes

GeneratingTestCases

2145Paths

Page 27: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

§ Coverage,inmostcases,isrelatedtohowmuchfunctionalityisbeingcoveredinatestcase.

§ Traversethemodelbysatisfyingcoverageconstraints:

Optimization/Coverage

19PathsEdgePairs

9PathsInOutEdges

5PathsEdges

3PathsNodes

Page 28: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

OverlayingAutomation

§ Testautomaters overlaycodesnippetsontoprocesseswhichcorrespondtothecodewhichperformseachaction

§ Automationscriptscanthereforebeautomaticallyderivedfromit

Page 29: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

29 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ProvideFullTraceabilityWithRequirements

§ Knowwhatneedstobere-testedandwhentheintegrityofasystemisatrisk…“IfIchangethis,whatwillIbreak?”

§ Theimpactofachangemadetoanindividualcomponentisidentifiedsystemwide

§ Theimpactontestcasesanduserstoriesupanddownasystemcanalsobeidentifiedautomatically

Page 30: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

30 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

DEMO

Visitourboothformore!

Page 31: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

31 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

FeedbackLoops– TheFuture

Page 32: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

32 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLDRunResults

TypicalBuildProcess

ExecutionEngine

BuildEngineDevelopment/

Code

DifferentvisualrepresentationsofPass/Failresults.

TrafficLights Dashboarding Email(Jenkins)

Page 33: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

33 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Scenario

Testing– Grayarea

Page 34: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

34 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

NeedleinaHaystackWithouttheRightInfrastructure

Page 35: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

35 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TestingBermudaTriangle

Code

RequirementsTestCases

Thefurtherapartthesearethelessquality

• Modelrepresentstherequirements• Codeisimplementedusingthemodel(canaddlinkstospecificobjects/methods).

• Testcasesaregeneratedfromthemodel

Usingtheseweobtainaclosebindingbetweenallthree.

Fulltraceabilityenablessolvingthepreviousproblemsefficiently

Page 36: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

36 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheFutureisFeedbackLoops(NewWorldOrder)

ExecutionEngine

BuildEngine

Development/Code

Model

Runresults

Page 37: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

37 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioRevisit– Whatdoesthepass/failrepresent?Testresultsbounddirectlytotheirroutesthrough

thesystem.

Page 38: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

38 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioRevisit– ExploratorytestingAfterafailurethemodelcanbeusedtogeneratememoretest

casesbypinpointtesting– testcasesfocusedondiscoveringmoreknowledgeaboutthefailure.

Page 39: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

39 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioRevisit– RiskAnalysisUsemeta-deta assignedtothemodeltoperformriskanalysis.Aretheeffectedroutesthroughthesystemaboveasetthreshold?

=63%ofUserActivity

Can’tRelease

Page 40: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

40 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ScenarioRevisit– GettingitFixed!We’vefoundtheprocess(es)responsible– nowwecantraceback

totheresponsibleteams!

DevelopmentPinpointedFailure

Defectcreated

Page 41: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

41 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Conclusion

Page 42: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

42 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

WhydoIneedthecode,requirements,andtestsstronglybound?§ AshiftingITlandscapehastransformedtheroleoftesters–

testingisnowcross-functionalanditerative,withanemphasisonfeedbackthroughout

§ Newtestanddevelopmentemerged,butthe“heroculture”remained…

§ …Alongwiththechallengesofslow,manualtesting,ambiguousrequirementsand“toolshops”

Page 43: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

43 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

TheVision:ShiftLeft,ShiftRight– OverlappingFeedbackLoops

§ ShiftLeft:workiterativelywithuserstogainupfrontknowledgeoftherequirementsandusethesetodriveactivitythroughoutthedevelopmentcycle

§ ShiftRight:connect-uptoolstacks anduse(test)analyticstoharnesstheinsightsoftesting,productionandoperations

§ Feedtheseinsightsbackintothemodel,andthewholeprocessgoesbackroundagainsoyoucanenjoyyourweekend

WhydoIneedthecode,requirements,andtestsstronglybound?

Page 44: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

44 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

RecommendedSessions

SESSION# TITLE DATE/TIME

DO5X27S What’sNewinCAAgileRequirementsDesigner 11/17/2016at12:45pm

DO5X29SModel-BasedTestingforAchievingMaximumCDPipelineAcceleration 11/17/2016at3:00pm

DO5X40S CaseStudy:WhyRabobankWasInspired 11/17/2016at3:45pm

Page 45: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

45 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Stayconnectedatcommunities.ca.com

Thankyou.

Page 46: TechTalk: Going Full Circle - Linking Code to Tests to Requirements and Back Around Again

46 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

DevOps– ContinuousDelivery

FormoreinformationonDevOps– ContinuousDelivery,pleasevisit:http://cainc.to/PiTFpu