การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 ...
DESCRIPTION
การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม. ปริญญา น้อยดอนไพร สาขาวิชาวิทยาการคอมพิวเตอร์ คณะวิทยาศาสตร์และเทคโนโลยี มหาวิทยาลัยราช ภัฏ สุราษฎร์ธานี. การทดสอบโปรแกรม. กระบวนการในการทดสอบ กระบวนการในการหาข้อผิดพลาดของโปรแกรม กลยุทธ์การทดสอบ เครื่องมือช่วยในการทดสอบ - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/1.jpg)
การออกแบบและพฒันาซอฟต์แวร์
บทท่ี 7 การทดสอบโปรแกรมปรญิญา น้อยดอนไพร
สาขาวชิาวทิยาการคอมพวิเตอร ์คณะวทิยาศาสตร์และเทคโนโลยี
มหาวทิยาลัยราชภัฏสรุาษฎรธ์านี
![Page 2: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/2.jpg)
การทดสอบโปรแกรม
• กระบวนการในการทดสอบ• กระบวนการในการหาขอ้ผิดพลาดของ
โปรแกรม• กลยุทธก์ารทดสอบ• เครื่องมอืชว่ยในการทดสอบ• แบบต่าง ๆ ของการทดสอบ
![Page 3: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/3.jpg)
Testing phases
Componenttesting
Integrationtesting
Software developer Independent testing team
![Page 4: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/4.jpg)
The defect testing process
Design testcases
Prepare testdata
Run programwith test data
Compare resultsto test cases
Testcases
Testdata
Testresults
Testreports
![Page 5: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/5.jpg)
Black-box testingIe
Input test data
OeOutput test results
System
Inputs causinganomalousbehaviour
Outputs which revealthe presence ofdefects
![Page 6: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/6.jpg)
Equivalence partitioning
System
Outputs
Invalid inputs Valid inputs
![Page 7: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/7.jpg)
• 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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/8.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/9.jpg)
White-box testing
Componentcode
Testoutputs
Test data
DerivesTests
![Page 10: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/10.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/11.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/12.jpg)
• 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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/13.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/14.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/15.jpg)
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 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/16.jpg)
Top-down testing
Level 2Level 2Level 2Level 2
Level 1 Level 1Testingsequence
Level 2stubs
Level 3stubs
. . .
![Page 17: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/17.jpg)
Bottom-up testing
Level NLevel NLevel NLevel NLevel N
Level N–1 Level N–1Level N–1
Testingsequence
Testdrivers
Testdrivers
![Page 18: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/18.jpg)
เครื่องมอืชว่ยในการทดสอบ• เครื่องมอืสรา้งกรณีทดสอบ• เครื่องมอืทดสอบการ Coverage• เครื่องมอืการประมวลผลการทดสอบ• เครื่องมอืจดัการกับกรณีทดสอบ
![Page 19: การออกแบบและพัฒนาซอฟต์แวร์ บทที่ 7 การทดสอบโปรแกรม](https://reader030.vdocuments.pub/reader030/viewer/2022033017/56816046550346895dcf68fc/html5/thumbnails/19.jpg)
แบบต่าง ๆ ของการทดสอบ• Unit Test• Integration Test• Functional Test (Features Test, Acceptance
Test)• Stress Test• Performance Test• Qualification Test• Loading Test• Compatibility Test• Installation Test• Regression Test