54
Rekayasa Perangkat Lunak Sesi 14 Software Testing

Rekayasa Perangkat Lunak Sesi 14 Software Testing

Embed Size (px)

DESCRIPTION

What’s Wrong? 3 T F A=2 ? A=A A=0 Print A

Citation preview

Page 1: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Rekayasa Perangkat Lunak

Sesi 14Software Testing

Page 2: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Outline of this presentation

• What Testing is• Testing In Development Process• Types Of Testing and Definitions• Verification & Validation• Purpose and Goal of Testing• Who Tests Software• Testing Technique• Testing Step• Testing Strategy

2

Page 3: Rekayasa Perangkat Lunak Sesi 14 Software Testing

What’s Wrong?

3

TF

A=2 ?

A=A + 0.1

A=0

Print A Print A

Page 4: Rekayasa Perangkat Lunak Sesi 14 Software Testing

What testing is..................

4

Page 5: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Mau Tau ya....

5

Page 6: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Mau Tau aja atau

mau tau banget ???

6

Page 7: Rekayasa Perangkat Lunak Sesi 14 Software Testing

What testing is..................

7

”Testing is a technical investigation of a product, done to expose quality-related information.”

Testing is to execute a program with the purpose of finding

defects

1) Common definition

2) Wider definition

testing

Page 8: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Testing in Development Process

• Testing activities take place in all parts of software development

• From requirement eliciting to final shipment• Testing is part of the development process• Testing is part of the company business

process

8

Page 9: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Testing in Development Process

• Testing During implementation: test to verify that software behaves as intended by the designer.

• Testing After implementation: test for conformance with requirements and reliability, and other non functional requirement

9

Page 10: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Types of testing and definitions

• Validation and Verification– Validate

• correctness or suitability• vertical experts to confirm master results

– Verification• confirm software operates as it is required• double check to ensure results match those previously

validated and if not then re-validate them

10

Page 11: Rekayasa Perangkat Lunak Sesi 14 Software Testing

11

Maintenance

Testing

Development

Design

Analysis

Requirements

TransitionConstructionInception Elaboration

Cor

e W

orkf

low

PhaseRational UnifiedProcess (RUP)

Testing can take place as part of each phase of development .

Page 12: Rekayasa Perangkat Lunak Sesi 14 Software Testing

12

Maintenance

Testing

Development

Design

Analysis

Requirements

TransitionConstructionInception Elaboration

Cor

e W

orkf

low

PhaseRational UnifiedProcess (RUP)

Test

ing

can

take

pla

ce a

s par

t of e

ach

core

w

orkf

low

invo

lved

in d

evel

opm

ent

orga

niza

tion.

Page 13: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Verification & Validation

• Software V & V defined as a systems engineering methodology to ensure that quality is built into the software during development.

• Software V & V is complementary to and supportive of quality assurance, project management, systems engineering, and development.

13

Page 14: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Verification & Validation versus Debugging

• Verification & Validation– a process that establish the existence of

defects in a system

• Debugging– a process that locates and corrects these

defects

14

Page 15: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Verification versus Validation• Software Verification Process

– is a process for determining whether the software products of an activity fulfill the requirements or conditions imposed on them in the previous activities.

• Software Validation Process– is a process for determining whether the

requirements and the final, as-built system or software product fulfills its specific intended use.

15

Page 16: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Verification versus Validation

• Verification:– “Are we building the system in the right way?”– The system should conform to the specification– It does what you specified it should do

16

Validation: “Are we building the right system? ” The system should do what the users really

requires

Page 17: Rekayasa Perangkat Lunak Sesi 14 Software Testing

The V & V Objectives

• There are two principal objectives:

– To discover and rectify defects in a system

– To assess whether or not the system is usable in an operational situation.

17

Page 18: Rekayasa Perangkat Lunak Sesi 14 Software Testing

The V & V Objectives

• Software V & V determines that the software performs its intended functions correctly.

• Ensure that the software performs no unintended functions

• Measure and assess the quality and reliability of software.

18

Page 19: Rekayasa Perangkat Lunak Sesi 14 Software Testing

The V & V Objectives

• As a software engineering discipline, software V & V also assesses, analyzes, and tests the software on

– how it interfaces with systems elements

– Influences the performance, or reacts to stimuli from system elements

19

Page 20: Rekayasa Perangkat Lunak Sesi 14 Software Testing

The V & V process

• V & V Is a whole life-cycle process

• V & V should be applied at each stage in the software process.

20

Page 21: Rekayasa Perangkat Lunak Sesi 14 Software Testing

21

Formalspecification

High-leveldesign

Requirementsspecification

Detaileddesign

Code/Program

Prototype

Static and Dynamic V&V

Check correspondence between a program and its specification

Are we buildingthe system

In the right way?

Are we buildingthe right system?

StaticVerification

DynamicValidation

Execution base testing

Page 22: Rekayasa Perangkat Lunak Sesi 14 Software Testing

• Static Verification Concerned with analysis of the static

system representation to discover problems– Analysis of all documents produced

that represent the system– Can be applied during all stages of the

software process

22

Static and Dynamic V&V

Page 23: Rekayasa Perangkat Lunak Sesi 14 Software Testing

23

V & V

Inspect artifacts

Dynamic = “testing”

Execute systems

to discover problems(static verification)

observing product behaviour(dynamic validation)

Static

Page 24: Rekayasa Perangkat Lunak Sesi 14 Software Testing

24

V & V

Complements each other

Inspect artifacts

Dynamic = “testing”

Execute systems

Static

Page 25: Rekayasa Perangkat Lunak Sesi 14 Software Testing

25

V & VStatic Dynamic =

”Testing”

Review Inspection Walkthrough

Unit test Integrationtest

AcceptancetestSystem test

Page 26: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Purpose and goal of testing are situation dependent

1. Find defects2. Maximize bug count3. Block premature product releases4. Help managers make ship/no-ship

decisions5. Assess quality6. Minimize technical support costs

26

Page 27: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Purpose and goal of testing are situation dependent

7. Conform to regulations8. Minimize safety-related lawsuit risk9. Assess conformance to specification10.Find safe scenarios for use of the

product (find ways to get it to work, in spite of the bugs)

11.Verify correctness of the product12.Assure quality

27

Page 28: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Purpose and goal of testing are situation dependent

13.Testing cannot show the absence of errors, only their presence

14.We test a program to find the existence of an error

15.If we find no errors then we have been unsuccessful

16.If an error is found debugging should occur

28

Page 29: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Unsuitable objectives with testing

29

Showing that a system is without errors

Show that a system does what it is supposed to do

Page 30: Rekayasa Perangkat Lunak Sesi 14 Software Testing

30

Who Tests Software?

userindependent testerindependent testerdeveloperdeveloper

Page 31: Rekayasa Perangkat Lunak Sesi 14 Software Testing

31

Who Tests Software?

• Software Developer– Understand system– Test gently– Driven by delivery

• Independent Tester– Doesn’t understand system– Will try to break it– Quality driven

Page 32: Rekayasa Perangkat Lunak Sesi 14 Software Testing

32

Who Tests Software?

• User– Test while using it

• It’s not in purpose to do so

– Indirect test

Page 33: Rekayasa Perangkat Lunak Sesi 14 Software Testing

33

Static verification

• Review (desk checking)– Code reading done by a single person, – informal.– Uneffective compared to walkthrough or

inspection

• Walkthrough– The programmer(s) ”walks through”/”executes”

his code while invited participants ask questions and makes comments.

– Relatively informal

• Inspection– Usually a checklist of common errors is used to

compare the code against.

Page 34: Rekayasa Perangkat Lunak Sesi 14 Software Testing

34

Testing Technique

• Two views on Software testing:

White Box Testing

Black boxBlack Box Testing

Page 35: Rekayasa Perangkat Lunak Sesi 14 Software Testing

35

Testing Technique

White box testing - tests what the program does.Test sets are developed by using knowledge of the algorithms, data structures, and control statements.

Page 36: Rekayasa Perangkat Lunak Sesi 14 Software Testing

36

Testing Technique

Black box

Black box testing - tests what the program is supposed to do.Test sets are developed and evaluated solely on the specification. There is no knowledge of the algorithms, data structures, or control statements.

Page 37: Rekayasa Perangkat Lunak Sesi 14 Software Testing

37

White-box testing

Also known as: Structure based (Structural) testing Code based testing Glass box testing Clear box testing Logic driven testing

Page 38: Rekayasa Perangkat Lunak Sesi 14 Software Testing

38

• White-box (or Structural) testing:– Use knowledge of the program to derive

test cases to provide more complete coverage

– Problem: What criteria to use?

White-box testing

Page 39: Rekayasa Perangkat Lunak Sesi 14 Software Testing

39

... our goal is to ensure that all ... our goal is to ensure that all Statements, decisions, conditions, and paths have Statements, decisions, conditions, and paths have been executed at least once ...been executed at least once ...

White-box testing

Page 40: Rekayasa Perangkat Lunak Sesi 14 Software Testing

40

White-box testing

The system is looked upon as an open box. The test cases is based on the internal structure of

the system (code) Theoretically desirable but impossible and

insufficient goal: all paths of the code exercise

Page 41: Rekayasa Perangkat Lunak Sesi 14 Software Testing

41

• Also known as:– Functional Testing

• because it test all the functions– Behavioral Testing

• because the program is tested against the expected behavior (described by requirements and/or design)

Black-box testing

Black box

Page 42: Rekayasa Perangkat Lunak Sesi 14 Software Testing

42

– The software is viewed as a black box which transforms input to output based on the specifications of what the software is supposed to do.

requirements

inputevents

output

Black-box testing

Page 43: Rekayasa Perangkat Lunak Sesi 14 Software Testing

43

– Check The Conformity of the tested S/W against established behaviour, and

– Detect errors generated by fault• Software fault is a software part which is not

according to its definition provided in the development document

Black-box testing

Page 44: Rekayasa Perangkat Lunak Sesi 14 Software Testing

44

– Functional tests examine the observable behavior of software as evidenced by its outputs without reference to internal functions.

– If the program consistently provides the desired features with acceptable performance, then specific source code features are irrelevant.

Black-box testing

Page 45: Rekayasa Perangkat Lunak Sesi 14 Software Testing

45

– Should consider only from the standpoint of its:• Input data• Output data

– Knowledge of its internal structured should not be

– It is very often impossible to test all the input data

– It is hence necessary to select a subset of possible input

Black-box testing

Page 46: Rekayasa Perangkat Lunak Sesi 14 Software Testing

46

Testing Steps

Unittest

Unittest

Unittest

Integrationtest

Functiontest

Performancetest

Acceptancetest

Installationtest

Unit

code

Unit

code

Unit

code

.

.

.

Integratedmodules

Functioningsystem

Verified,validatedsoftware

Acceptedsystem

SYSTEMIN USE!

Designspecifications

Systemfunctional

requirements

Othersoftware

requirements

Customerrequirementsspecification

Userenvironment

Page 47: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Testing StepsAcceptance Test

type of acceptance testing performed by customer at the developer’s site is usually called alpha testing

software

developer site

customertests

Page 48: Rekayasa Perangkat Lunak Sesi 14 Software Testing

48

beta testing is a type of acceptance testing involving a software product to be marketed for use by many users

selected users receive the system first and report problems back to the developer

users enjoy it - usually receive large discounts and feel important

developers like it - exposes their product to real use and often reveals unanticipated errors

software

customer site

customer tests

Testing Steps Acceptance Test

Page 49: Rekayasa Perangkat Lunak Sesi 14 Software Testing

49

Testing Strategy

BigBang!

Top-down

Bottom-up

non-incremental incremental

SandwichCompromise

Page 50: Rekayasa Perangkat Lunak Sesi 14 Software Testing

50

Testing Strategy

Big bang integration (all components together)

Bottom up integration (from lower levels No test stubs necessary)

Top down integration (from higher levels no test drivers are

needed)

Sandwich testing (combination of bottom-up and top-down no test stubs and drivers needed)

Page 51: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Kesawah Naik Bis....

Page 52: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Wahhhh ... materi kuliahnya sudah habis....

Page 53: Rekayasa Perangkat Lunak Sesi 14 Software Testing
Page 54: Rekayasa Perangkat Lunak Sesi 14 Software Testing

Terimakasih…..Untuk mahasiswa/i yang tidak ngantuk dan tetap konsentrasi Mengikuti

Perkuliahan.Semoga Sukses di UAS