




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、1Chapter 17Software Testing StrategiesSoftware Engineering: A Practitioners Approach, 7/e by Roger S. Pressman2Software TestingTesting is the process of exercising a program with the specific intent of finding errors prior to delivery to the end user.3Strategic ApproachTo perform effective testing,
2、you should conduct effective technical reviews. By doing this, many errors will be eliminated before testing commences.Testing begins at the component level and works outward toward the integration of the entire computer-based system. Different testing techniques are appropriate for different softwa
3、re engineering approaches and at different points in time.Testing is conducted by the developer of the software and (for large projects) an independent test group.Testing and debugging are different activities, but debugging must be accommodated(容納) in any testing strategy. 4V & VVerification(驗證) re
4、fers to the set of tasks that ensure that software correctly implements a specific function. Validation(確認(rèn)) refers to a different set of tasks that ensure that the software that has been built is traceable to customer requirements. Boehm Boe81 states this another way: Verification: Are we building t
5、he product right? Validation: Are we building the right product?5Who Tests the Software?developerindependent testerUnderstands the system but, will test “gently”(溫和地)and, is driven by deliveryMust learn about the system,but, will attempt to break(破壞) itand, is driven by quality6Testing StrategySyste
6、m engineeringAnalysis modelingDesign modelingCode generationUnit testIntegration testValidation testSystem test7Testing StrategyWe begin by testing-in-the-small and move toward testing-in-the-largeFor conventional softwareThe module (component) is our initial focusIntegration of modules followsFor O
7、O softwareour focus when “testing in the small” changes from an individual module (the conventional view) to an OO class that encompasses attributes and operations and implies communication and collaboration8Strategic Issues (參考P324)Specify product requirements in a quantifiable manner long before t
8、esting commences. State testing objectives explicitly. Understand the users of the software and develop a profile(輪廓) for each user category.Develop a testing plan that emphasizes “rapid cycle testing”Build “robust” software that is designed to test itselfUse effective technical reviews as a filter
9、prior to testingConduct technical reviews to assess the test strategy and test cases themselves. Develop a continuous improvement approach for the testing process. 9Unit Testingmoduleto betestedtest casesresultssoftwareengineer10Unit Testinginterface local data structuresboundary conditionsindepende
10、nt pathserror handling pathsmoduleto betestedtest cases11Unit Test EnvironmentModulestubstubdriverRESULTSinterface local data structuresboundary conditionsindependent pathserror handling pathstest cases驅(qū)動模塊樁模塊被測模塊12Integration Testing StrategiesOptions:一步到位:“big bang”(大爆炸)approach增量集成:the incrementa
11、l construction strategy13Top Down Integrationtop module is tested with stubs stubs are replaced one at a time depth firstas new modules are integrated, some subset of tests is re-runABCDEFG1415Top Down Integration Breadth-first integration16Bottom-Up Integrationdrivers are replaced one at a time, de
12、pth firstworker modules are grouped into builds and integratedABCDEFGclusterBottom-Up Integration由底向上集成測試的步驟示例1718Sandwich Testing(混合方式測試)Top modules aretested with stubsWorker modules are grouped into builds and integratedABCDEFGcluster首先對含讀操作的子系統(tǒng)自底向上直至根結(jié)點模塊進(jìn)行組裝和測試;然后對含寫操作的子系統(tǒng)做自頂向下的組裝與測試。19Regressi
13、on Testing(回歸測試)Regression testing is the re-execution of some subset of tests that have already been conducted to ensure that changes have not propagated unintended side effects.Whenever software is corrected, some aspect of the software configuration (the program, its documentation, or the data th
14、at support it) is changed. Regression testing helps to ensure that changes (due to testing or for other reasons) do not introduce unintended behavior or additional errors.Regression testing may be conducted manually, by re-executing a subset of all test cases or by using automated capture/playback t
15、ools.20Smoke Testing(冒煙測試)Smoke testing is a common approach of Integration Testing by creating “daily builds(當(dāng)前版本)” for product software.Smoke testing steps:Software components that have been translated into code are integrated into a “build.” (第1步-構(gòu)造構(gòu)建)A build includes all data files, libraries, r
16、eusable modules, and engineered components that are required to implement one or more product functions.A series of tests is designed to expose errors that will keep the build from properly performing its function. (第2步-測試構(gòu)建)The intent should be to uncover “show stopper(項目阻塞)” errors that have the h
17、ighest likelihood of throwing the software project behind schedule.The build is integrated with other builds and the entire product (in its current form) is smoke tested daily. (第3步-集成構(gòu)建并對當(dāng)前獲得的軟件版本進(jìn)行冒煙測試)The integration approach may be top down or bottom up.21Smoke Testing冒煙測試(微軟最早提出的方法)是指軟件人員對個人新開發(fā)
18、的軟件版本進(jìn)行驗證測試,確保新增代碼段后軟件產(chǎn)品不出故障。只有通過了冒煙測試后,才能提交專門的測試組進(jìn)行軟件功能的測試。22Object-Oriented Testingbegins by evaluating the correctness and consistency of the analysis and design modelstesting strategy changesthe concept of the unit broadens(拓展) due to encapsulationintegration focuses on classes and their executi
19、on across a thread or in the context of a usage scenariovalidation uses conventional black box methodstest case design draws on conventional methods, but also encompasses special features23OO Testing Strategyclass testing is the equivalent of unit testingoperations within the class are testedthe sta
20、te behavior of the class is examinedintegration applied three different strategiesthread-based testingintegrates the set of classes required to respond to one input or eventuse-based testingintegrates the set of classes required to respond to one use casecluster testingintegrates the set of classes
21、required to demonstrate one collaboration24High Order TestingValidation testing(確認(rèn)):focus is on software requirementsAlpha/Beta testing:focus is on customer usageSystem testing:focus is on system integrationStress testing(壓力) :executes a system in a manner that demands resources in abnormal(異常) quan
22、tity, frequency, or volume.Performance Testing:test the run-time performance of software within the context of an integrated system.Recovery testing:forces the software to fail in a variety of ways and verifies that recovery is properly performedSecurity testing:verifies that protection mechanisms b
23、uilt into a system will.2022/7/1825Validation testing有效性測試軟件配置復(fù)審驗收測試和安裝測試可交付的軟件2022/7/1826Acceptance Testing如果軟件是為某個客戶定制開發(fā)的,則需要進(jìn)行一系列的驗收測試來保證客戶對軟件滿意。驗收測試是以用戶為主的測試。軟件開發(fā)人員和質(zhì)量保證人員也應(yīng)參加。用戶參加設(shè)計測試用例,并使用實際數(shù)據(jù)進(jìn)行測試。2022/7/1827Alpha testing & Beta Testing如果軟件是給大眾(或一類用戶)使用的,則讓每一個用戶都參加驗收測試是不現(xiàn)實的。軟件廠商通常采用Alpha測試和Bet
24、a測試來發(fā)現(xiàn)那些通常只有最終用戶才能發(fā)現(xiàn)的錯誤。Alpha測試:開發(fā)者在場指導(dǎo)用戶進(jìn)行的測試。由開發(fā)者記錄用戶使用中出現(xiàn)的錯誤和其它問題。Beta測試:不同用戶在自己的使用場所進(jìn)行的測試。由用戶記錄(或自動記錄)遇到的問題,并定期報告(或網(wǎng)絡(luò)發(fā)送)給開發(fā)者。2022/7/1828System testing測試目的:把確認(rèn)合格的軟件安裝到系統(tǒng)中后,檢查能否與系統(tǒng)中的其余部分協(xié)調(diào)運(yùn)行,完成預(yù)先規(guī)定的任務(wù)。系統(tǒng)測試不只限于“系統(tǒng)”。如果軟件產(chǎn)品是一個程序,那么系統(tǒng)測試就是力圖證明程序與其目標(biāo)相符的過程。程序目標(biāo)用戶文件程序系統(tǒng)測試2022/7/1829 壓力測試檢查在異常情況下,系統(tǒng)可以運(yùn)行到何種
25、程度的測試。例如:設(shè)計并發(fā)訪問用戶數(shù)特別多(按數(shù)量級增加)的測試用例,測試軟件是否能正常響應(yīng)。設(shè)計需要占用最大存儲量或其它資源的測試用例進(jìn)行測試。設(shè)計出會對常駐內(nèi)存的數(shù)據(jù)過度訪問的測試用例進(jìn)行測試。 Stress testing 2022/7/1830性能測試是要檢查系統(tǒng)是否滿足在需求說明書中規(guī)定的性能。特別是對于實時系統(tǒng)或嵌入式系統(tǒng)。性能測試常常需要與壓力測試結(jié)合進(jìn)行,常要求同時進(jìn)行硬件和軟件檢測。性能測試設(shè)計指標(biāo)通常包括:響應(yīng)時間、吞吐量、輔存區(qū)(如緩沖區(qū)、工作區(qū))大小、處理精度等。Performance testing2022/7/1831恢復(fù)測試是要證實在修復(fù)硬件故障(如掉電、硬件或網(wǎng)
26、絡(luò)出錯等)后,系統(tǒng)能否正常繼續(xù)工作。采用人工手段模擬硬件故障,并檢查:錯誤探測功能系統(tǒng)能否發(fā)現(xiàn)故障;在故障發(fā)生時能否保護(hù)正在運(yùn)行的作業(yè)和系統(tǒng)狀態(tài);在系統(tǒng)恢復(fù)后能否從最后記錄下來的無錯誤狀態(tài)開始繼續(xù)執(zhí)行作業(yè)。掉電測試:測試軟件系統(tǒng)在發(fā)生電源中斷時能否保護(hù)當(dāng)時的狀態(tài)且不毀壞數(shù)據(jù);在電源恢復(fù)后能否從保留的斷點處重新進(jìn)行操作。Recovery testing2022/7/1832安全測試是檢驗系統(tǒng)的安全性和保密性措施是否發(fā)揮作用,有無漏洞。力圖破壞系統(tǒng)的保護(hù)機(jī)構(gòu)以進(jìn)入系統(tǒng)的常用方法有:正面攻擊或從側(cè)面攻擊系統(tǒng)中易受損壞的部分;以系統(tǒng)輸入為突破口,利用輸入容錯性進(jìn)行攻擊;申請并占用過多資源壓垮系統(tǒng)以破壞
27、安全措施;故意使系統(tǒng)出錯,利用恢復(fù)過程竊取用戶口令及有用信息;瀏覽那些邏輯上不存在,但物理上存在的各種記錄和資料等。 Security testing33Debugging: A Diagnostic Process34The Debugging Process35Debugging Efforttime requiredto diagnose thesymptom anddetermine thecausetime requiredto correct the errorand conductregression tests36Symptoms & Causessymptomcausesym
28、ptom and cause may be geographically separated symptom may disappear when another problem is fixedcause may be due to a combination of non-errors cause may be due to a system or compiler errorcause may be due to assumptions that everyone believessymptom may be intermittent(斷斷續(xù)續(xù)的)37Debugging Techniquesbrute force / testing(蠻干法)Backtracking(回溯法)Induction(歸納法)Deduction(演繹法)381.蠻干法(試湊法):根據(jù)錯誤狀況,憑經(jīng)驗設(shè)定一個可疑區(qū)域,然后采用一些簡單的糾錯手段(如增加重要變量值的動態(tài)顯示等),進(jìn)一步獲取出錯的細(xì)節(jié)信息,若找到出錯原因就進(jìn)行修改,若未找到則另設(shè)定一個可疑區(qū)域繼續(xù)找錯。2.回溯法(跟蹤法):針對出錯的地方,追蹤相關(guān)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 醫(yī)學(xué)倫理與醫(yī)患溝通的融合發(fā)展
- 互聯(lián)網(wǎng)醫(yī)療的崛起與發(fā)展前景
- 辦公自動化與區(qū)塊鏈選舉系統(tǒng)的創(chuàng)新之選
- 區(qū)塊鏈技術(shù)發(fā)展報告現(xiàn)狀與未來趨勢
- 《經(jīng)濟(jì)數(shù)據(jù)分析與應(yīng)用》課件
- 區(qū)塊鏈技術(shù)在智慧交通中的運(yùn)用及挑戰(zhàn)
- 《肉芽腫性血管炎》教學(xué)課件
- 小學(xué)語文六年級下冊教學(xué)工作總結(jié)模版
- 醫(yī)療AI技術(shù)對醫(yī)生職業(yè)角色的影響及應(yīng)對策略探討
- 皮膚鏡與病理活檢的辯證關(guān)系-從臨床案例看兩種技術(shù)的協(xié)同價值
- 2025-2030創(chuàng)新藥CRO行業(yè)競爭態(tài)勢及未來投資趨勢預(yù)測研究報告
- BS ISO 5675-2021 農(nóng)業(yè)拖拉機(jī)和機(jī)械. 一般用快速液壓接頭
- 2024年甘肅白銀希望職業(yè)技術(shù)學(xué)院招聘筆試真題
- 2025年高考?xì)v史答題技巧與答題模板專題08影響、作用類(答題模版)(學(xué)生版+解析)
- 韻達(dá)加盟合同協(xié)議
- 中小學(xué)五一節(jié)前安全教育班會課件
- 2025-2030中國藥物遞送系統(tǒng)行業(yè)市場深度分析及發(fā)展前景與投資研究報告
- 家裝個人清包合同協(xié)議
- 《運(yùn)動處方》課件-糖尿病人群運(yùn)動處方案例
- 兒童衛(wèi)生習(xí)慣的養(yǎng)成與學(xué)校教育的結(jié)合
- 手術(shù)室煙霧試題及答案
評論
0/150
提交評論