INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to...

43
INF3121/ 26.03.2015 / © Raluca Florea 1 Exploratory testing Lecturer: Raluca Florea INF3121 : Software Testing 26. 03. 2015 Lecture 9

Transcript of INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to...

Page 1: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 1

Exploratory testing

Lecturer: Raluca Florea

INF3121 : Software Testing

26. 03. 2015

Lecture 9

Page 2: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 2

Overview

1. Understanding the system to be tested

2. Build quality, not only check it

3. Testing is boring context-dependent

4. Testing as a sapient activity

5. Heuristics

6. Improve your exploratory testing

Page 3: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 3

1. Why it’s necessary to understand the

system you are testing

• 1.1 Alt. definition of computer programs

• 1.2 Alt. definition of quality

Page 4: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 4

1. Why it’s necessary to understand the system you are testing

• A Computer Program = A set of instructions for a computer.

http://en.wikipedia.org/wiki/Computer_program

1.1 Alt. definition of computer programs

Page 5: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 5

• A House = A set of building materials, arranged in the “House” design pattern.

1. Why it’s necessary to understand the system you are testing

1.1 Alt. definition of computer programs

Page 6: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 6

• A House = Something for people to live in.

1. Why it’s necessary to understand the system you are testing

1.1 Alt. definition of computer programs

Page 7: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 7

Kaner’s Definition of a Computer Program

A computer program is

– a communication

– among several people

– and computers

– separated over distance and time

– that contains instructions that can be run on a computer.

• The purpose of a computer program is to provide value to people

1. Why it’s necessary to understand the system you are testing

1.1 Alt. definition of computer programs

Page 8: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 8

• A computer program is far more than its code

• A software product is far more than the instructions for the device

• Quality is far more than the absence of errors in the code

(how many of you bought a wrong product just because it’s bug-free?)

• Testing is far more than writing code to assert that other code returns some

“correct” result

• Testing is an investigation of code, systems, people, and the relationships

between them.

• Quality is value to some person(s)

1. Why it’s necessary to understand the system you are testing

1.2 Alt. definition of quality

Page 9: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 9

If you don’t have an understanding and an agreement on what is the mission of

your testing, then just applying procedural testing would be pointless.

• So know your mission when practicing quality assurance and testing!

1. Why it’s necessary to understand the system you are testing

1.2 Alt. definition of quality

Page 10: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 10

2. Build quality, not only check it

• 2.1 Testing vs. checking

• 2.2 Testing against customer’s expectations

• 2.3 How to build quality

Page 11: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 11

Testing is a sapient activity; checking is not.

Testing encompasses checking, not the other way round.

– Checking, in principle, can be done by a machine

2. Build quality, not only to check it

2.1 Testing vs. checking

Page 12: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 12

Make sure:

– You build the right product

What’s the use of building the perfect vacuum cleaner, when the customer

wanted a microwave oven?

– You build it the right way, with the agreed level of quality

What’s the use of building the perfect microwave oven, when the customer

has money just for a simple classic microwave oven?

2.2 Testing against customer’s expectations

2. Build quality, not only to check it

Page 13: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 13

From requirements:

“Build me a wrist-watch”

- It has to provide the time of the day, giving the hour, minute and second

- Maybe: display & a way to charge it

What you can get:

2.2 Testing against customer’s expectations

2. Build quality, not only to check it

Page 14: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 14

Questions to build quality:

– Who are my customers?

– Is the customer the same as the user?

– How would I describe the users?

– What do they use my product for?

– For how long have they been users of my product?

– How important is this feature for my customers?

– Can they live without this other feature?

– What is the time to market?

– How much can I invest in the development of the product?

– How much can my customers can afford to pay for my product?

– What are the user’s expectations? What are the customer’s expectations?

2.3 How to build quality

2. Build quality, not only to check it

Page 15: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 15

3. Why is testing boring context-dependent

• 3.1 Different software products

• 3.2 Context-dependent testing

Page 16: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 16

• Because software systems are different

• They ask for different focus in testing, they are used in different ways, they

pose different risks.

3. Context-dependent testing

3.1 Different software products

Page 17: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 17

Supporting technologies:

New technology

Old technology

Someone else's technology

Product interfaces:

Batch system

GUI system

API-only system

Type of project:

New project

Ongoing project

Project size:

Small project

Huge project

Development lifecycle:

"Agile" project

"Traditional" project

Project management:

Well managed project

Poorly managed

Type of product:

Experimental product

Mission-critical product

Life-critical product

Regulated product

Other product characteristic:

Embedded system

Real-time system

3. Context-dependent testing

Testing depends on the following:

3.2 Context-dependent testing

Page 18: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 18

• Even for the same product:

– It’s different if it’s the first release (more positive testing)

– Or subsequent releases (more performance testing)

– Or a patch (more regression testing & negative testing)

3. Context-dependent testing

3.2 Context-dependent testing

Page 19: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 19

4. Why is testing a sapient activity

Page 20: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 20

• Testing always happens under conditions of uncertainty.

• Good testing is done in a way that stands up to scrutiny.

– Without scrutiny, this would be easy to do. You could test badly, but no one

would ever know or care.

– What makes testing hard is that someone, perhaps your employer,

perhaps the users, or perhaps you yourself, will be judging your work.

4. Testing as sapient activity

Page 21: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 21

Example

How would you test this:

“The system shall operate at an input voltage range of nominal 100 - 250 VAC.”

Poor answer:

• “Try it with an input voltage in the range of 100-250.”

4. Testing as sapient activity

Page 22: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 22

Good answer:

• One fundamental question here is what happens when the system receives voltage outside

its rated range? Does it shut down? Blow up? Give erroneous results? Post an error

message? If it’s designed to pause and then recover when the power returns to normal

range, what actually happens?

• Is there special gear that can supply voltage of different levels? If so, we could probably use

it. What does it cost? What’s the risk?

• Brownouts from the mains could be a risk. Run the system with varying output voltages,

varying slowly, varying rapidly, as we run other tests.

• What happens if there’s a power spike? Does the product need isolation from the mains?

4. Testing as sapient activity

Page 23: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 23

Good answer:

• What happens if the input power drops suddenly and then recovers? Does the product need

an uninterruptable power supply? A line conditioner?

• How long can the product run above or below the rated levels?

• What does it mean “to operate” in this context?

• Run the product for a long time at the upper and lower ranges of voltage.

• What happens when we turn the product on or off? Does the product need time to reach

some state before it can be used? How long is that?

• What can we observe in the output or in other aspects of the system that might be correlated

to variances in the input voltage.

4. Testing as sapient activity

Page 24: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 24

5. Heuristics

• 6.1 Example

• 6.2 Definition of heuristics

• 6.3 Guideword heuristics

• 6.4 Trigger heuristics

Page 25: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 25

What is the most expensive project in human history?

5. Heuristics

5.1 Example

Page 26: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 26

Apollo 11July 16–24,

1969

Neil Armstrong

Michael Collins

Buzz Aldrin

First manned landing, in Sea of Tranquility.

Surface EVA time: 2:31 hr. Samples

returned: 47.5 pounds (21.5 kg)

When President Kennedy first chartered the Moon landing program, a preliminary cost

estimate of $7 billion was generated, but this proved an extremely unrealistic guess of what

could not possibly be determined precisely, and James Webb used his administrator's

judgment to change the estimate to $20 billion before giving it to Vice President Johnson.

Webb's estimate shocked many at the time (including the President), but ultimately proved to

be reasonably accurate. In January 1969, NASA prepared an itemized estimate of the run-out

cost of the Apollo program. The total came to $23.9 billion.

The final cost of project Apollo was reported to Congress as $25.4 billion

or 2,8 million dollars/ second (actually 2.803.532 dollars / second)

5. Heuristics

5.1 Example

Page 27: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 27

5. Heuristics

5.1 Example

Page 28: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 28

Heuristics is about structuring your problem-solving skills

Heuriskein (greek) -> Heuristic

Heuristics (Def.) refers to experience-based techniques for problem solving, learning, and discovery that give a solution which is not guaranteed to be optimal.

Where the exhaustive search is impractical, heuristic methods are used to speed up the process of finding a satisfactory solution via mental shortcuts to ease the cognitive load of making a decision.

Examples of this method include using:

• a rule of thumb,

• an educated guess,

• an intuitive judgment,

• stereotyping,

• or common sense.

5. Heuristics

5.2 Definition of heuristics

Page 29: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 29

Guideword Heuristics are words or labels that help you access the full spectrum of

your knowledge and experience as you analyze something. They’re often

provided in the form of a taxonomy, a classification system in (typically) a

hierarchical structure; or as a checklist.

5. Heuristics

5.3 Guideword heuristics

Page 30: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 30

Try it and see if it works!

5. Heuristics

• Get it • Choose where to look • Read the spec

• Set it up • See what is in there • See if the product

matches the spec

• Run it • See what it’s not there • Find problems

• Run it again • Find relevant

problems

Procedures Coverage Oracles

5.3 Guideword heuristics

Page 31: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 31

1. Model the test space.

2. Determine coverage.

3. Determine oracles.

4. Determine test procedures.

5. Configure the system.

6. Operate the system.

7. Observe the system.

8. Evaluate the test results.

9. Apply a stopping heuristic.

10. Report test results.

5. Heuristics

5.3 Guideword heuristics

Page 32: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 32

Example (Usability elements)

- Navigation

- Search and filter

- Grids

- Flow on page

- top-left to bottom right - in the western cultures

- Placement of important buttons, like Save and Cancel (Windows / OX standard)

- Tab order

- Alignment

- Grouping

- level of boxes, use and overuse

- Active / inactive elements

- the inactive elements must always be disabled

- Destructive actions

- never put Save and Delete next to each others

- have confirmation for destructive actions

- Placement of checkboxes and radio buttons (Win / OX standard)

5. Heuristics

5.3 Guideword heuristics

Page 33: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 33

Ideas associated with an event or condition that help you recognize when it may

be time to take an action or think a particular way. Like an alarm clock for your

mind.

Emotions and feelings can be powerful sources of trigger heuristics.

Impatience an intolerable delay?

Frustration a poorly-conceived workflow?

Amusement a threat to someone’s image?

Surprise inconsistency with expectations?

Confusion unclear interface? poor testability?

Annoyance a missing feature?

Boredom an uninteresting test?

Tiredness time for a break?.

5. Heuristics

5.4 Trigger heuristics

Page 34: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 34

6. Improve your exploratory testing

• 6.1 Mission of testing

• 6.2 Exploration

• 6.3 Mental models

• 6.4 Checklists

• 6.5 Test scripting

• 6.6 Practicing exploratory testing

Page 35: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 35

The mission of testing is learning

Testers help to defend the value of the product by learning on behalf of our clients.

Tester do this by using:

1. Exploration methods (guided heuristics)

2. Creating mental models to represent and test the system

3. Checklists

4. Scripted test procedures

All these require continuous reviews and improvements

6. Improve your exploratory testing

6.1 Mission of testing

Page 36: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 36

Testers will explore:

• The features: Move through the application and get familiar with all the controls and features you

come across.

• The complexity : Find the five most complex things about the application.

• The configurations find the ways you can change settings in a way that the application retains

those settings.

• The user : Imagine five users for the product and the information they would want from the product

or the major features they would be interested in.

• The scenarios: Imagine five realistic scenarios for how the users identified in the user tour would

use this product.

• The testability : Find all the features you can use as testability features and/or identify tools you

have available that you can use to help in your testing.

• The variability : Look for things you can change in the application - and then you try to change

them.

• The interoperability : What does this application interact with?

• The data : Identify the major data elements of the application.

• The structure : Find everything you can about what comprises the physical product (code,

interfaces, hardware, files, etc...).

6. Improve your exploratory testing

6.2 Exploration

Page 37: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 37

Create mental models of the system you are testing. Try to see more than one

point of view:

6. Improve your exploratory testing

6.3 Mental models

Page 38: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 38

The mental models will be focused on one or a combination of the following:

– Program structure

– Data

– Program functions

– Platform

– Business risk

– Technical risk

– Operations

6. Improve your exploratory testing

6.3 Mental models

Page 39: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 39

Create checklists:

– On requirements

– On design specs / technical specs

– On the test strategy

– On the areas targeted by testing

– On the test methodologies

6. Improve your exploratory testing

6.4 Checklists

Page 40: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 40

Script the most important test scenarios.

Define your:

- Basic flow

- Alternative flows

- Exception flows

• Represent them as a discrete unit of interaction between a user (human or

machine) and the system.

This interaction has to be a single unit of meaningful work, such as Buy a set of e-

books or View Account Details (assuming you test Amazon.com).

6. Improve your exploratory testing

6.5 Test scripting

Page 41: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 41

Do You Test Under Time Pressure?

• You have less time than you’d like.

• Faster is better.

• Your plans are often interrupted.

• You are not fully in control of your time.

What is this like?

Team sports!

6. Improve your exploratory testing

6.6 Practicing exploratory testing

Page 42: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 42

When the ball comes to you:

• Do you know you have the ball?

• Can you receive the pass?

• Do you know what your role and mission is?

• Do you know where your teammates are?

• Are you ready to act, right now?

• Can you let your teammates help you?

• Do you know your options?

• Is your equipment ready?

• Can you read the situation on the field?

• Are you aware of the criticality of the situation?

6. Improve your exploratory testing

6.6 Practicing exploratory testing

Page 43: INF3121 : Software Testing 26. 03. 2015 Lecture 9 · • Testing is far more than writing code to assert that other code returns some “correct” result • Testing is an investigation

INF3121/ 26.03.2015 / © Raluca Florea 43

A good sports team has to depend on the skills of the players, rather than on rote

procedures.

Professional sports teams begin with the skills of each player, and then work

outwards from that. Skills get practiced offline, but every game is part of the

practice too.

Strategy matters, plans matter, techniques matter, but the focus is on the player to

choose the appropriate techniques and to execute them skillfully.

6. Improve your exploratory testing

6.6 Practicing exploratory testing