计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院 www.jiahenglu.net.

Slides:



Advertisements
Similar presentations
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Advertisements

Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Test process essentials Riitta Viitamäki,
Lecture 8: Testing, Verification and Validation
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software Testing. Overview Definition of Software Testing Problems with Testing Benefits of Testing Effective Methods for Testing.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
BY: GARIMA GUPTA MCA FINAL YEAR WHAT IS SOFTWARE TESTING ? SOFTWARE TESTING IS THE PROCESS OF EXECUTING PROGRAMS OR SYSTEM WITH THE INTENT.
System/Software Testing
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
TESTING.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
Software Testing (Part 2)
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Engineering Chapter 23 Software Testing Ku-Yaw Chang Assistant Professor Department of Computer Science and Information.
1 Testing Course notes for CEN Outline  Introduction:  terminology and philosophy  Factors that influence testing  Testing techniques.
计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Lecture 11 Testing and Debugging SFDV Principles of Information Systems.
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.
CSE 219 Computer Science III Testing. Testing vs. Debugging Testing: Create and use scenarios which reveal incorrect behaviors –Design of test cases:
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
COMP 121 Week 1: Testing and Debugging. Testing Program testing can be used to show the presence of bugs, but never to show their absence! ~ Edsger Dijkstra.
Black-box Testing.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Construction Lecture 19 Software Testing-2.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
08120: Programming 2: SoftwareTesting and Debugging Dr Mike Brayshaw.
Software Testing Mehwish Shafiq. Testing Testing is carried out to validate and verify the piece developed in order to give user a confidence to use reliable.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
Dynamic Testing.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
October 21, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
ISQB Software Testing Section Meeting 10 Dec 2012.
Software Testing.
Software Testing.
SOFTWARE TESTING OVERVIEW
Chapter 9, Testing.
Software Testing An Introduction.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Lecture 09: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.
Software Testing “If you can’t test it, you can’t design it”
Software Testing COM /12/2019 Testing/Spring 98.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing.
08120: Programming 2: SoftwareTesting and Debugging
Presentation transcript:

计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院

Software Quality and Testing (软件质量与测试)

“Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.

No matter how well software has been designed and coded, it will inevitably still contain defects Testing is the process of executing a program with the intent of finding defects A “successful” test is one that finds errors, not one that doesn’t find errors

“Quality” is Hard to Pin Down (软件质量是很难衡量的) Concise, clear definition is elusive Not easily quantifiable Many things to many people “You'll know it when you see it”

Good Quality Software Has… Understandability (可理解的) –The ability of a reader of the software to understand its function –Critical for maintenance Modifiability (可修改的) –The ability of the software to be changed by that reader –Almost defines "maintainability"

Good Quality Software Has… Reliability (可靠的) –The ability of the software to perform as intended without failure –If it isn't reliable, the maintainer must fix it Efficiency (高效的) –The ability of the software to operate with minimal use of time and space resources –If it isn't efficient, the maintainer must improve it

Good Quality Software Has… Testability (可测试的) –The ability of the software to be tested easily –Finding/fixing bugs is part of maintenance –Enhancements/additions must also be tested Usability (可用的) –The ability of the software to be easily used (human factors) –Not easily used implies more support calls, enhancements, corrections

Good Quality Software Has… Portability (可升级的) –The ease with which the software can be made useful in another environment –Porting is usually done by the maintainer Notice all related to maintenance but these qualities need to be instilled during development

Why Test? No matter how well software has been designed and coded, it will inevitably still contain defects Testing is the process of executing a program with the intent of finding faults (bugs) A “successful” test is one that finds errors, not one that doesn’t find errors

Why Test? Testing can “prove” the presence of faults, but can not “prove” their absence But can increase confidence that a program “works”

What to Test? Unit test – test of small code unit: file, class, individual method or subroutine Integration test – test of several units combined to form a (sub)system, preferably adding one unit at a time System (alpha) test – test of a system release by “independent” system testers Acceptance (beta) test – test of a release by end-users or their representatives

When to Test? Early “Agile programming” developers write unit test cases before coding each unit Many software processes involve writing (at least) system/acceptance tests in parallel with development Often Regression testing: rerun unit, integration and system/acceptance tests –After refactoring –Throughout integration –Before each release

Defining a Test Goal – the aspect of the system being tested Input – specify the actions and conditions that lead up to the test as well as the input (state of the world, not just parameters) that actually constitutes the test Outcome – specify how the system should respond or what it should compute, according to its requirements

Types of software testing Unit testing –Test the basic pieces, e.g. methods Integration testing –Combinations of units System testing –“Black-box” or acceptance testing Regression testing –Make sure changes don’t break anything

Other types of testing Obsession testing –“I’ll fix this bug if it’s the last thing I do.” Aggression testing –“If this doesn’t work, I’m gonna kill somebody.” Depression testing –“If this doesn’t work, I’m gonna kill myself.”

Unit Testing (单元测试)

Unit Testing Overview Unit testing is testing some program unit in isolation from the rest of the system Usually the programmer is responsible for testing a unit during its implementation Easier to debug when a test finds a bug (compared to full-system testing)

Unit Testing Strategies Black box (specification-based) testing White box (program-based) testing, aka glass-box Normally perform both (not alternatives!)

White Box Testing (白盒测试) Test suite constructed by inspecting the program (code) Look at specification (requirements, design, etc.) only to determine what is an error Attempt to exercise all statements, all branches, or all paths (control flow and/or data flow) Intuition: If you never tested that part of the code, how can you have any reason to believe that it works?

Whitebox Approaches to Unit Testing 1.Execute all (reachable) statements 2.Execute all branches of logical decisions, including boundaries of loops 3.Execute all (feasible) control flow paths in combination 4.Execute all data flow paths (from each variable definition to all its uses) Usually applied only to individual subroutines rather than larger unit (due to combinatorics)

Black Box Testing Test suite constructed by inspecting the specification (requirements, design, etc.), not the source code Tests unit against functional and, sometimes, extra-functional specifications (e.g., resource utilization, performance, security) Attempts to force behavior (outcome) that doesn't match specification

Blackbox Approaches to Unit Testing Functional testing – exercise code with valid or nearly valid input for which the expected outcome is known (outcome includes global state and exceptions as well as output) Exhaustive testing usually infeasible, so need way(s) to select test cases and determine when “done” testing Choose test cases to attempt to find different faults –Equivalence partitioning –Boundary value analysis

Automated Testing Testing by hand is tedious, slow, error-prone and not fun Computers are much less easily bored than people So write code to test your code!

Automated Testing Write code to set up the unit, call its methods with test inputs, and compare the results to the known correct answers Once tests are written, they are easy to run, so you are much more likely to run them JUnit is a commonly used tool for testing

Unit Testing Summary Unit testing is testing some program unit in isolation from the rest of the system Usually the programmer is responsible for testing a unit during its implementation Strategies: –Black box (specification-based) testing –White box (program-based) testing Normally perform both (not alternatives!)