CHAPTER 1 Software Verification and Validation SE34 5
Feb 25, 2016
CHAPTER 1Software Verification and
ValidationSE345
วตถประสงคเฉพาะบท
1. เพอใหนกศกษารจกและเขาใจศพท เทคนคและพนฐานความรทใชในการทดสอบซอฟตแวร
2. เพอใหนกศกษาเขาใจกระบวนการ พฒนาซอฟตแวร
บรรยาย (2 ชม.) ศกษาและนำาเสนอกรณตวอยาง (30 นาท) Pre-Test (15 นาท) Post-Test (15 นาท) ศกษาดวยตนเอง (6 ชม.)
Pre-Test ใหนกศกษาทำา Pre-Test บทท 1 ลงในกระดาษทอาจารยผสอนไดจดเตรยมไวให ใชเวลา 15 นาท
ความรเบองตนเกยวกบกระบวนการพฒนาซอฟตแวรและการทดสอบซอฟตแวร
1.1 วงจรชวตการพฒนาซอฟตแวร (SDLC)1.2 ความรเบองตนเกยวกบการทดสอบซอฟตแวร (Software Testing คาใชจายทเกดขนเมอเกดบค (The Cost
of Bugs) ทมการทดสอบซอฟตแวร (Software
Testing Teams)1.3 การทวนสอบและการทดสอบซอฟตแวร (Software Verification and Validation)
1.4 คำาศพททเกยวของ (Terminologies)1.5 ศกษากรณตวอยางผลกระทบทเกดจากการ
ไมทำาการทดสอบ
วงจรชวตการพฒนาซอฟตแวร (SDLC)
ในกระบวนการพฒนาซอฟตแวร มแบบจำาลองทหลากหลายเพอใชเปนแบบจำาลองในการพฒนาซอฟตแวร เชน Waterfall Model , Spiral Model , Incremental Model , Agile , Scrum , XP Model , V Model , RUP Model , RAD Model ฯลฯ ซงแบบจำาลองเหลานมขนตอนตาง ๆ ทแตกตางกนไปในกจกรรมยอยของแตละขนตอน
การบาน บทท 1 งานเดยว (12 คะแนน) 1. ใหนกศกษาทำาการศกษาคนควาดวยตนเองเกยวกบแบบจำาลองตางๆ มาอยางนอย 3 แบบจำาลอง พรอมทงทำาสรปสงภายในวนศกรท 29 ตลาคม กอน 16.30 น. สงใน E-learning รายละเอยดกจกรรม / ขนตอนของแบบจำาลอง รปภาพแบบจำาลอง ขอด / ขอเสย
สงชาหกวนละ 1 คะแนนให Save ชอไฟล HW1-1_รหส
นกศกษา.docx
วงจรชวตการพฒนาซอฟตแวร (SDLC)
สรปไดวาวงจรชวตการพฒนาซอฟตแวร (Software Development Life Cycle) มขนตอนดงน
Project planning, feasibility study: Systems analysis, requirements
definition: Systems design: Implementation: Integration and testing: System Testing Acceptance, installation Maintenance:
เอกสารทเกดขนในกระบวนการพฒนาซอฟตแวร เอกสารใน Project planning,
feasibility study: Software Project Management Plan (SPMP)
Feasibility study Software Configuration Management Plan (SCMP)
Test Plan (TP) Systems analysis,
requirements definition: Software Requirement Specification (SRS)
เอกสารทเกดขนในกระบวนการพฒนาซอฟตแวร
Systems design: Software Design Documentation (SDD)
Test Case (TC) Test Script (TS)
Implementation: Source Code (SC) Unit Testing Report (UTR)
เอกสารทเกดขนในกระบวนการพฒนาซอฟตแวร
Integration and testing: Integration Test Report (ITR)
System Testing System Test Report (STR)
Acceptance, installation Acceptance Test Report (ATR) Installation Document (ID)
Maintenance: User Manual (UM)
Why do we test? ม 2 เหตผลทตองทดสอบซอฟตแวร คอ
คณภาพ (หรอการยอมรบ) และการคนพบปญหา
สาเหตทตองทำาการทดสอบเพราะวามขอผดพลาด โดยเฉพาะอยางยงความเทยงตรงของซอฟตแวร และระบบตาง ๆ ทไดรบการควบคม
Per The Requirements
As Systems Specified It
As Engineering Designed It
If You Don’t Do Both …
As the Factory Built It
As Integration Installed It
What the Customer Wanted
You Can Meet the Spec, But …
Without Validation as part of the process, you will waste:• Time• Energy• Money• Resources
… and still not get it right.
Why Do Bugs Occur?
There are several reasons specifications are the largest bug producer. In many instances a spec simply isn’t written. Other reason may be that the spec isn’t thorough enough, it’s constantly changing, or it’s not communicated well to the entire development team. Planning software is vitally important. If it’s not done correctly, bugs will be created.
The next largest source of bugs is the design. This is where the programmers lay out their plan for the software. Compare it to an architect creating the blueprints for a building. Bugs occur here for the same reason they occur in the specification. It’s rushed, changed, or not well communicated.
Bugs are caused for numerous reasons, but, in this sample project analysis, the main cause can be traced to the specification
What Exactly Does a Software Tester Do? The goal of a software tester is
to find bugs. The goal of a software tester is
to find bugs and find them as early as possible.
The goal of a software tester is to find bugs, find them as early a possible, and make sure they get fixed.
Software tester should have:
They are explorers. They are troubleshooters. They are relentless. They are creative. They are (mellowed)
perfectionists. They exercise good judgment. They are tactful an diplomatic. They are persuasive.
Software tester should have:
They are explorers. ผทดสอบตองทำาตวเปนนกสำารวจ และไมกลว
ทจะอยในเหตการณทเขาไมเจอพบ และมใจรกทจะทดสอบซอฟตแวรใหม ๆ
They are troubleshooters. ผทดสอบตองเปนนกแกไขปญหา ผทดสอบทดควรหาเหตผลวาทำาไมงานนนถง
ไมผานการทดสอบ มสาเหตเกดจากอะไร
Software tester should have:
They are relentless. ผทดสอบตองมความอดทนทจะคนหาขอผด
พลาด และตองมความพยายาม เขาจะเกดความรสกวาปญหาถกคลคลายไปอยางรวดเรวหรอยากทจะเกดขนมาอก
บางครงการพบขอผดพลาดอาจเกดจากความบงเอญกเปนได
ผทดสอบตองทำาทกวถทางทจะใหพบขอผดพลาดใหได
Software tester should have:
They are creative. วธการทดสอบททำาอยนนหากไมเพยงพอทจะ
กำาจดขอผดพลาดใหออกไปได ผทดสอบจงตองมการคดสรางสรรคเพอหาวธในการหาขอผดพลาดหรอขอบกพรอง
They are (mellowed) perfectionists. ผทดสอบตองมความสขม รอบคอบ มงทจะหา
ขอผดพลาด
Software tester should have:
They exercise good judgment. ผทดสอบตองมการฝกฝนในการตดสนใจและ
ใชดลพนจในการตดสนใจเกยวกบสงทเขากำาลงทดสอบวาสงเหลานนเปนขอผดพลาดหรอขอบกพรองหรอไม
They are tactful an diplomatic. ผทดสอบตองมความเชยวชาญ มไหวพรบ
และมชนเชง เขาควรมชนเชงในการพดทจะบอก
Programmer ถงขอผดพลาดทเกดขน
Software tester should have:
They are persuasive. ผทดสอบตองมความสามารถในการโนมนาว
จตใจ หรอสามารถเกลยกลอม ขอผดพลาดหรอขอบกพรองทผทดสอบพบ
นนอาจจะไมรนแรง หรอไมสงผลกระทบทจะทำาใหระบบเสยหาย ดงนนผทดสอบตองแสดงใหเหนวาเพราะเหตใด
หรอขอผดพลาดหรอขอบกพรองนนสมควรทตองไดรบการแกไข ( Fixed) ผทดสอบตองแสดงใหทมเหนวาเพราะอะไรขอผดพลาดหรอขอบกพรองนควรไดรบการแกไข (Fixed)
ทมการทดสอบซอฟตแวร(Software Testing Teams) Software Customers
Those who contract for the software to be developed
Software Users Those who will use the software
ทมการทดสอบซอฟตแวร(Software Testing Teams) Software Developers
Those who involve or assist inWriting requirements from the software user,
Designing the software,Building the software, andChanging and maintaining the software as needed
Development Testers / Software Testers Those who perform the check
function on the software
ทมการทดสอบซอฟตแวร(Software Testing Teams) Senior Management
CEO of the organization and other senior executives who are responsible for fulfilling the organization mission. Information technology is an activity that supports fulfilling that mission.
Auditor The individual or group responsible
for evaluating the effectiveness, efficiency, and adequacy of controls in the information technology area. Testing is considered a control by the audit function.
ทมการทดสอบซอฟตแวร(Software Testing Teams) Project manager
The individual responsible for managing the building, maintaining, and/or implementing of software.
The Cost of Bugs The costs are logarithmic – that
is, they increase tenfold as time increase. A bug found and fixed during the early stages when the specification is being written might cost next to nothing, or 1$ in our example. The same bug, if not found until the software is coded and tested, might cost $10 to $100. If a customer finds it, the cost could easily be thousands or even millions of dollars.
The cost to fix bugs can increase dramatically over time.
Software Verification and Validation
Software Verification
Verification helps answer the question “Are we building the product right?”
Verification activities are defined around three basic processes: inspection, measurement, and configuration management.
เราไดสรางระบบอยางถกตองหรอไม ซอฟตแวรทพฒนาตรงกบขอกำาหนดทระบไวหรอไม
Software Validation
Validation activities are performed after the software is developed to determine if the software correctly implements the requirements.
Validation helps answer the question “Did we build the right product?”
เราไดสรางระบบทถกตองหรอไม ซอฟตแวรทพฒนาตรงกบความตองการหรอไม
คำาศพททเกยวของ (Terminologies)
Software Testing (การทดสอบซอฟตแวร) เปนกจกรรมทจดทำาขนเพอประเมนและ
ปรบปรงคณภาพของซอฟตแวร โดยการตรวจหาขอผดพลาดและปญหาทเกดขน แลวทำาการแกไขขอผดพลาดหรอปญหาดงกลาวใหถกตอง [IEEE, 2004] วตถประสงคของการทดสอบซอฟตแวร กเพอพสจนวาซอฟตแวรทำางานไดครบทกฟงกชนตามขอกำาหนดความตองการ และตรวจสอบวาแตละฟงกชนสามารถประมวลผลขอมลไดอยางถกตอง
คำาศพททเกยวของ (Terminologies)
Errors (ความผดพลาด) คนทำาผด หรอเกดจากการเขาใจความหมายใน
เอกสารผดกจะทำาใหการเขยน Code ผดไปดวย ซงเรยกขอผดพลาดนวาความผดพลาดททำาใหเกด Bug ความผดพลาดจากความตองการ (Requirement) อาจขยายความผดพลาดไปยงการออกแบบ (Design) และ Code
คำาศพททเกยวของ (Terminologies)
Fault (ความคลาดเคลอน) ความคลาดเคลอนเปนผลมาจากความผดพลาด
(Error) ทนำาเสนอไดอะแกรม narrative text, dataflow diagrams, hierarchy charts, source code และอน ๆ ความคลาดเคลอนทยากจะเขาใจ เมอผออกแบบ (Designer) ละเลยขอผดพลาด ผลของความคลาดเคลอนทเกดขน อาจเกดจากการขาดหาย (Missing) ทควรนำาเสนอ
อาจเกดจากขอมลในเอกสารขาดหาย ตกหลน Failure (ความลมเหลว)
ความลมเหลว เกดขนเมอเกด Fault กอใหเกดความเสยหายตอตวทำางานระบบ มผลใน
ทางลบตอผใชและลกคา
คำาศพททเกยวของ (Terminologies)
Bugs จะพบไดตอน Coding
Crashes มผลกระทบทำาใหระบบลม / พง ใชไมได
Indicant (เหตการณ) เหตการณทเกดขนทเกยวของกบความลมเหลวโดย
มการแจงเตอนใหผใชทราบวาเกด Failure Defects (ขอบกพรอง)
เปนขอบกพรองทพบกอนการ Coding Missing / Wrong / Extra
What are you test for? A defect is a variance from a
desired product attribute. Any variance at all is a defect. Wrong – A variance from
customer/user specification Missing – A specified or wanted
requirement is not in the built product
Extra – May be an attribute desired by the user, but a defect nonetheless
กรณตวอยางผลกระทบทเกดขน
Disney’s Lion King, 1994-1995: In the fall of 1994, the Disney company released its first multimedia CD-ROM game for children, The Lion King Animated Storybook. Although many other companies had been marketing children’s programs for years, this was Disney’s first venture into the market and it was highly promoted and advertised. Sales were huge. It was “the game to buy” for children that holiday season. What happened, however, was a huge debacle. On December 26, the day after Christmas, Disney’s customer support phones began to ring, and ring, and ring. Soon the phone support technicians were swamped with calls from angry parents with crying children who couldn’t get the software to work. Numerous stories appeared in newspapers and on TV news. It turns out that Disney failed to properly test the software on the many different PC models available on the market. The software worked on a few systems—likely the ones that the Disney programmers used to create the game—but not on the most common systems that the general public had.
ศกษากรณตวอยางผลกระทบทเกดขน
กจกรรมในชนเรยนใชเวลา 30 นาท (10 คะแนน)
ใหนกศกษาทำาการศกษา “Infamous Software Error Case Studies” และวเคราะห วจารณถงสาเหตททำาใหเกดขอผดพลาดคออะไร ใหเขยนสงอาจารยเปนรปเอกสารและออกมาวเคราะหใหเพอนฟงหนาหอง Intel Pentium Floating-Point Division Bug, 1994:
NASA Mars Polar Lander, 1999:
Patriot Missile Defense System, 1991:
The Y2K (Year 2000) Bug, circa 1974
Dangerous Viewing Ahead, 2004
Questions & Answers
“What we anticipate seldom occurs; what we least expected generally happens.”
- Benjamin Disraeli
“สงทเราคาดคด จะไมคอยเกดขน สงทเราคาดไมถงสวนใหญกจะเกดขน”
Post-Test (10 คะแนน) ใหนกศกษาทำา Post-Test บทท 1 ลงในกระดาษทอาจารยผสอนไดจดเตรยมไวให ใชเวลา 15 นาท
การศกษาดวยตนเอง
เพอการเตรยมตวเรยนในบทท 2 ใหนกศกษาทำาการศกษาเอกสาร “Software Test
Plan” ตามเอกสาร ใน E-Learning “Practial Support for CMMI-SW Software Project Documentation Using IEEE Software Engineering Standards” by Susan K. Land and John W. Walz, Wiley Interscience Publication, 2006. แลวทำาการสรางแบบฟอรม Template เปนภาษาไทย เพอนำาไปใชในการวางแผนการทดสอบตอไป (10 คะแนน)
สงใน E-learning วนจนทรท 1 พฤศจกายน กอนเวลา 12.00 น.