Jason I. Hong CS169 - Software Engineering, Fall 1998 Testing Strategies.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Test Yaodong Bi.
Lecture 8: Testing, Verification and Validation
Testing and Quality Assurance
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.
Practical Testing Techniques. Verification and Validation Validation –does the software do what was wanted? “Are we building the right system?” –This.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 20 Slide 1 Critical systems development.
Testing and Debugging CS221 – 2/13/09. Airline Program.
Testing: Who 3, What 4, Why 1, When 2, How 5 Lian Yu, Peking U. Michal Young, U. Oregon.
10 Verification All changes in the code have to be verified –refactoring –actualization Essential difficulties –programmers very often produce imperfect.
CS CS 5150 Software Engineering Lecture 22 Reliability 2.
Illinois Institute of Technology
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Software Development Overview CPSC 315 – Programming Studio Spring 2008.
Implementation. We we came from… Planning Analysis Design Implementation Identify Problem/Value. Feasibility Analysis. Project Management. Understand.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
Types and Techniques of Software Testing
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
Functional Testing Test cases derived from requirements specification document – Black box testing – Independent testers – Test both valid and invalid.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
Terms: Test (Case) vs. Test Suite
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
System/Software Testing
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Introduction to Unit Testing Jun-Ru Chang 2012/05/03.
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
TESTING.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Software testing basic. Main contents  Why is testing necessary?  What is testing?  Test Design techniques  Test level  Test type  How to write.
Software Testing Testing principles. Testing Testing involves operation of a system or application under controlled conditions & evaluating the results.
Lecture 11 Testing and Debugging SFDV Principles of Information Systems.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
CS CS 5150 Software Engineering Lecture 20 Reliability 2.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
(1) Unit Testing and Test Planning CS2110: SW Development Methods These slides design for use in lab. They supplement more complete slides used in lecture.
Software Testing Łukasz Wojcieszek s2690 Tomasz Wyrzuc s2675.
Sylnovie Merchant, Ph.D. MIS 161 Spring 2005 MIS 161 Systems Development Life Cycle II Lecture 5: Testing User Documentation.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
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 Defects.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
Dynamic Testing.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
CS 160 and CMPE/SE 131 Software Engineering April 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
SOFTWARE TESTING SOFTWARE TESTING Presented By, C.Jackulin Sugirtha-10mx15 R.Jeyaramar-10mx17K.Kanagalakshmi-10mx20J.A.Linda-10mx25P.B.Vahedha-10mx53.
Software Testing Kobla Setriakor Nyomi Faculty Intern (Programming II)
Chapter 9, Testing.
Chapter 8 – Software Testing
Some Simple Definitions for Testing
Software testing strategies 2
Software Testing (Lecture 11-a)
CSE 303 Concepts and Tools for Software Development
Baisc Of 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.
Java & Testing.
CSE 1020:Software Development
Presentation transcript:

Jason I. Hong CS169 - Software Engineering, Fall 1998 Testing Strategies

Types of Testing

Scope –Unit Testing tests a subroutine, module, or class –Integration Testing tests multiple units together –System Testing tests entire system as a whole Some Testing Goals –Functional Testing tests functions in system –Performance Testing tests system performance primarily execution time, memory footprint –Reliability Testing certifies system reliability predictable execution time, low number of failures, etc.

Black Box Testing Define test cases based only on specifications Try all boundary conditions –Go from empty to full, full to empty –Array bounds –Empty or null values Should be done by someone other than the module programmer –Needs a shift in mindset away from programming –Programmers don’t want to find bugs, testers do

White Box Testing Define test cases by looking at code Not as useful as code review or code coverage Useful for regression testing

Code Coverage Create test cases that execute every block of code at least once Complete code coverage does not imply correct code Ideally, we would like to test every path but this is exponential –e.g. all possibilities in switch statements Useful for regression testing

Code Review Read through someone else’s code –Extremely effective at finding defects Look for common errors –Possible unhandled error conditions –Potential array out of bounds (e.g. gets) –Bad or dangerous type casting –Memory leaks (e.g. alloc w/o dealloc) –Too many global variables (high complexity) –Not cleaning up after self (e.g. goto, return) –...

Regression Testing Maintain suite of tests Build product periodically and run test suite –Automatically verify that output is correct –Find reason for failure (test wrong or code wrong) Good metric for quality –Can always tell if going forward or not –Requires significant process maturity from company Continually add new tests as bugs are fixed –Ensures that old bugs do not reappear –Forces discipline on developers

Stress Testing Place large load on product (typically a server) Each client sends multiple requests –Some valid requests, some junk requests Look for: –Increasing memory footprint (memory leak?) –Running out of resources (sockets, file descriptor) –Increased response time (slows over time?) –Incorrect results (possible race conditions?)

User Testing Perhaps the most important kind of testing –Can customers use the product easily? –How many errors do users make? –How long does it take users to learn the system? –Do customers like the product? Enjoy using it? –Without customers, you have no product. Best strategy is iterative development –Expensive to change product at end, so build cheap prototypes and evaluate with users at beginning –Hire real designers! Programmers != designers –Take CS160 for more informationCS160

Alpha and Beta Testing Alpha testing –Product is released to very small and focused group Beta testing –Product is released to wider range of people Difficult to make significant changes once Alpha and Beta Testing is reached –Use for polishing, finding compatibility problems, fixing simple errors, and finding workarounds –Do not use for evaluating usability or quality, a common mistake still made by many companies

Some Statistics Unit testing finds 10-50% of defects System testing finds 20-60% of defects Combined rate < 60% of defects Informal code review finds 30-70% of defects Formal inspection finds 60-90% of defects, net savings of 10-30% Reviews are more cost effective than testing –Using reviews with testing helps software quality See Rapid Development pp72-75

Development Notes Back-to-Back algorithms –Use two implementations and compare results –Microsoft Excel does this for cell calculations –UWash Kimera Verifier found bugs in Netscape, Sun, and Microsoft implementations of JavaKimera Use Static Verification –Use tools that go through code statically –Have no errors or warnings on Lint and gcc -Wall Self-Testing Code –Have each class be able to test itself –Each Java class can have its own main() method

Development Notes (cont.) Use good tools –Purify, test harnesses, code coverage analysis, etc Iterative Development –Plan a little, build a little, verify a little, and repeat –Fix defects as you find them, not “at the end” –If not, others will waste time on known problem 80/20 rule applies for defects –80% of bugs likely to be in 20% of code –Use defect tracking to find this code –If a unit seems to have lots of errors, it may be easier just to rewrite from scratch!

Testing Process Notes Begin test planning from beginning –Start test cases once requirements are known –Use User Manual and Specification Document –Microsoft uses one tester per developer –Space Shuttle people use ten testers per developer Daily Build –Product is built every day and put through tests –Supports incremental development –Minimizes integration (prevents dis-integration) –Provides project visibility

Testing Process Notes (cont.) Find the reason for error and ask questions –Is it a common occurrence? Mistake? Sloppiness? –Programmers fix own bugs at Microsoft, prevents programmer from introducing new bugs elsewhere –How much will it cost to fix? Is it worth it? –How can bugs like this can be prevented in future? Keep a database of bugs –Track all defects to closure –Graph open bugs and closed bugs over time

Testing Process Notes (cont.) Remember that testing only shows the presence of defects, not absence –Testing assesses quality, does not assure quality Have an environment of quality –Inktomi hangs a toy pig over person’s cubicle for a short while if he/she messes up –Microsoft head once threw chair out window on broken build –Lives depend on Space Shuttle software developers –Lives may depend on software you write!

Summary Plan quality from the very beginning Plan testing from the very beginning –People and resources needed, test cases Preventing bugs is easier than finding bugs –Use assertions, preconditions, invariants, reviews Use a variety of methods for reducing defects, assessing quality, and assuring quality The earlier you find a defect, the cheaper and easier it is to correct

References Rapid Development by Steve McConnell Code Complete by Steve McConnell Software Engineering by Ian Sommerville Software Project Dynamics by Jim McCarthy Software Management by Donald Reifer Construx Software Eric Brewer (CS169 Spring 1998)