Software Testing Introduction.

Slides:



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

November 1, 2004Introduction to Computer Security ©2004 Matt Bishop Slide #17-1 Chapter 17: Introduction to Assurance Overview Why assurance? Trust and.
Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
Software Testing Introduction. What is a computer bug? In 1947 Harvard University was operating a room-sized computer called the Mark II. –mechanical.
Introduction to Software Testing
1 Basic Definitions: Testing What is software testing? Running a program In order to find faults a.k.a. defects a.k.a. errors a.k.a. flaws a.k.a. faults.
Ivan Marsic Rutgers University LECTURE 1: Introduction Lecture time: 1 hr. 20 min.
Chapter 15 Design, Coding, and Testing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Design Document The next step in the Software.
1 SWE Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Implementation. We we came from… Planning Analysis Design Implementation Identify Problem/Value. Feasibility Analysis. Project Management. Understand.
CPTE 209 Software Engineering Summary and Review.
第 0 讲 前言 参考:无 自我介绍 姓名: 王顶 手机: : Blog :
Software Metrics - Data Collection What is good data? Are they correct? Are they accurate? Are they appropriately precise? Are they consist? Are they associated.
Configuration Management (CM)
Modern Software Development Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
SE: CHAPTER 7 Writing The Program
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
The Software Development Process
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Testing. Today’s Topics Why Testing? Basic Definitions Kinds of Testing Test-driven Development Code Reviews (not testing) 1.
Intermediate 2 Computing Unit 2 - Software Development.
1 Software Testing Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and Validating.
The Hashemite University Computer Engineering Department
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
10- Verification and Validation. What is a computer bug? In 1947 Harvard University was operating a room-sized computer called the Mark II. –mechanical.
1 Chapter 1- Introduction How Bugs affect our lives What is a Bug? What software testers do?
1 Advanced Computer Programming Project Management: Basics Copyright © Texas Education Agency, 2013.
Software Development. The Software Life Cycle Encompasses all activities from initial analysis until obsolescence Analysis of problem or request Analysis.
Chapter 2- Software Development Process  Product Components  Software Project Staff  Software Development Lifecycle Models.
Software Development Life Cycle. The Software Life Cycle  Encompasses all activities from initial analysis until end of work  Formal process for software.
Software Development.
Software Configuration Management
Exam 0 review CS 360 Lecture 8.
CMPE 280 Web UI Design and Development August 29 Class Meeting
Ivan Marsic Rutgers University
Software Testing.
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
User-centred system design process
John D. McGregor Session 9 Testing Vocabulary
Software Testing Introduction CS 4501 / 6501 Software Testing
Chapter 18 Maintaining Information Systems
Software testing
Unified Modeling Language
CSE 403 Software Engineering
Faults, Errors, Failures CS 4501 / 6501 Software Testing
Lecture 2 Introduction to Programming
Some Simple Definitions for Testing
BASICS OF SOFTWARE TESTING Chapter 1. Topics to be covered 1. Humans and errors, 2. Testing and Debugging, 3. Software Quality- Correctness Reliability.
John D. McGregor Session 9 Testing Vocabulary
Introduction to Software Testing Chapter 2 Model-Driven Test Design
John D. McGregor Session 9 Testing Vocabulary
Design and Programming
Software Testing and Maintenance Maintenance and Evolution Overview
Introduction To software engineering
Chapter 1 Introduction(1.1)
Practical Software Engineering
Introduction to Software Testing
Welcome to Corporate Training -1
(some of) My Research Engineering is about getting technology to do what it does well so humans can do what they do well Jeff Offutt Professor of Software.
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Software Testing COM /12/2019 Testing/Spring 98.
Logical Architecture & UML Package Diagrams
Presentation transcript:

Software Testing Introduction

Course Topics Testing overview Testing concepts / Terms Testing models Graph testing Logic testing Black box testing Syntactic Testing OO testing Documentation testing Web site testing Security Testing UML testing Specification testing

Software is … requirements specification documents design documents source code test suites and test plans interfaces to hardware and software operating environment internal and external documentation executable programs and their persistent data

Introduction: Software is Complex Complex  complicated Complex = composed of many simple parts related to one another Complicated = not well understood, or explained

Complexity Example: Scheduling Fence Construction Tasks Nailing [ 2 time units for unpainted; 3 time units otherwise ] Painting [ 5 time units for uncut wood; 4 time units otherwise ] Setting posts [ 3 time units ] Cutting wood [ 2 time units ] SOURCE: Goodaire & Parmenter, Discrete Mathematics with Graph Theory, Third Edition, Pearson Prentice Hall, 2006. [ Section 11.5, p. 361 ] Setting posts  Nailing, Painting Cutting  Nailing …shortest possible completion time = ? [  “simple” problem, but hard to solve without a pen and paper ]

The Role of Software Engg. (2)

Example: ATM Machine Understanding the money-machine problem:

How ATM Machine Might Work Domain model created with help of domain expert

Software Development Methods Method = work strategy The Feynman Problem-Solving Algorithm: (i) Write down the problem (ii) think very hard, and (iii) write down the answer. Waterfall Unidirectional, finish this step before moving to the next Iterative + Incremental Develop increment of functionality, repeat in a feedback loop Agile User feedback essential; feedback loops on several levels of granularity

Waterfall Method Unidirectional, no way back finish this step before moving to the next

UML – Language of Symbols UML = Unified Modeling Language Online information: http://www.uml.org

Understanding the Problem Domain System to be developed Actors Agents external to the system Concepts/ Objects Agents working inside the system Use Cases Scenarios for using the system

ATM: Gallery of Players Actors (Easy to identify because they are visible!)

Know Your Problem Mortise Lock Parts

Customer requirements The software development team must determine what the customer wants. How can you do this? Guess? Collect detailed information from surveys? Get feedback from a previous version of the software? Read reviews in magazines? Get information about the competition? Other ways? The collected data is used to guide the specification effort.

Specification “If you don't know where you're going any road will take you there” The specification takes the data from the customer requirements and other sources and defines: The features of the software (functional requirements). The constraints on these features (non-functional requirements). Specifications can be: formal (e.g., aerospace industry), rigid informal (e.g., a .com start up), on a cocktail napkin or a whiteboard.

Schedules The goals of scheduling are to know: What work needs to be completed? How much work is left to do? When will the work be finished? Who will finish each task? Other measurable queries. A Gantt chart is a popular type of bar chart that illustrates a project schedule.

Design Before coding begins on non-trivial software projects, a set of design documents are created to serve as blueprints. Software Architecture Data flow diagram State transition diagram Flowchart Commented code

Source code … of course The ultimate specification of the software! ‘Code is king’ philosophy is still prevalent. Many programming languages and tools to choose from.

Software Project Staff Project managers Write product specification, manage the schedule, critical decision tradeoffs Software architects, system engineers Design the software, work closely with programmers Programmers, developers, coders Write code, fix bugs Testers, quality assurance staff Find bugs, document bugs, track progress of open bugs Technical writers Write manuals, on line documentation Configuration managers, builders Packaging and code, documents, and specifications

Software Measurement What to measure? Project (developer’s work), for budgeting and scheduling Product, for quality assessment

What is a computer bug? In 1947 Harvard University was operating a room-sized computer called the Mark II. mechanical relays glowing vacuum tubes technicians program the computer by reconfiguring it Technicians had to change the occasional vacuum tube. A moth flew into the computer and was zapped by the high voltage when it landed on a relay. Hence, the first computer bug!

Bugs a.k.a. … Defect Problem Error Incident Anomaly Variance Failure Inconsistency Product Anomaly Product Incidence

Software is a Skin that Surrounds Our Civilization

Software Faults, Errors & Failures Software Fault : A static defect in the software Is a hidden programming error Software Failure : External, incorrect behavior with respect to the requirements or other description of the expected behavior Occurs when the software does not do what the user expects to see Software Error : An incorrect internal state that is the manifestation of some fault

A Concrete Example [ 2, 7, 0 ] Actual: 1 [ 0, 2, 7 ] Actual: 0 Fault: Should start searching at 0, not 1 public static int numZero (int [ ] arr) { int count = 0; for (int i = 1; i < arr.length; i++) if (arr [ i ] == 0) count++; } return count; Test 1 [ 2, 7, 0 ] Expected: 1 Actual: 1 Error: i is 1, not 0, on the first iteration Failure: none Test 2 [ 0, 2, 7 ] Expected: 1 Actual: 0 Error: i is 1, not 0 Error propagates to the variable count Failure: count is 0 at the return statement

Sources of Problems Requirements Definition: Erroneous, incomplete, inconsistent requirements. Design: Fundamental design flaws in the software. Implementation: Mistakes in chip fabrication, wiring, programming faults, malicious code. Support Systems: Poor programming languages, faulty compilers and debuggers, misleading development tools.

Bug in Space Code Project Mercury’s FORTRAN code had the following fault: DO I=1.10 instead of ... DO I=1,10 The fault was discovered in an analysis of why the software did not seem to generate results that were sufficiently accurate. The erroneous 1.10 would cause the loop to be executed exactly once!

Spectacular Software Failures NASA’s Mars lander: September 1999, crashed due to a units integration fault THERAC-25 design Mars Polar Lander crash site? THERAC-25 radiation machine : Poor testing of safety-critical software can cost lives : 3 patients were killed Intel’s Pentium FDIV fault : Public relations nightmare Ariane 5: exception-handling bug : forced self destruct on maiden flight (64-bit to 16-bit conversion: about 370 million $ lost)

Military Aviation Problems An F-18 crashed because of a missing exception condition: if ... then ... without the else clause that was thought could not possibly arise. In simulation, an F-16 program bug caused the virtual plane to flip over whenever it crossed the equator, as a result of a missing minus sign to indicate south latitude.

Year Ambiguities In 1992, Mary Bandar received an invitation to attend a kindergarten in Winona, Minnesota, along with others born in '88. Mary was 104 years old at the time.

AT&T Bug: Hello? ... Hello? In mid-December 1989, AT&T installed new software in 114 electronic switching systems. On January 15, 1990, 5 million calls were blocked during a 9 hour period nationwide.

AT&T Bug (Cont’d) The bug was traced to a C program that contained a break statement within an switch clause nested within a loop. The switch clause was part of a loop. Initially, the loop contained only if clauses with break statements to exit the loop. When the control logic became complicated, a switch clause was added to improve the readability of the code ...

Bank Generosity A Norwegian bank ATM consistently dispersed 10 times the amount required. Many people joyously joined the queues as the word spread.

Bank Generosity (Cont’d) A software flaw caused a UK bank to duplicate every transfer payment request for half an hour. The bank lost 2 billion British pounds! The bank eventually recovered the funds but lost half a million pounds in potential interest.

Northeast Blackout of 2003 508 generating units and 256 power plants shut down Affected 10 million people in Ontario, Canada Affected 40 million people in 8 US states Financial losses of $6 Billion USD The alarm system in the energy management system failed due to a software error and operators were not informed of the power overload in the system © Ammann & Offutt

Discussion … Have you heard of other software bugs? In the media? From personal experience? Does this embarrass you as a future software engineer?

Specification “if you can’t say it, you can’t do it” You have to know what your product is before you can say if it has a bug. A specification defines the product being created and includes: Functional requirements that describes the features the product will support. E.g., on a word processor Save, print, check spelling, change font, … Non-functional requirements are constraints on the product. E.g, Security, reliability, user friendliness, platform, …

A software bug occurs when at least one of these rules is true The software does not do something that the specification says it should do. The software does something that the specification says it should not do. The software does something that the specification does not mention. The software does not do something that the product specification does not mention but should. The software is difficult to understand, hard to use, slow …

Most bugs are not because of mistakes in the code … Specification (~= 55%) Design (~= 25%) Code (~= 15%) Other (~= 5%)

Relative cost of bugs “bugs found later cost more to fix” Cost to fix a bug increases exponentially (10x) i.e., it increases tenfold as time increases E.g., a bug found during specification costs $1 to fix. … if found in design cost is $10 … if found in code cost is $100 … if found in released software cost is $1000

Bug Free Software Software is in the news for the wrong reason Security breach, Mars Lander lost, hackers getting credit card information, etc. Why can’t software engineers develop software that just works? As software gets more features and supports more platforms it becomes increasingly difficult to make it create bug-free.

Discussion … Do you think bug free software is unattainable? Are their technical barriers that make this impossible? Is it just a question of time before we can do this? Are we missing technology or processes?

Goal of a software tester … to find bugs … as early in the software development processes as possible … and make sure they get fixed. Advice: Be careful not to get get caught in the dangerous spiral of unattainable perfection.

What to look for when interviewing someone for the position of software tester Are they explorers? Are they troubleshooters? Are they relentless? Are they creative? Are they perfectionists (within reason)? Do they exercise good judgment? Are they tactful and diplomatic? Are they persuasive?

You now know … … what is a bug … the relationship between specification and bugs … the cost of a bug relative to when it is found … the unattainable goal of perfect software … the goal of the software tester … valuable attributes of a software tester