software testing video...• test plans are not a static documents but evolve during the development...

56
Software Testing Hans-Petter Halvorsen, M.Sc.

Upload: others

Post on 25-Dec-2019

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

SoftwareTesting

Hans-PetterHalvorsen,M.Sc.

Page 2: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

RequirementsAnalysis

Design

Implementation

Testing

Maintenance

PlanningDeployment

SRS

SDD

STD

Code

InstallationGuides

UserGuides

GanttChart

withERDiagram,UMLDiagrams,CADDrawings

TestDocumentation

SoftwareRequirementsSpecifications

SoftwareDesignDocumentsSystemDocumentation

SoftwareTestPlan(STP)

ProjectPlanning

End-UserDocumentation

SystemDocumentation

SoftwareTestDocumentation

SDPSoftwareDevelopment

Plan

GanttChart

TheSoftwareDevelopment

Lifecycle(SDLC)

Page 3: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TypicalSoftwareDocumentation

High-LevelRequirementsandDesignDocuments

UserManuals

SystemDocumentation

InstallationGuides

TestPlans

TestDocumentation

DetailedRequirementsandDesignDocuments

ERDiagram(Database)UMLDiagrams(Code)

Time

Start

Finish

HowtoTest/WhattoTest

CADDrawings,etc.

1.Planning

2.Testing

3.End-userDocumentation(Thepeoplethatshallactuallyusethesoftware)

TechnicalStuff

HowtouseitHowtoinstallit

Proofthatyouhavetestedandthatthesoftwareworksasexpected

(Thestakeholders,thesoftwareteam;architects,UXdesigners,developers)

(QApeople)

(SuperUser/ITdep.)

WHATHOW

(EndUser)

ProjectM

anagem

ent(Ga

nttC

hart,etc.)

(SRS)(SDD)

(STP)(STD)

SoftwareDevelopmentPlan

(SDP)

2.Requierements/Design

Page 4: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

MainpurposeofTesting:FindBugs!!

• RequirementsErrors:13%• DesignErrors:24%• CodeErrors:38%• DocumentationErrors:13%• Bad-fixErrors:12%

http://proquest.safaribooksonline.com/book/software-engineering-and-development/9781449691998/chapter-3-engineering-of-software/42?uicode=telemark

Page 5: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhyFindBugsearly?

SoftwareDevelopmentLifeCycle(SDLC)

Page 6: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TheFirstBugever

Theyfoundabug(actuallyamoth)insideacomputerin1947thatmadetheprogramnotbehavingasexpected.Thiswasthe“first”realbug.

Page 7: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhatisBugs?• Asoftwarebugisanerror,flaw,failure,orfaultinacomputerprogramorsystemthatproducesanincorrectorunexpectedresult,orcausesittobehaveinunintendedways

• Theyfoundabug(actuallyamoth)insideacomputerin1947thatmadetheprogramnotbehavingasexpected.Thiswasthe“first”realbug.

• Debugging:FindandRemove/FixBugs

Page 8: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

“Ifyoudon’tknowhowyourcodeworks,itdoesnotwork– youjustdon’tknowityet”

SoftwareTesting

“50%ofthesoftwaredevelopmentisabouttestingyoursoftware”

Page 9: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

DifferentSystemsNeedsDifferentTesting1 2

3 4

Page 10: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

7PrinciplesofTesting1. TestingshowsthepresenceofBugs:SoftwareTestingreducestheprobabilityof

undiscovereddefectsremaininginthesoftwarebutevenifnodefectsarefound,itisnotaproofofcorrectness.

2. ExhaustiveTestingisimpossible:Testingeverythingisimpossible!Insteadweneedoptimalamountoftestingbasedontheriskassessmentoftheapplication.

3. EarlyTesting:TestingshouldstartasearlyaspossibleintheSoftwareDevelopmentLifeCycle(SDLC)

4. DefectClustering:Asmallnumberofmodulescontainmostofthedefects/bugsdetected.

5. ThePesticideParadox:Ifthesametestsarerepeatedoverandoveragain,eventuallythesametestcaseswillnolongerfindnewbugs

6. TestingisContextdependent:Thismeansthatthewayyoutestae-commercesitewillbedifferentfromthewayyoutestacommercialofftheshelfapplication

7. AbsenceofErrorisaFallacy:Findingandfixingdefectsdoesnothelpifthesystembuildisunusableanddoesnotfulfilltheusersneeds&requirements

http://www.guru99.com/software-testing-seven-principles.htmlhttp://www.testingexcellence.com/seven-principles-of-software-testing

Page 11: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

DifferentTypesofTesting

Hans-PetterHalvorsen,M.Sc.

Page 12: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TypesofTesting

StressTesting

UsabilityTesting

PerformanceTesting

UserTesting

RegressionTesting

Setyp&DeploymentTesting

...

......

RequirementsTesting

GUITesting

FunctionalTesting

NonFunctionalTesting ...

...

...LoadTesting

UsabilityTesting

SecurityTesting

Page 13: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhodoestheTesting?• Programmers/Developers

– Programmersusuallycreatetestcasesandrunthemastheywritethecodetoconvincethemselvesthattheprogramworks.Thisprogrammeractivityrelatedtotestingisusuallyconsideredtobeunittesting.

• Testers– Atesterisatechnicalpersonwhoserolefortheparticularitembeingtestedisjusttowritetest

casesandensuretheirexecution.Althoughprogrammingknowledgeisextremelyusefulfortesters,testingisadifferentactivitywithdifferentintellectualrequirements.Notallgoodprogrammerswillbegoodtesters.

• EndUsers/Customers– Itisagoodideatoinvolveusersintesting,inordertodetectusabilityproblemsand

toexposethesoftwaretoabroadrangeofinputsinreal-worldscenarios.

Page 14: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestCategoriesBlack-boxvs.White-boxTesting

White-boxTesting:Youneedtohaveknowledgeofhow(DesignandImplementation)thesystemisbuilt

Black-boxTesting:Youneednoknowledgeofhowthesystemiscreated.

TypicallydonebyDevelopers,etc

Page 15: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

LevelsofTesting

UnitTesting

IntegrationTesting

SystemTesting

AcceptanceTesting

Anymodule,program,objectseparatelytestable

Interfacebetweencomponents;interactionswithothersystems(OS,HW,etc)

Thebehaviorofthewholeproduct(system)asdefinedbythescopeoftheproject

Istheresponsibilityofthecustomer– ingeneral.Thegoalistogainconfidenceinthesystem;especiallyinitsnon-functionalcharacteristics

Page 16: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

LevelsofTestingUnitTesting:Testeachpartsindependentlyandisolated

IntegrationTesting:Makesurethatdifferentpiecesworktogether.TesttheInterfacesbetweenthedifferentpieces.Interactionwithothersystems(Hardware,OS,etc.)

SystemTesting:Testthewholesystem

RegressionTesting:Testthatitstillworksafterachangeinthecode

Page 17: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

LevelsofTesting

UnitTesting

RegressionTesting

IntegrationTesting

System/ValidationTesting

AcceptanceTesting

Start

Finish

Requirements&DesignStartDevelopment

UnitTestsarewrittenbytheDevelopersaspartoftheProgramming.EachpartisdevelopedandUnittestedseparately(EveryClassandMethodinthecode)

TheCustomerneedstotestandapprovethesoftwarebeforehecantakeitintouse.FAT/SAT.

SystemtestingistypicallyBlack-boxTeststhatvalidatetheentiresystemagainstitsrequirements,i.eCheckingthatasoftwaresystemmeetsthespecifications

Integrationtestingmeansthesystemisputtogetherandtestedtomakesureeverythingworkstogether.

Regressiontestingistestingthesystemtocheckthatchangeshavenot“broken”previouslyworkingcode.BothManually&Automatically(Re-runUnitTests)

Page 18: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestingOverviewTestCategories: TestLevels: TestMethods:

UnitTesting

RegressionTesting

IntegrationTesting

SystemTesting

AcceptanceTesting

Black-boxTesting

White-boxTesting

StressTesting

PerformanceTesting

GUITesting

FunctionalTesting

NonFunctionalTesting

LoadTesting

UsabilityTesting

SecurityTesting

etc.

Page 19: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

SoftwareTestPlan(STP)

Hans-PetterHalvorsen,M.Sc.

Page 20: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestPlanning• Tomaximizetheeffectivenessofresourcesspentontesting,asystematicapproachisrequired

• ASoftwareTestPlan(STP)shouldbecreated

Page 21: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestDocumentation

21

PlanningTests PerformTests DocumentTestResults

SoftwareTestPlan(STP)

SoftwareRequirementsSpecifications(SRS)SoftwareDesignDocument(SDD)

SoftwareTestDocumentation

(STD)

TestLogs

ThesedocumentswillbethefoundationforallTesting

- Functional&Non-FunctionalRequirements- User&SystemRequirements

Page 22: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TypicalSoftwareDocumentation

High-LevelRequirementsandDesignDocuments

UserManuals

SystemDocumentation

InstallationGuides

TestPlans

TestDocumentation

DetailedRequirementsandDesignDocuments

ERDiagram(Database)UMLDiagrams(Code)

Time

Start

Finish

HowtoTest/WhattoTest

CADDrawings,etc.

1.Planning

2.Testing

3.End-userDocumentation(Thepeoplethatshallactuallyusethesoftware)

TechnicalStuff

Howtouseit

Howtoinstallit

Proofthatyouhavetestedandthatthesoftwareworksasexpected

(Thestakeholders,thesoftwareteam;architects,UXdesigners,developers)

(QApeople)

(SuperUser/ITdep.)

WHATHOW

(EndUser)ProjectM

anagem

ent(Ga

nttC

hart,etc.)

(SRS)(SDD)

(STP)(STD)

SoftwareDevelopmentPlan (SDP)

2.Requierements/Design

Page 23: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhatisaSoftwareTestPlan(STP)?ADocumentthatanswersthefollowing:• TestingshouldbebasedonRequirements&DesignDocuments• Whatshallwetest?• Howshallwetest?• Hardware/SoftwareRequirements• Whereshallwetest?• Whoshalltest?• Howoftenshallwetest(TestSchedule)?• Howshalltestsbedocumented?

§ Itisnotenoughsimplytoruntests;theresultsofthetestsmustbesystematicallyrecorded.Itmustbepossibletoauditthetestingprocesstocheckthatithasbeencarriedoutcorrectly

§ Systemtests:Thissection,whichmaybecompletelyseparatefromthetestplan,definesthetestcasesthatshouldbeappliedtothesystem.Thesetestsarederivedfromthesystemrequirementsspecification. http://www.softwareengineering-9.com/Web/Testing/Planning.html

Page 24: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

ThesethingsneedtobespecifiedintheSTP

Page 25: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestPlanExampleA. GoalsandExitCriteria(Quality,Robustness,Schedule,PerformanceGoals

oftheProduct,...)B. ItemstobeTested/Inspected(Executablessuchasmodulesand

components,NonexecutablessuchasRequirmentsandDesignspecifications,...)

C. TestProcess/Methodologies(Unit,Functional,Acceptance,RegressionTests,Black-box,White-box,Testmetrics,Bugreportprocess,...)

D. Resources(People,Tools,TestEnvironment,...)E. Schedule(Test-casedevelopment,Testexecution,Problemreportingand

fixing,...)F. Risks(...)G. MajorTestScenariosandTestCases(...)

EssentialsofSoftwareEngineering,FrankTsui;OrlandoKaram;BarbaraBernal,3ed.,Jones&BartlettLearning

AppendixDinEssentialsofSoftwareEngineering

Page 26: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

HowtomakeaTestPlan

http://www.guru99.com/what-everybody-ought-to-know-about-test-planing.html

Page 27: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestCasesListExampleTester:_______________________,Date:________

TestCase OK Failed Description

TheLoginProcedureworks

UserDataSavedintheDatabase

etc

TheTestersfillintheseListselectronically.ShouldbeincludedinSoftwareTestDocumentation

IfTestCasesFails,reportBugsinVSO

Page 28: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestPlanningSummary• Testplanninginvolvesschedulingandestimatingthesystemtestingprocess,

establishingprocessstandardsanddescribingtheteststhatshouldbecarriedout.• Aswellashelpingmanagersallocateresourcesandestimatetestingschedules,test

plansareintendedforsoftwareengineersinvolvedindesigningandcarryingoutsystemtests.

• Theyhelptechnicalstaffgetanoverallpictureofthesystemtestsandplacetheirownworkinthiscontext.

• Aswellassettingoutthetestingscheduleandprocedures,thetestplandefinesthehardwareandsoftwareresourcesthatarerequired.

• Testplansarenotastaticdocumentsbutevolveduringthedevelopmentprocess.Testplanschangebecauseofdelaysatotherstagesinthedevelopmentprocess.

• Testplanningisparticularlyimportantinlargesoftwaresystemdevelopment.• Forsmallandmedium-sizedsystems,alessformaltestplanmaybeused,butthereis

stillaneedforaformaldocumenttosupporttheplanningofthetestingprocess.http://www.softwareengineering-9.com/Web/Testing/Planning.html

Page 29: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

TestEnvironment

Hans-PetterHalvorsen,M.Sc.

Page 30: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhyDoWeNeedaTestEnvironment?

WhycantwejustuseourownPC?

Page 31: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhyTestEnvironment?• “ItworksonmyPC”saystheDeveloper• CleanEnvironment• OntheDevelopersPCswehaveallkindofSoftwareinstalledthat

theCustomerdonthave,e.g.DevelopmentToolslikeVisualStudio,etc.

• WeneedtotestondifferentPlatformsandOperatingSystems• CustomersmayusedifferentWebBrowsers• Deployment:TestofInstallationpackages• MakethesoftwareavailableforTesters• etc.

Page 32: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

“ItworksonmyComputer”MakesuretotestyoursoftwareonotherComputersandEnvironmentsthanyourDevelopmentComputer!• EverythingworksontheDeveloperComputer• TheCustomersDatabaseisnotthesameasyours• TheCustomermaynotusethesameOS• TheCustomermaynotusethesameWebBrowser• TheCustomerdonothaveVisualStudio,SQLServer,etc.ontheirPersonalComputer

• Etc.=>TestEnvironmentisneeded!

Page 33: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Development Testing Production

DevelopmentEnvironment TestEnvironment

ProductionEnvironment

TypicallytheDevelopersPersonalComputerwithDatabase,WebServerandProgrammingSoftware

ACleanPC/Server(oranetworkwithPCsandServers)whereyouinstallandtestyourSoftware.Todaywetypicallyset-upaVirtualTestEnvironment

TheCustomersenvironmentwhereyouunstallthefinalsoftware(ServersandClients)

ProgrammingenvironmentssuchasVisualStudio,etc.shouldnotbeinstalledinthisenvironment.Youneedtocreate.exefilesetc.inordertomakeyoursoftwarerun.

Developers Developers&Testers Customersuntilfinished

Page 34: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Virtualization

OperationSystem

VirtualizationSoftware

Hypervisor

VM VM VM

Hardware(Computer)

VM VM VM

Guests

Host

VM=VirtualMachines

AHypervisorcanrundirectlyonthecomputerwithoutaHostOS

Windows,Linux,...

Windows,Linux,...

Page 35: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

VirtualizationSoftwareAlotofVirtualizationSoftwareexists.Herearesomeexamples:• VMwareWorkstation• VMwareWorkstationPlayer (Freeofchargeandsimpleto

use)• VMwarevSphereandvSphereHypervisor• VMwareFusion(Mac)• ParallelsDesktop(Mac)• MicrosoftHyper-V• VirtualBox• etc.

Page 36: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

VMwareWorkstationPlayerVMwareWorkstationPlayerisforpersonaluseonyourownPC.VMwarePlayerisfreeofchargeforpersonalnoncommercialuse.

36

VMwareisacompanythathasbeenspecializingwithinvirtualizationsoftware.http://www.vmware.com

Page 37: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhenareyoufinishedTesting?

Hans-PetterHalvorsen,M.Sc.

Page 38: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

SoftwareTesting

“50%ofthesoftwaredevelopmentisabouttestingyoursoftware”

WhenarewefinishedwithTesting?

Page 39: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Start

Finished

Requirements&Design

Development&Coding

ContinuousTestinginthewholeSDLC!

Alph

a

RCBeta

RTM

FinalDelivery

Testing

Testing Testing Testing Testing

IncreasedFocus

IncreasedFocus

IncreasedFocus

IncreasedFocus

Agile/Scrum:PeriodicallyIterations/Sprintevery14-30days

...... ...

CodeFreeze

SoftwarewithoutCritical Bugs

Requirements&Functionality

FunctionalityRequirements

YoucanneverfindallBugs!ReleasedSoftwaredo haveBugs!

Page 40: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhentoStopTesting?

• Asimpleansweristostoptestingwhenalltheplannedtestcasesareexecutedandalltheproblemsfoundarefixed.

• Inreality,itmaynotbethatsimple.Weareoftenpressuredbyscheduletoreleasesoftwareproduct.

Page 41: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

SoftwareFinished

Time

WhentoStopDevelopment?

“90%”“100%”

Details,smalladjustments,etc.Thelast10%takesalotoftime!!!

Soonerorlateryouhavetosayenoughisenoughandreleaseversion1.0.

Onemustdefinewithinthedevelopmentcompany,developmentteamorindialoguewiththecustomerwhatisdefinedas"goodenough".Softwarewillneverbe100%completeorerror-free!

Page 42: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Time

WhentoStopTesting?

CriticalPoint

Inthebeginningititeasytofindbugswithfewresources

WhenshouldyoustopTesting?(dependsonTime,Budget,etc.)

Page 43: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhentoStopTesting?• Whenthetesterhasnotbeenabletofindanotherdefectin5(10?30?100?)minutesoftesting

• Allcodereviewsandwalkthroughshavecertifiedthecodeasok

• Whenagivenchecklistoftesttypeshasbeencompleted

• Thecodehaspassedallunittests• Whentestingrunsoutofitsscheduledtime• ...

E.J.BraudeandM.E.Bernstein,SoftwareEngineering:ModernApproaches,2ed.:Wiley,2011.+++

Page 44: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

BugTrackingSystems

Hans-PetterHalvorsen,M.Sc.

Page 45: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

BugTrackingSystems• A“bugtrackingsystem”or“defecttrackingsystem”isasoftwareapplicationthatkeepstrackofreportedsoftwarebugsinsoftwaredevelopmentprojects.

• Itmayberegardedasatypeof“issuetrackingsystem”.

• Typicallybugtrackingsystemsareintegratedwithothersoftware“projectmanagementapplications”– e.g.,VisualstudioTeamServices,Jira,etc.

https://en.wikipedia.org/wiki/Bug_tracking_system

Page 46: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

BugTrackingSoftware• TeamFoundationServer/VisualStudioTeamServices

• Jira• Bugzilla• Clearquest• …(hundreds)

Page 47: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

BugReportingandTracking

BugTrackingSystem

Developer

Tester

ReportBugs

FixBugs

CheckifBugsareFixed

CheckifBugFixesareApproved

TestManager,ProjectManager,QADepartment

AssignResponsible

Person

GothroughListsofNotFixedBugs,FixedBugs,etc.

Page 48: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

VisualStudioTeamServices

Hans-PetterHalvorsen,M.Sc.

Page 49: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WorkItemsExample

YoucancreateQueries(bothPersonalandTeamQueries)

ListofWorkItems

WorkItemDetails

Page 50: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WorkItems– NewBug

Page 51: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Queries• UsedtofindexistingWorkItems• YoumaycreatedifferentQueriestomakeiteasytofindtheWorkItemsyouneed

• Queriesmaybepersonalorvisibleforeverybodyintheproject(TeamQueries)

51

Page 52: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

CreatingaQuery- Example

Page 53: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

CodeReview&Refactoring

Hans-PetterHalvorsen,M.Sc.

Page 54: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

WhatisRefactoring?• Evenwhenusingbestpracticesandmakingaconsciousefforttoproducehigh-qualitysoftware,itishighlyunlikelythatyouwillconsistentlyproduceprogramsthatcannotbeimproved.

• Refactoringis– theactivityofimprovingyourcodestylewithoutalteringitsbehavior

– achangemadetotheinternalstructureofsoftwaretomakeiteasiertounderstandandcheapertomodifywithoutchangingitsobservablebehavior

Page 55: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Refactoring- Symptoms• CodingStyleandNameConventionsnotfollowed• ProperCommentingnotfollowed• Duplicatedcode(clearlyawaste).• Longmethod(excessivelylargeorlongmethodsperhapsshouldbesubdivided

intomorecohesiveones).• Largeclass(sameproblemaslongmethod).• Switchstatements(inobject-orientedcode,switchstatementscaninmost

casesbereplacedwithpolymorphism,makingthecodeclearer).• Featureenvy,inwhichamethodtendstousemoreofanobjectfromaclass

differenttotheoneitbelongs.• Inappropriateintimacy,inwhichaclassreferstoomuchtoprivatepartsof

otherclasses.=> Anyofthesesymptoms(andmore)willindicatethatyourcodecanbeimproved.Youcanuserefactoringtohelpyoudealwiththeseproblems.

Page 56: Software Testing Video...• Test plans are not a static documents but evolve during the development process . Test plans change because of delays at other stages in the development

Hans-PetterHalvorsen,M.Sc.

UniversityCollegeofSoutheastNorwaywww.usn.no

E-mail:[email protected]:http://home.hit.no/~hansha/