Chapter 10. Testing and Quality Assurance

Similar documents
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

Topics in Software Testing

[IT6004-SOFTWARE TESTING] UNIT 2

CS 424 Software Quality Assurance & Testing LECTURE 3 BASIC CONCEPTS OF SOFTWARE TESTING - I

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

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

Software Quality Assurance. David Janzen

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

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

QUIZ #5 - Solutions (5pts each)

Part 5. Verification and Validation

Darshan Institute of Engineering & Technology for Diploma Studies

Chapter 9 Quality and Change Management

Examination Questions Time allowed: 1 hour 15 minutes

Lecture 15 Software Testing

Pearson Education 2007 Chapter 9 (RASD 3/e)

Aerospace Software Engineering

Sample Exam Syllabus

Software Testing Interview Question and Answer

Software Engineering (CSC 4350/6350) Rao Casturi

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

People tell me that testing is

Software Engineering Fall 2014

Chapter 8 Software Testing. Chapter 8 Software testing

10. Software Testing Fundamental Concepts

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

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

Introduction to Dynamic Analysis

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

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.

Software Testing. Software Testing

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

Static Analysis Techniques

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

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

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

Ingegneria del Software Corso di Laurea in Informatica per il Management

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

Pearson Education 2005 Chapter 9 (Maciaszek - RASD 2/e) 2

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

Quality Assurance = Testing? SOFTWARE QUALITY ASSURANCE. Meaning of Quality. How would you define software quality? Common Measures.

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks

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

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

Software Development. Software Testing: Verification and Validation. Verification and Validation (V&V) Verification. Validation

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Certified Tester Foundation Level(CTFL)

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

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

QA Best Practices: A training that cultivates skills for delivering quality systems

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Manuel Oriol, CHCRC-C, Software Testing ABB

Testing Process and Methods. CS 490MT/5555, Spring 2017, Yongjie Zheng

INTRODUCTION TO SOFTWARE ENGINEERING

CS314 Software Engineering Peer Reviews

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

Software Testing. Testing: Our Experiences

Testing is executing a system in order to identify any gaps, errors, or missing requirements in contrary to the actual requirements.

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia

Software Testing CS 408

Software Testing. An Overview

An Introduction to Systematic Software Testing. Robert France CSU

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

Subject: Software Engineering & UML (MCA 401)

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

Course Wrap-Up. Software Testing and Verification. Stephen M. Thebaut, Ph.D. Prepared by. University of Florida

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing

Skill Category 6 - Summary Walkthroughs, Checkpoint Reviews and Inspections

Software Testing. Massimo Felici IF

Software technology 7. Testing (2) BSc Course Dr. Katalin Balla

Computational Systems COMP1209

Verification and Validation

It is primarily checking of the code and/or manually reviewing the code or document to find errors This type of testing can be used by the developer

UNIT OBJECTIVE. Understand what system testing entails Learn techniques for measuring system quality

Quality Assurance in Software Development

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

Tuesday, November 15. Testing

Static and dynamic Testing

Sample Question Paper. Software Testing (ETIT 414)

Chapter 8. Achmad Benny Mutiara

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

Chap 2. Introduction to Software Testing

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD

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

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

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

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

Programming Embedded Systems

Software Quality. Richard Harris

Simulink Verification and Validation

340 Review Fall Midterm 1 Review

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

MONIKA HEINER.

WHY TEST SOFTWARE?...

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

Advanced Software Engineering: Software Testing

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Transcription:

Chapter 10 Testing and Quality Assurance

Different styles of doing code review

Human Reviewer Code Inspection with continuous integration infrastructure

Pinger s testing set up

Testing Related topics 1. Understand basic techniques for software verification and validation 2. Analyze basics of software testing and testing techniques 3. Discuss the concept of inspection process

similar Introduction Quality Assurance (QA): activities designed to measure and improve quality in a product --- and process Quality control (QC): activities designed to validate & verify the quality of the product through detecting faults and fixing the defects Need good techniques, process, tools and team

What is Quality? Two traditional definitions: Conforms to requirements Fit to use Verification: checking the software conforms to its requirements (did the software evolve from the requirements properly) Validation: checking software meets user requirements (fit to use)

Some Error Detection Techniques (finding errors) Testing: executing program in a controlled environment and verifying/validating output Inspections and Reviews Formal methods (proving software correct) Static analysis detects error-prone conditions

Faults and Failures Error: a mistake made by a programmer or software engineer which caused the fault, which in turn may cause a failure Fault (defect, bug): condition that may cause a failure in the system Failure (problem): inability of system to perform a function according to its spec due to some fault Fault or Problem severity (based on consequences) Fault or Problem priority (based on importance of developing a fix which is in turn based on severity)

Testing Activity performed for Evaluating product quality Improving products by identifying defects and having them fixed prior to software release. Dynamic (running-program) verification of program s behavior on a finite set of test cases selected from execution domain Not always done! Testing can NOT prove product works 100%- - - even though we use testing to demonstrate that parts of the software works

Testing Who tests Programmers Testers/Req. Analyst Users What is tested Unit Code testing Functional Code testing Integration/system testing User interface testing Why test Acceptance (customer) Conformance (std, laws, etc) Configuration (user.vs. dev.) Performance, stress, security, etc. How (test cases designed) Intuition Specification based (black box) Code based (white-box) Existing cases (regression)

Unit Test Functional Test Unit Test..... Functional Test Component Test. Component Test System/Regression Test Unit Test Progression of Testing

Equivalence Class partitioning Divide the input into several groups, deemed equivalent for purposes of finding errors. Example: pick larger of two integers and ------- Pick one representative for each class used for testing. Class Equivalence classes determined by req./des. specifications and some intuition 1.Lessen duplication 2.Complete coverage First > Second 10,7 Second > First 8,12 First = second 36, 36 Representative

Simple Example of Equivalence Testing Suppose we have n distinct functional requirements. Suppose further that these n functional requirements are such that r1 U r2 U ------ U rn = all n requirements and ri rj = θ We can devise a test scenario, ti, for each of the ri functionality to check if ri works. Then: t1 U t2 U --------- tn = all the test cases to cover the software functionalities. Note that there may be more than one ti for ri. But picking only one from the set of potential test cases for ri, we form an equivalence class of test cases

Boundary Value analysis (A Black-Box technique) Past experiences show that Boundaries are error-prone Do equivalence-class partitioning, add test cases for boundaries (at boundary, outside, inside) Reduced cases: consider boundary as falling between numbers If boundary is at12, normal: 11,12,13; reduced: 12,13 (boundary 12 and 13) Large number of cases (~3 per boundary) Good for ordinal values

Boundaries of the input values 1 <= number of employees, n <= 1000000 1 n 1000000 1 1 <= employee age <= 150 age 150 The basic boundary value testing for a value would include: 1. - at the minimum boundary 2. - immediately above minimum 3. - between minimum and maximum (nominal) 4. - immediately below maximum 5. - at the maximum boundary ** note that we did not include the outside of the boundaries here**

Path Analysis White-Box technique Two tasks 1. Analyze number of paths in program 2. Decide which ones to test Decreasing coverage: Logical paths Independent paths Branch coverage Statement coverage 4 S1 C1 S3 1 3 2 S2 Path1 : S1 C1 S3 Path2 : S1 C1 S2 S3 OR Path1: segments (1,4) Path2: segments (1,2,3)

S1 1 C1 2 S2 8 5 The 4 Independent Paths Covers: C2 6 C3 3 4 S3 S4 9 10 Path1: includes S1-C1-S2-S5 Path2: includes S1-C1-C2-S3-S5 Path3: includes S1-C1-C2-C3-S4-S5 Path4: includes S1-C1-C2-C3-S5 7 S5 A CASE Structure

Example with a Loop S1 1 C1 4 S3 2 S2 Linearly Independent Paths are: 3 path1 : S1-C1-S3 (segments 1,4) path2 : S1-C1-S2-C1-S3 (segments 1,2,3,4) A Simple Loop Structure

Linearly Independent Set of Paths Consider path1, path2 and path3 as the Linearly Independent Set 2 S1 3 C1 1 path1 path2 1 2 3 4 5 6 1 1 1 1 1 4 C2 5 path3 path4 1 1 1 1 1 1 1 S2 6 Remember McCabe s Cyclomatic number? It is the same as linearly independent set of paths

Total # of Paths and Linearly Independent Paths 3 5 S3 8 S5 7 S1 1 C1 C2 C3 4 2 S2 6 9 S4 Since for each binary decision, there are 2 paths and there are 3 in sequence, there are 2 3 = 8 total logical paths path1 : S1-C1-S2-C2-C3-S4 path2 : S1-C1-S2-C2-C3-S5 path3 : S1-C1-S2-C2-S3-C3-S4 path4 : S1-C1-S2-C2-S3-C3-S5 path5 : S1-C1-C2-C3-S4 path6 : S1-C1-C2-C3-S5 path7 : S1-C1-C2-S3-C3-S4 path8 : S1-C1-C2-S3-C3-S5 How many Linearly Independent paths are there? Using Cyclomatic number = 3 decisions +1 = 4 One set would be: path1 : includes segments (1,2,4,6,9) path2 : includes segments (1,2,4,6,8) path3 : includes segments (1,2,4,5,7,9) path5 : includes segments (1,3,6,9)

Combinations of Conditions Function of several related variables To fully test, we need all possible combinations (of equivalence classes) How to reduce testing: Coverage analysis Assess important (e.g. main functionalities) cases Test all pairs of relations (but not all combinations)

Unit Testing Unit Testing: Test each individual unit Usually done by the programmer Test each unit as it is developed (small chunks) Keep test cases/results around (use Junit or xxxunit) Allows for regression testing Facilitates refactoring Tests become documentation!!

Test-Driven development Write unit-test cases BEFORE the code! Tests cases are / becomes requirements Forces development in small steps Steps: 1. Write test case & code 2. Verify (it fails or runs) 3. Modify code so it succeeds 4. Rerun test case, previous tests 5. Refactor until (success and satisfaction)

When to stop testing? Simple answer, stop when All planned test cases are executed All those problems that are found are fixed Other techniques: Stop when you are not finding any more errors Defect seeding -- test until all (or % of )the seeded bugs found NOT -- when you ran out of time -- poor planning!

Defect Seeding Seed the program (component) Generate and scatter with x number of bugs & do not tell the testers. - set a % (e. g. 95%) of seed bugs found as stopping criteria Suppose y number of the x seed bugs are found If (y/x) > (stopping percentage); stop testing If (y/x) (stopping percentage), keep on testing Get a feel of how many bugs may still remain: Suppose you discovered u non-seeded bugs through testing Set y/x = u/v ; v = (u * x)/y Then there is most likely (v-u) bugs still left in the software.

Problem Find Rate Problem Find Rate (y) # of Problems Found per hour y = ae -bx Class of curves Time (x) Day 1 Day 2 Day 3 Day 4 Day 5 Decreasing Problem Find Rate

Inspections and Reviews Review: any process involving human testers reading and understanding a document and then analyzing it with the purpose of detecting errors Walkthrough: author explaining document to team of people Software inspection: detailed reviews of work in progress, following Fagan s method.

Software Inspections Steps: 1. Planning 2. Overview 3. Preparation 4. Inspection 5. Rework 6. Follow-Up Focused on finding defects Output: list of defects Team of: 3-6 people Author included People working on related efforts Moderator, reader, scribe

Inspections vs Testing Inspections Partially Cost-effective Can be applied to intermediate artifacts Catches defects early Helps disseminate knowledge about project and best practices Testing Finds errors cheaper, but correcting them is expensive Can only be applied to code Catches defects late (after implementation) Necessary to gauge quality

Formal Methods Mathematical techniques used to prove that a program works Used for requirements/design/algorithm specification Prove that implementation conforms to spec Pre and Post conditions Problems: Require math training Not applicable to all programs Only verification, not validation Not applicable to all aspects of program (e.g. UI or maintainability)

Static Analysis Examination of static structures of design/code for detecting error-prone conditions (cohesion --- coupling) Automatic program tools are more useful Can be applied to: Intermediate documents (but in formal model) Source code Executable files Output needs to be checked by programmer