Topic 11Summer 2003 1 ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Topic 11 Partially based on.

Slides:



Advertisements
Similar presentations
Software Testing and Analysis. Ultimate goal for software testing Quality Assurance.
Advertisements

Lecture 8: Testing, Verification and Validation
Verification and Validation
Software Engineering-II Sir zubair sajid. What’s the difference? Verification – Are you building the product right? – Software must conform to its specification.
Software Engineering COMP 201
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Verification and Validation
1 Software Testing and Quality Assurance Lecture 1 Software Verification & Validation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Verification and Validation
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 22Slide 1 Verification and Validation u Assuring that a software system meets a user's.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software Testing.
Verification and Validation Chapter 22 of Ian Sommerville’s Software Engineering.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 22 Slide 1 Verification and Validation Slightly adapted by Anders Børjesson.
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
Software testing techniques 2.Verification and validation From I. Sommerville textbook Kaunas University of Technology.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Software Testing Testing types Testing strategy Testing principles.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
CS.436 Software Engineering By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Verification and validation Slide 1 1 Chapter 13 Verification and Validation.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
SoftwareVerification and Validation
This chapter is extracted from Sommerville’s slides. Textbook chapter
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
Verification and Validation
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Bzupages.com Verification and Validation.
CHAPTER 9: VERIFICATION AND VALIDATION 1. Objectives  To introduce software verification and validation and to discuss the distinction between them 
Verification and Validation Assuring that a software system meets a user's needs.
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software Engineering, 8th edition Chapter 22 1 Courtesy: ©Ian Somerville 2006 April 27 th, 2009 Lecture # 19 Verification and Validation.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
Verification and Validation Assuring that a software system meets a user's needs.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
©Ian Sommerville Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation with edits by Dan Fleck Coming up: Objectives.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation with edits by Dan Fleck.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
This chapter is extracted from Sommerville’s slides. Textbook chapter 22 1 Chapter 8 Validation and Verification 1.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Pradeep Konduri Niranjan Rao Julapelly.  Introduction and Overview  Verification Vs Validation  Process  Goals  Confidence  Role of V&V in different.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 22 Slide 1 Verification and Validation.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVII. Verification and Validation.
Verification and Validation. Topics covered l Verification and validation planning l Program Testing l Software inspections.
Verification and Validation
CSC 480 Software Engineering
Verification and Validation
Chapter 8 – Software Testing
Verification & Validation
Verification and Validation
Verification and Validation
Lecture 09:Software Testing
Verification and Validation Unit Testing
Testing and Test-Driven Development CSC 4700 Software Engineering
CS310 Software Engineering Dr.Doaa Sami Khafaga
Chapter 7 Software Testing.
Presentation transcript:

Topic 11Summer ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Topic 11 Partially based on lecture notes written by Sommerville, Frost, Van Der Hoek, Taylor & Tonne. Duplication of course material for any commercial purpose without the written permission of the lecturers is prohibited

Topic 11Summer Today’s Lecture l Quality assurance l An introduction to testing

Topic 11Summer ICS 52 Life Cycle Requirements phase Verify Design phase Verify Implementation phase Test Testing phase Verify

Topic 11Summer Implementation/Testing Interaction Implementation (previous lecture) Testing (this lecture)

Topic 11Summer The Seriousness of the problem… l Mars Pathfinder – Metric or English system l Audi 5000 – auto accelerate – feature or fault? l Mariner 1 launch – veered off course l AT&T telephone network - down for 9 hours l Ariane 5 l Pentium – FPU error l X-ray machine – over-radiation l LAS

Topic 11Summer Impact of Failures l Not just “out there” Mars Pathfinder Mariner 1 Ariane 5 l But also “at home” Your car Your call to your mom Your homework Your hospital visit Peter Neumann’s Risks Forum:

Topic 11Summer Quality Assurance l What qualities do we want to assure? l Correctness (most important?) l How to assure correctness? By running tests How else? l Can qualities other than correctness be “assured” ? l How is testing done? l When is testing done? l Who tests? l What are the problems?

Topic 11Summer Software Qualities l Correctness l Reliability l Robustness l Performance l Usability l Verifiability l Maintainability l Repairability l Safety l Evolvability l Reusability l Portability l Survivability l Understandability We want to show relevant qualities exist

Topic 11Summer Quality Assurance l Assure that each of the software qualities is met Goals set in requirements specification Goals realized in implementation l Sometimes easy, sometimes difficult Portability versus safety l Sometimes immediate, sometimes delayed Understandability versus evolvability l Sometimes provable, sometimes doubtful Size versus correctness

Topic 11Summer Verification and Validation l Verification “Are we building the product right?” (Boehm) The Software should conform to its specification testing, reviews, walk-throughs, inspections internal consistency; consistency with previous step l Validation “Are we building the right product?” The software should do what the user really requires ascertaining software meets customer’s intent l Correctness has no meaning independent of specifications

Topic 11Summer Problem #1:Eliciting the Customer’s Intent Actual Specs“Correct” Specs Real needs No matter how sophisticated the QA process is, there is still the problem of creating the initial specification

Topic 11Summer Problem #2: QA is tough l Complex data communications Electronic fund transfer l Distributed processing Web search engine l Stringent performance objectives Air traffic control system l Complex processing Medical diagnosis system Sometimes, the software system is extremely complicated making it tremendously difficult to perform QA

Topic 11Summer Problem #3: Management Aspects of QA l Who does what part of the testing? QA (Quality Assurance) team? Are developers involved? How independent is the independent testing group? l What happens when bugs are found? l What is the reward structure? Project Management Development GroupQA Group ? ?

Topic 11Summer Problem #4: QA vs Developers l Quality assurance lays out the rules You will check in your code every day You will comment your code You will… l Quality assurance also uncovers the faults Taps developers on their fingers Creates image of “competition” l Quality assurance is viewed as cumbersome “Just let me code” l What about rewards? Quality assurance has a negative connotation

Topic 11Summer Problem #5: Can’t test exhaustively There are possible paths! If we execute one test per millisecond, it would take years to test this program!!  Out of question loop < 20x

Topic 11Summer Simple Example: A 32-Bit Multiplier l Input: 2 32-bit integers l Output: the 64-bit product of the inputs l Testing hardware: checks one billion products per second (or roughly one check per seconds) l How long to check all possible products? 2 64  = 2 34 seconds  512 years l What if the implementation is based on table lookups? l How would you know that the spec is correct?

Topic 11Summer An Idealized View of QA Design, in formal notation executable machine code Execution on verified hardware Code, in verifiable language Complete formal specs of problem to be solved Correctness-preserving transformation

Topic 11Summer A Realistic View of QA Design, in mixed notation Pentium machine code Execution on commercial hardware Code, in C++, Ada, Java, … Mixture of formal and informal specifications Manual transformation Compilation by commercial compiler Commercial firmware

Topic 11Summer l Is a whole life-cycle process - V & V must be applied at each stage in the software process. l Has two principal objectives The discovery of defects in a system The assessment of whether or not the system is usable in an operational situation. The V & V process

Topic 11Summer l Software inspections Concerned with analysis of the static system representation to discover problems (static verification) May be supplement by tool-based document and code analysis l Software testing Concerned with exercising and observing product behaviour (dynamic verification) The system is executed with test data and its operational behaviour is observed Static and dynamic verification

Topic 11Summer Static and dynamic V&V

Topic 11Summer V & V confidence l Depends on system’s purpose, user expectations and marketing environment Software function »The level of confidence depends on how critical the software is to an organisation User expectations »Users may have low expectations of certain kinds of software Marketing environment »Getting a product to market early may be more important than finding defects in the program

Topic 11Summer l Careful Planning is essential l Start Early – remember the V model Perpetual Testing l Balance static verification and testing l Define standards for the testing process rather than describing product tests V & V planning

Topic 11Summer Static Analysis l Software Inspection l Examine the source representation with the aim of discovering anomalies and defects l May be used before implementation l May be applied to any representation of the system (requirements, design, test data, etc.) l Very effective technique for discovering errors

Topic 11Summer Inspection success l Many different defects may be discovered in a single inspection. l In testing, one defect,may mask another so several executions are required l They reuse domain and programming knowledge so reviewers are likely to have seen the types of error that commonly arise

Topic 11Summer Inspections and testing l Inspections and testing are complementary and not opposing verification techniques l Both should be used during the V & V process l Inspections can check conformance with a specification Can’t check conformance with the customer’s real requirements Cannot validate dynamic behaviour l Inspections cannot check non-functional characteristics such as performance, usability, etc.

Topic 11Summer Inspections and testing l Inspections and testing are complementary and not opposing verification techniques l Both should be used during the V & V process l Inspections can check conformance with a specification but not conformance with the customer’s real requirements l Inspections cannot check non-functional characteristics such as performance, usability, etc.

Topic 11Summer Testing l The only validation technique for non-functional requirements l Should be used in conjunction with static verification to provide full V&V coverage “Program testing can be used to show the presence of bugs, but never to show their absence.” — E. W. Dijkstra

Topic 11Summer What is Testing l Exercising a module, collection of modules, or system Use predetermined inputs (“test case”) Capture actual outputs Compare actual outputs to expected outputs l Actual outputs equal to expected outputs  test case succeeds l Actual outputs unequal to expected outputs  test case fails

Topic 11Summer Limits of software testing l “Good” testing will find bugs l “Good” testing is based on requirements, i.e. testing tries to find differences between the expected and the observed behavior of systems or their components l V&Vshould establish confidence that the software is fit for purpose l BUT remember: Testing can only prove the presence of bugs - never their absence – can’t prove it is defect free l Rather, it must be good enough for its intended use and the type of use will determine the degree of confidence that is needed

Topic 11Summer Testing Terminology l Failure: Incorrect or unexpected output, based on specifications Symptom of a fault l Fault: Invalid execution state Symptom of an error May or may not produce a failure l Error: Defect or anomaly or “bug” in source code May or may not produce a fault

Topic 11Summer l Defect testing & debugging –Different processes l V&V -establishes existence of defects in a program l Debugging – locate and repair Testing and debugging

Topic 11Summer The debugging process

Topic 11Summer Testing Goals l Reveal failures/faults/errors l Locate failures/faults/errors l Show system correctness l Improve confidence that the system performs as specified (verification) l Improve confidence that the system performs as desired (validation) l Desired Qualities: Accurate Complete / thorough Repeatable Systematic

Topic 11Summer Test Tasks l Devise test cases Target specific areas of the system Create specific inputs Create expected outputs l Choose test cases Not all need to be run all the time »Regression testing l Run test cases Can be labor intensive All in a systematic, repeatable, and accurate manner

Topic 11Summer Levels of Testing l Unit/component testing: testing of code unit (subprogram, class, method/function, small subsystem) Often requires use of test drivers l Integration testing: testing of interfaces between units Incremental or “big bang” approach? Often requires drivers and stubs l System or acceptance testing: testing complete system for satisfaction of requirements often performed by user / customer

Topic 11Summer What is the problem we need to address? l Want to verify software --> l Need to test --> l Need to decide on test cases --> l But, no set of test cases guarantees absence of bugs, l What is a systematic approach to the selection of test cases that will lead to the accurate, acceptably thorough, and repeatable identification of errors, faults, and failures? So,

Topic 11Summer Two Approaches l White box (or Glass Box) testing Structural testing Test cases designed, selected, and ran based on structure of the code Scale: tests the nitty-gritty Drawbacks: need access to source code l Black box testing Specification-based testing Test cases designed, selected, and ran based on specifications Scale: tests the overall system behavior Drawback: less systematic

Topic 11Summer Test Oracles l Provide a mechanism for deciding whether a test case execution succeeds or fails l Critical to testing Used in white box testing Used in black box testing l Difficult to automate Typically relies on humans Typically relies on human intuition Formal specifications may help

Topic 11Summer Example l Your test shows cos(0.5) = l You have to decide whether this answer is correct? l You need an oracle Draw a triangle and measure the sides Look up cosine of 0.5 in a book Compute the value using Taylor series expansion Check the answer with your desk calculator

Topic 11Summer Use the Principles l Rigor and formality l Separation of concerns Modularity Abstraction l Anticipation of change l Generality l Incrementality