1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

21
1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    216
  • download

    1

Transcript of 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

Page 1: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

1

SWE 205 - Introduction to Software Engineering

Lecture 28 –

Introduction to Software Testing

Page 2: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

2

Lecture Outline Software testing motivation. What is a software testing? Why software fail? What is cost of software failures? What makes a good software tester?

Page 3: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

3

Software Testing Motivation The Lion King Animated Storybook

Disney’s first multimedia CD-ROM game for kids. Released at Christmas season.

26th December….. Customer Support’s Nightmare.

The CD was testing only for specific PC platform.

It failed on many popular PC operating system.

Page 4: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

4

Software Testing Motivation Intel Pentium Floating-Point Bug

(4195835/3145727)* 3145727 - 4195835 If answer is ZERO, your computer is fine. Anything else, you have old Intel Pentium

CPU with floating-point division bug. A software bug burned into a computer

chip and reproduced over and over in the manufacturing process.

Page 5: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

5

Software Testing Motivation NASA Mars Polar Lander, 1999

3rd December 1999, Mars Polar Lander disappeared during its landing attempt.

Failure Review Board concludes the likely failure reason was the unexpected setting of a single data bit.

Most alarming was why the problem was not caught by internal tests.

Page 6: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

6

Software Testing Motivation Malaysia Airlines Jetliner, August 2005

Flight between Perth, Australia and Kuala Lampur, Malaysia zoomed 3,000 feet upwards.

A defective software program had provided incorrect data about the aircraft’s speed and acceleration, confusing flight computers.

Page 7: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

7

What is Software Testing? The process of finding evidence of

defects in software systems. Establishing confidence that a program

does what it is supposed to do.

1. Software testing is not debugging.2. Software testing is not quality assurance

Page 8: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

8

Software Testing Vs Quality Assurance (QA) Testing is necessary but not enough for

QA process. Testing contributes to improve quality by

helping to identify problems. QA sets standards that project

members (including testers) should follow in order to build a better software.

Page 9: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

9

What is Software Testing? Correctness of software with respect to

requirements or intent; Performance of software under various

conditions; Robustness of software, its ability to handle

erroneous input and unanticipated conditions; Installation and other facets of a software

release.

Page 10: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

10

Basic Definitions Failure

There is a deviation of the observed behavior of a program or a system from its specification.

Fault An incorrect step, process or data definition.

Error Difference between computed, observed or

measured value and the true or theoretically correct value or condition.

Page 11: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

11

Trivial Example For any integer n, square (n) = n*n.

int square (int x)

{

return x*2;

}

Square (3) = 6

Failure

Fault

Page 12: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

12

Trivial Example For any integer n, square (n) = n*n.

int square (int x)

{

return x*2;

}

Square (2) = 4

Correct Result

Page 13: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

13

Important Considerations Detect system failures by choosing test

inputs carefully. Determine the faults leading to the

failures detected. Repair the faults leading to the failures

detected; and Re-test the module/system.

Page 14: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

14

Why do Failure Occur?

SpecificationDesignCodeOther

Page 15: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

15

Root Causes of Failures Inaccurate understanding of end user

requirements. Inability to deal with changing requirements.

Late discovery of serious project flaws. For example, modules that do not fit together.

Untrustworthy build & release process. Implementation team’s chaos.

Page 16: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

16

Failure Costs

Disney’s Lion King CD

Page 17: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

17

Software Testers Good understanding of the development

process and its products. Ability to anticipate likely faults and

errors.

Page 18: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

18

Semantics of programs Squeeze Function

Semantics of C are such that integers and characters are somewhat interchangeable.

Fibonacci Function Input Domain - set of values of type ‘int’. Input domain can vary on different types of

machines.

Page 19: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

19

Semantics of programs These examples are deterministic in

nature. A unique output.

Different methods required for non-deterministic programs.

Similarly, programs may terminate or not terminate.

Page 20: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

20

Key Points Software testing is the process of

discovering evidence of defects and failures in software systems.

Test early, test often, test enough. Testers should have good

understanding of the development process, product.

Page 21: 1 SWE 205 - Introduction to Software Engineering Lecture 28 – Introduction to Software Testing.

21

Announcements Quiz # 4

Wednesday 24/12/2008.