21
1 Software Testing Dr. Xin (Judy) Feng Email: xinfeng@u ic.edu.hk Web: http :// u ic.edu.hk/~XinFeng

1 Software Testing Dr. Xin (Judy) Feng Email: [email protected] xinfeng@u Web: XinFeng

Embed Size (px)

Citation preview

1

Software Testing

Dr. Xin (Judy) Feng Email: [email protected]: http://uic.edu.hk/~XinFeng

2

Introductory Stuff Have Fun! Please turn

off your phones!

DODO interact with me!

3

Introductory Stuff This will be a relatively interactive

course. Feel free to stop me, shout at me, argue,… etc.

If you have trouble understanding me (I expect that you will),

TELL ME! I will try to speak more clearly and

slowly!

4

Outline What is software testing Why do we need the testing How should we do the testing Basic testing strategies

5

What is software testing?

Software Testing is an activity to catch bugs in

software applications (include Computer-Aided Language Learning applications)

6

Why software testing? Create robust products Reduce the risks (time, money,

life, credit…)

What problems do you think are bugs in a CALL system?

7

Some misunderstandings about software testing

Testing is Debugging???

Truth: Testing is to show that programs have bugs Debugging is to find the errors that make

the programs fail

8

Some misunderstandings about software testing

Testing is Easy???

Truth: Testing is very expensive. It

consumes almost half of the labour in the software development

9

Some misunderstandings about software testing

Testing is Everything???

Truth: Testing is one of the activities to

assure software quality Other activities are necessary

10

How to test software? Test cases

used to input to a system to check if the system produces an unexpected result

Two basic testing strategies White-box testing Black-box testing

11

White-box testing Test cases are generated based on the

internal structure and code of programs Basic white-box testing strategies

Statement testing Branch testing Path testing

12

White-box testingCount spelling errors and grammar errors

Spelling errors > 10

Deduct 10 marks

Grammar errors > 5

Deduct 15 marks

Statement Branch

Path

13

Statement testingCount spelling errors and grammar errors

Spelling errors > 10

Deduct 10 marks

Grammar errors > 5

Deduct 15 marks

Statement Every statement must be executed at least once.

Question: At least how many test cases are needed?

14

Branch testingCount spelling errors and grammar errors

Spelling errors > 10

Deduct 10 marks

Grammar errors > 5

Deduct 15 marks

Branch

Every Branch must be executed at least once.

Question: At least how many test cases are needed?

15

Path testingCount spelling errors and grammar errors

Spelling errors > 10

Deduct 10 marks

Grammar errors > 5

Deduct 15 marks

Path Every path must be executed at least once.

Question: How many paths are there totally?

16

Black-box testing Test cases are generated based on the

program requirements Basic black-box testing strategies

Equivalence-class testing Boundary value testing

17

Equivalence class testing Categorize the input into the classes

with some similar features Select one or more test cases from each

class

18

Equivalence class testing

Students’ marks for grammar and spelling

Grammar marks > 60 and

Spelling marks > 60

Grammar marks > 60 and

Spelling marks ≤ 60

Grammar marks ≤ 60 and

Spelling marks > 60

Grammar marks ≤ 60 and

Spelling marks ≤ 60

Four classes

Pass Supplementary for spelling

Supplementary for grammar

Fail

19

Boundary value testing Use the boundary values as well as normal

values to test Software applications tend to fail at the

boundary values

20

Boundary value testing

Spelling marks: 0 – 100Grammar marks: 0 - 100

100

100

21

Summary Software testing - What, why and how White-box testing

Statement testing Branch testing Path testing

Black-box testing Equivalence class testing Boundary value testing