Testing the Programs 中国科学技术大学软件学院 孟宁 2010 年 12 月.

Slides:



Advertisements
Similar presentations
1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
Advertisements

SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
ISBN Prentice-Hall, 2006 Unit 6 Writing the Programs Copyright 2006 Pearson/Prentice Hall. All rights reserved.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
ISBN Prentice-Hall, 2006 Chapter 8 Testing the Programs Copyright 2006 Pearson/Prentice Hall. All rights reserved.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Integration testing Satish Mishra
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Illinois Institute of Technology
CS 425/625 Software Engineering Software Testing
Outline Types of errors Component Testing Testing Strategy
Lecturer: Dr. AJ Bieszczad Chapter 87-1 How does software fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible.
Software Testing Name: Madam Currie Course: Swen5431 Semester: Summer 2K.
Software Testing & Strategies
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
Bottom-Up Integration Testing After unit testing of individual components the components are combined together into a system. Bottom-Up Integration: each.
Software System Integration
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
CH08: Testing the Programs
ECE 355: Software Engineering
Overview Integration Testing Decomposition Based Integration
The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program.
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee
CS4311 Spring 2011 Verification & Validation Dr. Guoqiang Hu Department of Computer Science UTEP.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Testing.
Maintaining the System 中国科学技术大学软件学院 孟宁 2012 年 11 月.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
The Future of Software Engineering 中国科学技术大学软件学院 孟宁 2010 年 12 月.
Software Testing ©Dr. David A. Workman School of EE and Computer Science March 19, 2007.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Delivering the System 中国科学技术大学软件学院 孟宁 2012 年 11 月.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Unit 7 Chapter 8 Testing the Programs. Unit 7 Requirements Read Chapters 8 and 9 Respond to the Unit 7 Discussion Board (25 points) Attend seminar/Take.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Testing the System 中国科学技术大学软件学院 孟宁 2010年12月.
计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Testing the programs In this part we look at classification of faults the purpose of testing unit testing integration testing strategies when to stop testing.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
ISBN Prentice-Hall, 2006 Chapter 8 Testing the Programs Copyright 2006 Pearson/Prentice Hall. All rights reserved.
Integration testing Integrate two or more module.i.e. communicate between the modules. Follow a white box testing (Testing the code)
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Chapter 8 Testing the Programs. Integration Testing  Combine individual comp., into a working s/m.  Test strategy gives why & how comp., are combined.
Chapter 8 Testing the Programs 8.1 Software Faults and Failures 1. Introduction  faults: A: definition: the problem caused by error B: cause: X: the software.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Software Testing. Software Quality Assurance Overarching term Time consuming (40% to 90% of dev effort) Includes –Verification: Building the product right,
Software Testing Strategies for building test group
Software Testing.
Group mambers: Maira Naseer (BCS ).
Software Engineering TESTING Compiled by: Dr. S. Prem Kumar
Chapter 9, Testing.
Software Testing Techniques
Verification and Validation Overview
Some Simple Definitions for Testing
Lecture 09:Software Testing
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Verification and Validation Unit Testing
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
Testing the Programs 东华理工大学软件学院 李祥.
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CS410 – Software Engineering Lecture #11: Testing II
Software Testing Strategies
Presentation transcript:

Testing the Programs 中国科学技术大学软件学院 孟宁 2010 年 12 月

Contents 8.1Software Faults and Failures 8.2Testing Issues 8.3Unit Testing 8.4Integration Testing 8.5Testing Object Oriented Systems 8.6Test Planning 8.7Automated Testing Tools 8.8When to Stop Testing

Chapter 8 Objectives ♦Types of faults and how to clasify them ♦The purpose of testing ♦Unit testing ♦Integration testing strategies ♦Test planning ♦When to stop testing

8.1 Software Faults and Failures Why Does Software Fail? ♦Wrong requirement: not what the customer wants ♦Missing requirement ♦Requirement impossible to implement ♦Faulty design ♦Faulty code ♦Improperly implemented design

8.1 Software Faults and Failures Objective of Testing ♦Objective of testing: discover faults ♦A test is successful only when a fault is discovered –Fault identification is the process of determining what fault caused the failure –Fault correction is the process of making changes to the system so that the faults are removed

8.1 Software Faults and Failures Types of Faults ♦Algorithmic fault ♦Computation and precision fault –a formula’s implementation is wrong ♦Documentation fault –Documentation doesn’t match what program does ♦Capacity or boundary faults –System’s performance not acceptable when certain limits are reached ♦Timing or coordination faults ♦Performance faults –System does not perform at the speed prescribed ♦Standard and procedure faults

8.1 Software Faults and Failures Typical Algorithmic Faults ♦An algorithmic fault occurs when a component’s algorithm or logic does not produce proper output –Branching too soon –Branching too late –Testing for the wrong condition –Forgetting to initialize variable or set loop invariants –Forgetting to test for a particular condition –Comparing variables of inappropriate data types ♦Syntax faults

8.1 Software Faults and Failures Orthogonal Defect Classification 正交缺陷 分类 Fault TypeMeaning FunctionFault that affects capability, end-user interface, product interface with hardware architecture, or global data structure InterfaceFault in interacting with other component or drivers via calls, macros, control, blocks or parameter lists CheckingFault in program logic that fails to validate data and values properly before they are used AssignmentFault in data structure or code block initialization Timing/serializationFault in timing of shared and real-time resources Build/package/mergeFault that occurs because of problems in repositories management changes, or version control DocumentationFault that affects publications and maintenance notes AlgorithmFault involving efficiency or correctness of algorithm or data structure but not design

8.1 Software Faults and Failures Sidebar 8.1 Hewlett-Packard’s Fault Classification

8.1 Software Faults and Failures Sidebar 8.1 Faults for one Hewlett-Packard Division

8.2 Testing Issues Testing Organization ♦Module testing, component testing, or unit testing ♦Integration testing ♦Function testing ♦Performance testing ♦Acceptance testing ♦Installation testing

8.2 Testing Issues Testing Organization Illustrated

8.2 Testing Issues Attitude Toward Testing ♦Egoless programming: programs are viewed as components of a larger system, not as the property of those who wrote them

8.2 Testing Issues Who Performs the Test? ♦Independent test team –avoid conflict –improve objectivity –allow testing and coding concurrently

8.2 Testing Issues Views of the Test Objects ♦Closed box or black box: functionality of the test objects ♦Clear box or white box: structure of the test objects

8.2 Testing Issues White Box ♦Advantage –free of internal structure’s constraints ♦Disadvantage –not possible to run a complete test

8.2 Testing Issues Clear Box Example of logic structure

8.2 Testing Issues Factors Affecting the Choice of Test Philosophy ♦The number of possible logical paths ♦The nature of the input data ♦The amount of computation involved ♦The complexity of algorithms

8.3 Unit Testing Code Review ♦Code walkthrough ♦Code inspection

8.3 Unit Testing Typical Inspection Preparation and Meeting Times Development ArtifactPreparation TimeMeeting Time Requirement Document25 pages per hour12 pages per hour Functional specification45 pages per hour15 pager per hour Logic specification50 pages per hour20 pages per hour Source code150 lines of code per hour 75 lines of code per hour User documents35 pages per hour20 pages per hour

8.3 Unit Testing Fault Discovery Rate Discovery Activity Fault Found per Thousand Lines of Code Requirements review2.5 Design Review5.0 Code inspection10.0 Integration test3.0 Acceptance test2.0

8.3 Unit Testing Proving Code Correct ♦Formal proof techniques 形式化证明技术 ♦Symbolic execution 符号执行 ♦Automated theorem-proving 自动定理证明

8.3 Unit Testing Testing versus Proving ♦Proving: hypothetical 假想的 environment ♦Testing: actual operating environment

8.3 Unit Testing Steps in Choosing Test Cases ♦Determining test objectives ♦Selecting test cases ♦Defining a test

8.3 Unit Testing Test Thoroughness ♦Statement testing ♦Branch testing ♦Path testing ♦Definition-use testing ♦All-uses testing ♦All-predicate-uses/some-computational- uses testing ♦All-computational-uses/some-predicate- uses testing

8.3 Unit Testing Relative Strengths of Test Strategies

8.3 Unit Testing Comparing Techniques ♦Fault discovery Percentages by Fault Origin Discovery TechniquesRequirementsDesignCodingDocumentation Prototyping Requirements review Design Review Code inspection Unit testing15200

8.3 Unit Testing Comparing Techniques (continued) Effectiveness of fault-discovery techniques Requirements FaultsDesign FaultsCode Faults Documentation Faults ReviewsFairExcellent Good PrototypesGoodFair Not applicable TestingPoor GoodFair Correctness ProofsPoor Fair

8.4 Integration Testing ♦Bottom-up ♦Top-down ♦Big-bang ♦Sandwich testing ♦Modified top-down ♦Modified sandwich

8.4 Integration Testing Terminology ♦Component Driver: a routine that calls a particular component and passes a test case to it ♦Stub: a special-purpose program to simulate the activity of the missing component

8.4 Integration Testing View of a System ♦System viewed as a hierarchy of components

8.4 Integration Testing Bottom-Up Integration Example ♦The sequence of tests and their dependencies

8.4 Integration Testing Top-Down Integration Example ♦Only A is tested by itself

8.4 Integration Testing Modified Top-Down Integration Example ♦Each level’s components individually tested before the merger takes place

8.4 Integration Testing Bing-Bang Integration Example ♦Requires both stubs and drivers to test the independent components

8.4 Integration Testing Sandwich Integration Example ♦Viewed system as three layers

8.4 Integration Testing Modified Sandwich Integration Example ♦Allows upper-level components to be tested before merging them with others

8.4 Integration Testing Comparison of Integration Strategies Bottom- up Top- down Modified top-down Bing- bang SandwichModified sandwich IntegrationEarly LateEarly Time to basic working program LateEarly LateEarly Component drivers needed YesNoYes Stubs neededNoYes Work parallelism at beginning MediumLowMediumHighMediumHigh Ability to test particular paths EasyHardEasy MediumEasy Ability to plan and control sequence EasyHard EasyHardhard

8.4 Integration Testing Sidebar 8.5 Builds at Microsoft ♦The feature teams synchronize their work by building the product and finding and fixing faults on a daily basis

8.5 Testing Object-Oriented Systems Easier and Harder Parts of Testing OO Systems ♦OO unit testing is less difficult, but integration testing is more extensive

8.6 Test Planning ♦Establish test objectives ♦Design test cases ♦Write test cases ♦Test test cases ♦Execute tests ♦Evaluate test results

8.6 Test Planning Purpose of the Plan ♦Test plan explains –who does the testing –why the tests are performed –how tests are conducted –when the tests are scheduled

8.6 Test Planning Contents of the Plan ♦What the test objectives are ♦How the test will be run ♦What criteria will be used to determine when the testing is complete

8.7 Automated Testing Tools ♦Code analysis –Static analysis code analyzer structure checker data analyzer sequence checker Output from static analysis

8.7 Automated Testing Tools (continued) ♦Dynamic analysis –program monitors: watch and report program’s behavior ♦Test execution –Capture and replay –Stubs and drivers –Automated testing environments ♦Test case generators

8.8 When to Stop Testing More faulty? ♦Probability of finding faults during the development

8.8 When to Stop Testing Stopping Approaches ♦Coverage criteria 覆盖准则 ♦Fault seeding detected seeded Faults = detected nonseeded faults total seeded faults total nonseeded faults ♦Confidence in the software 软件可信度 – 可以用播种的方法计算可信度

8.8 When to Stop Testing Identifying Fault-Prone( 倾向 ) Code

What this Chapter Means for You ♦It is important to understand the difference between faults and failures ♦The goal of testing is to find faults, not to prove correctness

谢谢大家! References 软件工程 - 理论与实践(第四版 影印版) Software Engineering: Theory and Practice (Fourth Edition),Shari Lawrence Pfleeger,Joanne M. Atlee, 高等教育出版社 软件工程 - 理论与实践(第四版) Software Engineering: Theory and Practice (Fourth Edition),Shari Lawrence Pfleeger,Joanne M. Atlee, 杨卫 东译, 人民邮电出版社 软件工程 — 实践者的研究方法( Software Engineering-A Practitioner’s Approach ) ; ( 美 ) Roger S. Pressman 著; 机械工业出版社 ISBN :