17
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation Thanks to Ian Sommerville for his consent to use his slides for academic purposes Inam Ul Haq Lecturer in Computer Science University of Education Okara [email protected], [email protected]

Software Verification & Validation

Embed Size (px)

Citation preview

Page 1: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Verification and Validation

Thanks to Ian Sommerville for his consent to use his slides for academic purposes

Inam Ul HaqLecturer in Computer ScienceUniversity of Education [email protected], [email protected]

Page 2: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 2

� Verification and validation planning� Software inspections� Automated static analysis

Topics covered

Page 3: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 3

� Verification: "Are we building the product right”.

� The software should conform to its specification.� Validation:

"Are we building the right product”.� The software should do what the user really requires.

Verification vs validation

Page 4: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 4

� Is a whole life-cycle process - V & V must be applied at each stage in the software process.

� Has two principal objectives• The discovery of defects in a system;• The assessment of whether or not the system is useable in an

operational situation.

The V & V process

Page 5: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 5

V& V goals

� Verification and validation should establish confidence that the software is fit for purpose.

� This does NOT mean completely free of defects.� Rather, it must be good enough for its intended use.

Page 6: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 6

� Static verification• inspect program code for all possible run-time behaviors and seek out

coding flaws, back doors, and potentially malicious code.• Code reviews, walkthroughs, or inspections are referred to as static testing

• Static code analysis tools: http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis

� Dynamic verification• It monitors system memory, functional behavior, response time, and overall

performance of the system• The system can also be executed with test cases

• While static and dynamic analysis can be performed manually & they can also be automated (load-runner). Testing types: http://www.softwaretestinghelp.com/types-of-software-testing/

Static and dynamic verification

Page 7: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 7

Static and dynamic V&V

Formalspecifica tion

High-leveldesign

Requir ementsspecification

Detaileddesign

Program

Prototype Programtesting

Softwareinspections

Page 8: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 8

� Can reveal the presence of errors NOT their absence.� The only validation technique for non-functional requirements as the

software has to be executed to see how it behaves.� Should be used in conjunction with static verification to provide full

V&V coverage.

Program testing

Page 9: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 9

� Defect testing and debugging are distinct processes.� Verification and validation is concerned with establishing the existence

of defects in a program.� Debugging is concerned with locating and repairing these errors.� Debugging involves formulating a hypothesis about program behaviour

then testing these hypotheses to find the system error.

Testing and debugging

Page 10: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 10

The debugging process

Locateerror

Designerror repair

Repairerror

Retestprog ram

Testresults

Specification Testcases

Page 11: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 11

The V-model of development

Systemspecification

Sy stemdesign

Detaileddesign

Module andunit codeand test

Sub-sy steminteg rationtest plan

Systeminteg rationtest plan

Acceptancetest plan

ServiceAcceptance

testSy stem

integ ration testSub-system

integ ration test

Requir ementsspecification

Page 12: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 12

The structure of a software test plan

� The testing process.� Requirements traceability.� Tested items.� Testing schedule.� Test recording procedures.� Hardware and software requirements.� Constraints.

Page 13: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 13

The software test plan

Page 14: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 14

Inspection checklists

� Checklist of common errors should be used to drive the inspection.� Error checklists are programming language dependent and reflect

the characteristic errors that are likely to arise in the language.� In general, the 'weaker' the type checking, the larger the checklist.� Examples: Initialisation, Constant naming, loop termination, array

bounds, etc.

Page 15: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 15

Inspection checks 1 (self)

Page 16: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 16

Inspection checks 2 (self)

Page 17: Software Verification & Validation

©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 17

Inspection rate

� 500 statements/hour during overview.� 125 source statement/hour during individual preparation.� 90-125 statements/hour can be inspected.� Inspection is therefore an expensive process.� Inspecting 500 lines costs about 40 man/hours effort - about

£2800 at UK rates.