software testing introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... ·...

24
11/10/2016 Clément Duffau 1 LP IDSE - GL Introduction to Software Testing

Upload: others

Post on 27-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

11/10/2016

Clément Duffau

1

LP IDSE - GL

Introduction to Software Testing

Page 2: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Verification&

Validation

Page 3: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Verification → Answer to technical specifications

Are we building the good product ?

Validation → Answer to functional specifications

Are we building the product correctly ?

V&V

11/10/16 - CD - [email protected] 3

Page 4: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

“Testing is the process of executing a program with the

intent of finding errors”Glen Myers

Page 5: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

“If test results are also green, what’s the purpose of

tests ?”Marc Rougé (AXONIC CEO)

Page 6: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Are you ok to walk up in a plane if the airman says to you “That’s the first

time this plane will take off” ?

Page 7: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

1h of coding~

1h of testing

Page 8: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Test

Trial

Debugging

Page 9: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Test≠

Trial≠

Debugging

Page 10: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Test → Reproducible (mitigation costs)

Trial → Manual

Debugging → Investigation

Test vs Trial vs Debugging

11/10/16 - CD - [email protected] 10

Page 11: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Tests strategies

11/10/16 - CD - [email protected] 11

Unit Test

Integration Test

Validation Test

Code

Conception

Requirements

Page 12: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Software Testing and Agility

Page 13: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Set of conditions for user story validation

Example :

User Story : As an Administrator, I want to be able to create User Accounts so that I can grant users access to the system

Acceptance critera :● If I am an Administrator, I can create User Accounts.● I can create a User Account by entering the following information about the

User: a) Name, b) Email address. The system notifies me that it sent an email to the new User’s email address, containing a system-generated initial password and instructions for the person to log in and change their password.

● I am able to verify with the intended recipient of the email that it was received.

Acceptance Criteria

11/10/16 - CD - [email protected] 13

Page 14: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

One (or more) scenario(s) for one condition of the acceptance criteria

Examples :

● Create a user with a name and email● Try to create a user just with email → failure testing● Check the list the people who received the confirmation

email

Acceptance Test

11/10/16 - CD - [email protected] 14

Page 15: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Tests pyramid

11/10/16 - CD - [email protected] 15

Page 16: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Software Testing by example

Page 17: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Example with JUnit

11/10/16 - CD - [email protected] 17

Page 18: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Test examples

11/10/16 - CD - [email protected] 18

Page 19: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

More complex test examples

11/10/16 - CD - [email protected] 19

Page 20: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

@AfterClass / @BeforeClass

@After / @Before

@Test

assert*

fail()

expected

JUnit Tag words

11/10/16 - CD - [email protected] 20

Page 21: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Purpose :

Simulate the behaviour of real objects

Allows to deal with :

Testing at interface level

Blacked-box component

Mock testing

11/10/16 - CD - [email protected] 21

Page 22: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

JUnit + Mockito example

11/10/16 - CD - [email protected] 22

Page 23: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

Let’s start this into an IDE !

Page 24: Software Testing Introduction tombf-iut.i3s.unice.fr/lib/exe/fetch.php?media=2016_2017:... · 2016-10-11 · Software Testing and Agility. Set of conditions for user story validation

?