Verification and Validation

Similar documents
Verification and Validation

Verification and Validation

Objectives. Chapter 19. Verification vs. validation. Topics covered. Static and dynamic verification. The V&V process

Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 22 Slide 1

Part 5. Verification and Validation

ΗΜΥ 317 Τεχνολογία Υπολογισμού

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Ingegneria del Software II academic year: Course Web-site: [

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Static and dynamic Testing

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Software Testing. Software Testing

Verification and Validation

Unit Testing. Contents. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs...

Unit Testing. Steven Zeil. July 22, Types of Testing 2. 2 Unit Testing Scaffolding Drivers Stubs...

Verification and Validation

Chapter 8. Achmad Benny Mutiara

Verification, Testing, and Bugs

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton

Verification and Validation. Verification and validation

Lecture 9. Verification and Validation. Assuring that a software system meets a user's needs. Tutorial Questions. Verification and Validation

Lecture 15 Software Testing

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

MONIKA HEINER.

Topics in Software Testing

Program Correctness and Efficiency. Chapter 2

Aerospace Software Engineering

SOFTWARE ENGINEERING SOFTWARE VERIFICATION AND VALIDATION. Saulius Ragaišis.

Chapter 9. Software Testing

INTRODUCTION TO SOFTWARE ENGINEERING

Terminology. There are many different types of errors and different ways how we can deal with them.

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Software Quality Assurance (SQA) Software Quality Assurance

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Testing & Debugging TB-1

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 9, Testing

Darshan Institute of Engineering & Technology for Diploma Studies

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake

Examination Questions Time allowed: 1 hour 15 minutes

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015

Verification and Validation

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

Software Engineering Fall 2014

CS314 Software Engineering Peer Reviews

TASKS IN THE SYSTEMS DEVELOPMENT LIFE CYCLE

Software Engineering (CSC 4350/6350) Rao Casturi

Learning outcomes. Systems Engineering. Debugging Process. Debugging Process. Review

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Chapter 8 Software Testing. Chapter 8 Software testing

Checklist for Requirements Specification Reviews

Improving Software Testability

Static Analysis in C/C++ code with Polyspace

Sample Exam Syllabus

Key Features. Defect Rates. Traditional Unit testing: 25 faults / KLOC System testing: 25 / KLOC Inspections: / KLOC

Higher-order Testing. Stuart Anderson. Stuart Anderson Higher-order Testing c 2011

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

Chap 2. Introduction to Software Testing

Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Write perfect C code to solve the three problems below.

Finding Firmware Defects Class T-18 Sean M. Beatty

Reading assignment: Reviews and Inspections

Page 1. Reading assignment: Reviews and Inspections. Foundations for SE Analysis. Ideally want general models. Formal models

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

Outline. software testing: search bugs black-box and white-box testing static and dynamic testing

ECE 587 Hardware/Software Co-Design Lecture 11 Verification I

CMSC 132: OBJECT-ORIENTED PROGRAMMING II

Bridge Course On Software Testing

Chapter 8 Software Testing

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, September 18, ISSN SOFTWARE TESTING

Verification Using Static Analysis

Software Testing Strategies. Slides copyright 1996, 2001, 2005, 2009, 2014 by Roger S. Pressman. For non-profit educational use only

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

CS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/

All the subjective part of 2011 papers solved complete reference numbers

Software Verification and Validation (VIMMD052) Introduction. Istvan Majzik Budapest University of Technology and Economics

Verification and Test with Model-Based Design

Static Analysis of C++ Projects with CodeSonar

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo

Testing. Outline. What is this? Terminology. Erroneous State ( Error ) Algorithmic Fault

Sample Question Paper. Software Testing (ETIT 414)

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, April- ICITDA 18,

UNIT 1-2 MARKS QUESTIONS WITH ANSWERS

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

Certification Authorities Software Team (CAST) Position Paper CAST-25

Chapter 9 Quality and Change Management

Introduction to Software Engineering

Software Quality Assurance. David Janzen

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the specified requirements or not.

Pearson Education 2007 Chapter 9 (RASD 3/e)

SFU CMPT week 11

Testing Objectives. Successful testing: discovers previously unknown errors

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

People tell me that testing is

Programming II (CS300)

The Design Process. General Development Issues. C/C++ and OO Rules of Thumb. Home

Agenda. Peer Instruction Question 1. Peer Instruction Answer 1. Peer Instruction Question 2 6/22/2011

Chapter 11, Testing, Part 2: Integration and System Testing

Transcription:

Steven Zeil February 13, 2013 Contents 1 The Process 3 1

2 Non-Testing V&V 7 2.1 Code Review....... 8 2.2 Mathematically-based verification......................... 19 2.3 Static analysis tools... 23 2.4 Cleanroom software development......................... 29 3 Testing 32 3.1 Unit Testing....... 35 3.2 Integration Testing... 37 4 The Testing Process 40 CS795 2

V & V Verification & Validation: assuring that a software system meets the users needs Principal objectives: The discovery of defects in a system The assessment of whether or not the system is usable in an operational situation. 1 The Process Verification & Validation Verification: CS795 3

"Are we building the product right" The software should conform to its (most recent) specification Validation: "Are we building the right product" The software should do what the user really requires Testing Testing is the act of executing a program with selected data to uncover bugs. CS795 4

As opposed to debugging, which is the process of finding the faulty code responsible for failed tests. Testing is the most common, but not the only form of V&V What Can We Find? Fault: A defect in the source code. Failure: An incorrect behavior or result. Error: A mistake by the programmer, designer, etc., that led to the the fault. Industry figures of 1-3 faults per 100 statements are quite common. CS795 5

In Context V& V is often portrayed as final phase of waterfall In Fuller Context But is more properly a process-wide activity Requirements must be validated Designs may be validated & verified Implementation is tested final system is tested Requirements Specification System Specification maintenence changes are tested High Level Design Low Level Design Acceptance Test Plan System Test Plan Integration Test Plan Implementation & Unit Test CS795 6 System Test Integration Test Service Acceptance Test

2 Non-Testing V&V Static Verification Verifying the conformance of a software system and its specification without executing the code Involves analyses of source text by humans or software Can be carried out on ANY documents produced as part of the software process Discovers errors early in the software process Usually more cost-effective than testing for defect detection at the unit and module level Allows defect detection to be combined with other quality checks CS795 7

Static verification effectiveness It has been claimed that More than 60% of program errors can be detected by informal program inspections More than 90% of program errors may be detectable using more rigorous mathematical program verification 2.1 Code Review Code Review Inspecting the code in an effort to detect errors CS795 8

Desk Checking Inspection Desk Checking An exercise conducted by the individual programmer. Playing computer with the aid of a listing. Values of variables are tracked using pencil and paper as the programmer moves step-by-step through the code. Can be done with pseudocode, diagrams, etc. even before code has been written CS795 9

A good way to find fundamental flaws in algorithms, especially before actually writing the code. Useful in checking the results of an intended change during debugging. Inspection Formalized approach to document reviews Intended explicitly for defect detection (not correction) Defects may be logical errors, anomalies in the code that might indicate an erroneous condition (e.g. an uninitialized variable) or non-compliance with standards CS795 10

Inspection pre-conditions A precise specification must be available Team members must be familiar with the organization standards Syntactically correct code must be available An error checklist should be prepared Management must accept that inspection will increase costs early in the software process Management must not use inspections for staff appraisal CS795 11

Inspection procedure System overview presented to inspection team Code and associated documents are distributed to inspection team in advance Inspection takes place and discovered errors are noted After inspection meeting, Modifications are made to repair discovered errors Re-inspection may or may not be required CS795 12

Inspection checklists Checklist of common errors should be used to drive the inspection Error checklist is programming language dependent The weaker the type checking, the larger the checklist Examples: Initialization, Constant naming, loop termination, array bounds, etc. Inspection checks Data Faults CS795 13

Control Faults I/O Faults Interface faults Storage Mgmt Faults Stylistic/standards Faults Inspection checks Data Faults CS795 14

Are all variables initialized before use? Have all constants been named? Should array lower bounds be 0, 1, or something else? Should array upper bounds be size of the array or size 1? If character strings are used, is a delimited explicitly. Are all data members initialized in every constructor? C++ s Rule of the Big 3 assigned? Inspection checks Control Faults CS795 15

For each conditional statement, is the condition correct? Is each loop certain to terminate? Are compound statements correctly bracketed? In case statements, are all possible cases accounted for? Inspection checks I/O Faults Are all input variables used? Are all output variables assigned before being output? CS795 16

Inspection checks Interface faults Do all function/procedure calls have the correct number of parameters? Do the formal and actual parameter types match? Are the parameters in the right order? If components access shared memory, do they have the same model of the shared memory structure? Inspection checks CS795 17

Storage Mgmt Faults If a linked structure is modified, have all links been correctly assigned? If dynamic storage is used, has space been allocated correctly? Is space explicitly deallocated after it is no longer required? Are all pointer data members deallocated in the destructor? Inspection checks Exception Mgmt Faults Have all possible error conditions been taken into account? CS795 18

Inspection checks Stylistic/standards Faults Are names understandable? Does code conform to standards for commenting? Does code provide capturable outputs for testing? Does code take advantage of possible re-use? 2.2 Mathematically-based verification Mathematically-based verification CS795 19

Verification is based on mathematical arguments which demonstrate that a program is consistent with its specification Programming language semantics must be formally defined The program must be formally specified Program proving Rigorous mathematical proofs that a program meets its specification are long and difficult to produce Some programs cannot be proved because they use constructs such as interrupts. These may be necessary for real-time performance CS795 20

The cost of developing a program proof is so high that it is not practical to use this technique in the vast majority of software projects Program verification arguments Less formal, mathematical arguments can increase confidence in a program s conformance to its specification Must demonstrate that a program conforms to its specification Must demonstrate that a program will terminate CS795 21

Model Checking Simplified models on which porperties can be proved FSA Markov Chains Focus on properties short of correctness e.g., avoiding race conditions Machine-Assisted CS795 22

2.3 Static analysis tools Static analysis tools Software tools for source text processing Try to discover potentially erroneous conditions in a program and bring these to the attention of the V & V team Very effective as an aid to inspections. A supplement to but not a replacement for inspections Static analysis checks CS795 23

Data faults Control faults Interface faults Storage mgmt faults Static analysis checks Data faults Variables used before initialization CS795 24

Variables declared but never used Variables assigned twice but never used between assignments Possible array bounds violations Undeclared variables Static analysis checks Control faults Unreachable code Unconditional branches into loops CS795 25

Static analysis checks Interface faults Parameter type mismatches Parameter number mismatches Function return values unused Uncalled functions and procedures Static analysis checks Storage mgmt faults CS795 26

Unassigned pointers Pointer arithmetic Stages of static analysis Control flow analysis. Checks for loops with multiple exit or entry points, finds unreachable code, etc. Data use analysis. Detects uninitialized variables, variables written twice without an intervening assignment, variables which are declared but never used, etc. CS795 27

Interface analysis. Checks the consistency of routine and procedure declarations and their use Information flow analysis. Identifies the dependencies of output variables. Does not detect anomalies itself but highlights information for code inspection or review Path analysis. Identifies paths through the program and sets out the statements executed in that path. Again, potentially useful in the review process Both these stages generate vast amounts of information. Must be used with care. CS795 28

2.4 Cleanroom software development Cleanroom software development The name is derived from the Cleanroom process in semiconductor fabrication. The philosophy is defect avoidance rather than defect removal Formally Specify System Develop Operational Profile Define Software Increments Construct Structured Program Design Statistical Tests Formally Verify Code Integrate increment Test Integrated System Software development process based on: Incremental development CS795 29

Formal specification. Static verification using correctness arguments Statistical testing to determine program reliability. Cleanroom process teams Specification team. Responsible for developing and maintaining the system specification Development team. Responsible for developing and verifying the software. The software is NOT executed during this process CS795 30

Certification team. Responsible for developing a set of statistical tests to exercise the software after development. Reliability growth models used to determine when reliability is acceptable Results in IBM have been very impressive with few discovered faults in delivered systems Some independent assessment shows that the process is no more expensive than other approaches But no controlled studies And their assessment of other approaches is questionable CS795 31

Fewer errors than in a traditional development process Not clear how this approach can be transferred to an environment with less skilled or less highly motivated engineers 3 Testing Testing stages Unit Test: Tests of individual subroutines and modules, usually conducted by the programmer. Integration Test: Tests of "subtrees of the total project hierarchy chart (groups of subroutines calling each other). CS795 32

generally a team responsibility. System Test: Test of the entire system, supervised by team leaders or by V&V specialists. Many companies have independent teams for this purpose. Regression Test: Unit/Integration/System tests that are repeated after a change has been made to the code. Acceptance Test: A test conducted by the customers or their representatives to decide whether to purchase/accept a developed system. CS795 33

Testing goals Unit Test: does it work? Integration Test: does it work? System Test: does it work? Regression Test: has it changed? Acceptance Test: should we pay for it? CS795 34

3.1 Unit Testing Unit Testing By testing modules in isolation from the rest of the system Easier to design and run extensive tests Much easier to debug any failures Errors caught much earlier Main challenge is how to test in isolation Scaffolding To do Unit tests, we have to provide replacements for parts of the program that we CS795 35

will omit from the test. Scaffolding is any code that we write, not as part of the application, but simply to support the process of Unit and Integration testing. Scaffolding comes in two forms Drivers Stubs Drivers A driver is test scaffolding that calls the module being tested. CS795 36

Often just a simple main program that reads values, uses them to construct ADT values, apply ADT operations and print the results 3.2 Integration Testing Integration Testing Integration testing is testing that combines several modules, but still falls short of exercising the entire program all at once. Integration testing usually combines a small number of modules that call upon one another. Integration testing can be conducted CS795 37

bottom-up (start by unit-testing the modules that dont call anything else, then add the modules that call those starting modules and thest the combination, then add the modules that call those, and so on until you are ready to test main().) * relieves the need for stubs or top-down (start by unit-testing main() with stubs for everything it calls, then replace those stubs by the real code, but leaving in stubs for anything called from the replacement code, then replacng those stubs, and so on, until you have assembled and tested the entire program). Types of testing CS795 38

Statistical testing tests designed to reflect the frequence of user inputs. Used for reliability estimation. Defect testing Tests designed to discover system defects. A successful defect test is one which reveals the presence of defects in a system. CS795 39

4 The Testing Process The Testing Process Test Plan Test Cases Expected Outputs Inputs & Expected Outputs Derive Inputs Inputs Execute Tests Actual Outputs Oracle Failures Debug Regression Log Faults Testing Process Components Test case: a general description of a required test CS795 40

There may be many possible inputs that would serve Regression Log: Database of tests and expected outputs Used during regression testing to quickly rerun old tests Oracle: The process, person, and/or program that determines if test output is correct Failure: An execution on which incorrect behavior occurs Fault: A defect in the code that (may) cause a failure Error: A human mistake that results in a fault CS795 41