軟件工程英文教學課件:Ch17 Software Testing Strategies_第1頁
軟件工程英文教學課件:Ch17 Software Testing Strategies_第2頁
軟件工程英文教學課件:Ch17 Software Testing Strategies_第3頁
軟件工程英文教學課件:Ch17 Software Testing Strategies_第4頁
軟件工程英文教學課件:Ch17 Software Testing Strategies_第5頁
已閱讀5頁,還剩35頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

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(確認) 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驅動模塊樁模塊被測模塊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)自底向上直至根結點模塊進行組裝和測試;然后對含寫操作的子系統(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(當前版本)” for product software.Smoke testing steps:Software components that have been translated into code are integrated into a “build.” (第1步-構造構建)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步-測試構建)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步-集成構建并對當前獲得的軟件版本進行冒煙測試)The integration approach may be top down or bottom up.21Smoke Testing冒煙測試(微軟最早提出的方法)是指軟件人員對個人新開發(fā)

18、的軟件版本進行驗證測試,確保新增代碼段后軟件產品不出故障。只有通過了冒煙測試后,才能提交專門的測試組進行軟件功能的測試。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(確認):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有效性測試軟件配置復審驗收測試和安裝測試可交付的軟件2022/7/1826Acceptance Testing如果軟件是為某個客戶定制開發(fā)的,則需要進行一系列的驗收測試來保證客戶對軟件滿意。驗收測試是以用戶為主的測試。軟件開發(fā)人員和質量保證人員也應參加。用戶參加設計測試用例,并使用實際數據進行測試。2022/7/1827Alpha testing & Beta Testing如果軟件是給大眾(或一類用戶)使用的,則讓每一個用戶都參加驗收測試是不現實的。軟件廠商通常采用Alpha測試和Bet

24、a測試來發(fā)現那些通常只有最終用戶才能發(fā)現的錯誤。Alpha測試:開發(fā)者在場指導用戶進行的測試。由開發(fā)者記錄用戶使用中出現的錯誤和其它問題。Beta測試:不同用戶在自己的使用場所進行的測試。由用戶記錄(或自動記錄)遇到的問題,并定期報告(或網絡發(fā)送)給開發(fā)者。2022/7/1828System testing測試目的:把確認合格的軟件安裝到系統(tǒng)中后,檢查能否與系統(tǒng)中的其余部分協(xié)調運行,完成預先規(guī)定的任務。系統(tǒng)測試不只限于“系統(tǒng)”。如果軟件產品是一個程序,那么系統(tǒng)測試就是力圖證明程序與其目標相符的過程。程序目標用戶文件程序系統(tǒng)測試2022/7/1829 壓力測試檢查在異常情況下,系統(tǒng)可以運行到何種

25、程度的測試。例如:設計并發(fā)訪問用戶數特別多(按數量級增加)的測試用例,測試軟件是否能正常響應。設計需要占用最大存儲量或其它資源的測試用例進行測試。設計出會對常駐內存的數據過度訪問的測試用例進行測試。 Stress testing 2022/7/1830性能測試是要檢查系統(tǒng)是否滿足在需求說明書中規(guī)定的性能。特別是對于實時系統(tǒng)或嵌入式系統(tǒng)。性能測試常常需要與壓力測試結合進行,常要求同時進行硬件和軟件檢測。性能測試設計指標通常包括:響應時間、吞吐量、輔存區(qū)(如緩沖區(qū)、工作區(qū))大小、處理精度等。Performance testing2022/7/1831恢復測試是要證實在修復硬件故障(如掉電、硬件或網

26、絡出錯等)后,系統(tǒng)能否正常繼續(xù)工作。采用人工手段模擬硬件故障,并檢查:錯誤探測功能系統(tǒng)能否發(fā)現故障;在故障發(fā)生時能否保護正在運行的作業(yè)和系統(tǒng)狀態(tài);在系統(tǒng)恢復后能否從最后記錄下來的無錯誤狀態(tài)開始繼續(xù)執(zhí)行作業(yè)。掉電測試:測試軟件系統(tǒng)在發(fā)生電源中斷時能否保護當時的狀態(tài)且不毀壞數據;在電源恢復后能否從保留的斷點處重新進行操作。Recovery testing2022/7/1832安全測試是檢驗系統(tǒng)的安全性和保密性措施是否發(fā)揮作用,有無漏洞。力圖破壞系統(tǒng)的保護機構以進入系統(tǒng)的常用方法有:正面攻擊或從側面攻擊系統(tǒng)中易受損壞的部分;以系統(tǒng)輸入為突破口,利用輸入容錯性進行攻擊;申請并占用過多資源壓垮系統(tǒng)以破壞

27、安全措施;故意使系統(tǒng)出錯,利用恢復過程竊取用戶口令及有用信息;瀏覽那些邏輯上不存在,但物理上存在的各種記錄和資料等。 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.蠻干法(試湊法):根據錯誤狀況,憑經驗設定一個可疑區(qū)域,然后采用一些簡單的糾錯手段(如增加重要變量值的動態(tài)顯示等),進一步獲取出錯的細節(jié)信息,若找到出錯原因就進行修改,若未找到則另設定一個可疑區(qū)域繼續(xù)找錯。2.回溯法(跟蹤法):針對出錯的地方,追蹤相關

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論