ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่ ...

19
ซซซซซซซซซซซซซซ ซซซซซซซซซซซซซ ซซซซซ 7 ซซซซซซซซ ซซซซซซซ ปปปปปป ปปปปปปปปปป ปปปปปปปปปปปปปปปปปปปปปปปปปปป ปปป ปปปปปปปปปปปปปปปปปปปปปปป ปปปปปปปปปปปปปปปปปปปปปปปปปปปปป

Upload: shanta

Post on 15-Feb-2016

75 views

Category:

Documents


0 download

DESCRIPTION

ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่ 7 การทดสอบโปรแกรม. ปริญญา น้อยดอนไพร สาขาวิชาวิทยาการคอมพิวเตอร์ คณะวิทยาศาสตร์และเทคโนโลยี มหาวิทยาลัยราช ภัฏ สุราษฎร์ธานี. การทดสอบโปรแกรม. กระบวนการในการทดสอบ กระบวนการในการหาข้อผิดพลาดของโปรแกรม กลยุทธ์การทดสอบ เครื่องมือช่วยในการทดสอบ - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

ซอฟต์แวรพ์ฒันาระบบฐานขอ้มูล

บทท่ี 7 การทดสอบโปรแกรมปรญิญา น้อยดอนไพร

สาขาวชิาวทิยาการคอมพวิเตอร ์คณะวทิยาศาสตร์และเทคโนโลยี

มหาวทิยาลัยราชภัฏสรุาษฎรธ์านี

Page 2: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

การทดสอบโปรแกรม

• กระบวนการในการทดสอบ• กระบวนการในการหาขอ้ผิดพลาดของ

โปรแกรม• กลยุทธก์ารทดสอบ• เครื่องมอืชว่ยในการทดสอบ• แบบต่าง ๆ ของการทดสอบ

Page 3: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Testing phases

Componenttesting

Integrationtesting

Software developer Independent testing team

Page 4: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

The defect testing process

Design testcases

Prepare testdata

Run programwith test data

Compare resultsto test cases

Testcases

Testdata

Testresults

Testreports

Page 5: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Black-box testingIe

Input test data

OeOutput test results

System

Inputs causinganomalousbehaviour

Outputs which revealthe presence ofdefects

Page 6: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Equivalence partitioning

System

Outputs

Invalid inputs Valid inputs

Page 7: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

• Partition system inputs and outputs into ‘equivalence sets’– If input is a 5-digit integer between

10,000 and 99,999, equivalence partitions are <10,000, 10,000-99, 999 and > 10, 000

• Choose test cases at the boundary of these sets– 00000, 09999, 10000, 99999, 10001

Equivalence partitioning

Page 8: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Equivalence partitions

Between 10000 and 99999Less than 10000 More than 99999

999910000 50000

10000099999

Input values

Between 4 and 10Less than 4 More than 10

34 7

1110

Number of input values

Page 9: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

White-box testing

Componentcode

Testoutputs

Test data

DerivesTests

Page 10: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Path testing• The objective of path testing is to

ensure that the set of test cases is such that each path through the program is executed at least once

• The starting point for path testing is a program flow graph that shows nodes representing program decisions and arcs representing the flow of control

• Statements with conditions are therefore nodes in the flow graph

Page 11: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Binary search flow graph

1

2

3

4

65

7

while bottom <= top

if (elemArray [mid] == key

(if (elemArray [mid]< key8

9

bottom > top

Page 12: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

• 1, 2, 3, 8, 9• 1, 2, 3, 4, 6, 7, 2• 1, 2, 3, 4, 5, 7, 2• 1, 2, 3, 4, 6, 7, 2, 8, 9• Test cases should be derived so that

all of these paths are executed• A dynamic program analyser may be

used to check that paths have been executed

Independent paths

Page 13: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Integration testing• Tests complete systems or

subsystems composed of integrated components

• Integration testing should be black-box testing with tests derived from the specification

• Main difficulty is localising errors• Incremental integration testing

reduces this problem

Page 14: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Incremental integration testing

T3

T2

T1

T4

T5

A

B

C

D

T2

T1

T3

T4

A

B

C

T1

T2

T3

A

B

Test sequence1

Test sequence2

Test sequence3

Page 15: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Approaches to integration testing

• Top-down testing– Start with high-level system and

integrate from the top-down replacing individual components by stubs where appropriate

• Bottom-up testing– Integrate individual components in

levels until the complete system is created

• In practice, most integration involves a combination of these strategies

Page 16: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Top-down testing

Level 2Level 2Level 2Level 2

Level 1 Level 1Testingsequence

Level 2stubs

Level 3stubs

. . .

Page 17: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

Bottom-up testing

Level NLevel NLevel NLevel NLevel N

Level N–1 Level N–1Level N–1

Testingsequence

Testdrivers

Testdrivers

Page 18: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

เครื่องมอืชว่ยในการทดสอบ• เครื่องมอืสรา้งกรณีทดสอบ• เครื่องมอืทดสอบการ Coverage• เครื่องมอืการประมวลผลการทดสอบ• เครื่องมอืจดัการกับกรณีทดสอบ

Page 19: ซอฟต์แวร์พัฒนาระบบ ฐานข้อมูล บท ที่  7  การทดสอบโปรแกรม

แบบต่าง ๆ ของการทดสอบ• Unit Test• Integration Test• Functional Test (Features Test, Acceptance

Test)• Stress Test• Performance Test• Qualification Test• Loading Test• Compatibility Test• Installation Test• Regression Test