




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、word軟件測試方案測試目的1. 練習和掌握軟件測試管理的一般過程與步驟;2. 掌握測試管理的人工過程和能夠通過相關管理軟件實現以下工作:a) 配置軟件資產信息、軟件需求、軟件模型和缺陷數據庫;b) 創立和管理多個測試組和用戶;c) 配置測試環境、編寫詳細測試方案、安排測試進度;d) 設計測試腳本、測試用例;e) 實施測試、執行測試和評估測試。測試選題對PriorDate程序計算當前輸入日期的前一天的測試。測試人員何:軟件測試方案及相關資料的編寫與收集。侯:對特定問題編寫程序代碼,并對其進行黑盒測試。金:對特定問題編寫程序代碼,并對其進行白盒測試。測試方法使用白盒測試技術,測試內容包括語句覆蓋
2、測試、分支覆蓋測試、條件覆蓋測試、分支/條件覆蓋測試、條件組合覆蓋測試及根本路徑測試。測試資料白盒測試 測試規劃基于產品的內部結構進行測試,檢查內部操作是否按規定執行,軟件各個局部功能是否得到充分使用,那么這種測試方法稱為白盒測試(White-box Testing)方法。 白盒測試又稱為結構測試、邏輯驅動測試或基于程序的測試,一般用來分析程序的內部結構。 白盒測試將被測程序看作一個翻開的盒子,測試者能夠看到被測源程序,可以分析被測程序的內部結構,此時測試的焦點集中在根據其內部結構設計測試用例。 白盒測試要求是對某些程序的結構特性做到一定程度的覆蓋,或者說這種測試是“基于覆
3、蓋率的測試。 通常的程序結構覆蓋有: 語句覆蓋 判定覆蓋 條件覆蓋 判定/條件覆蓋 路徑覆蓋軟件測試過程單元測試:針對每個單元的測試, 以確保每個模塊能正常工作為目標。集成測試:對已測試過的模塊進行組裝,進行集成測試。目的在于檢驗與軟件設計相關的程 序結構問題。確認有效性測試:是檢驗所開發的軟件能否滿足所有功能和性能需求的最后手段。系統測試:檢驗軟件產品能否與系統的其他局部比方,硬件、數據庫及操作人員協調 工作。驗收用戶測試:檢驗軟件產品質量的最后一道工序。主要突出用戶的作用,同時軟件開 發人員也應有一定程度的參與。數據整理測試所得到的用例測試報告、BUG報告,需要進行反應
4、和最后的歸檔,歸檔的工作按照工程方案中所規定的內容進行,反應的工作在測試項結束后,整理成測試總結報告后進行,具體的日期,在工程方案中有規定。不同階段的測試,都需要重復以上的步驟。其他必要的數據整理的工作,由工程經理在進行過程中進行安排。PriorDate程序測試報告白盒問題描述: 定義一個PriorDate函數,PriorDate函數為了獲得當前輸入日期的前一個日期, 執行如下操作:如果輸入日期day變量值大于1,那么把day變量的值減1;如果輸入日期是212月份中某月的第一天,那么把day變量的值置為前一個月的最后一天,month變量的值減1;如果輸入日期是1月的第一天,那么day變量的值置
5、為31,month變量的值置為12,year變量的值減1。關于最后一天的判斷:如果是有31天的月份(1,3,5,7,8,10,12),day變量值為31;如果是有30天的月份(4,6,9,11),day變量值為30;如果是有29天的月份(閏年的2月),day變量值為29;如果是有28天的月份(非閏年的2月),day變量值為28。程序代碼開發環境:Windows7、VC+:#include <iostream> using namespace std; int main() int lastday,las
6、tmonth,lastyear; int day,month,year; bool c1=1,c2=1,c3=1; while(c1&&c2&&c3) cout<<"Enter today's date in form YYYY MM DD"<<endl; cout<<"例如2012年6月7號,輸入形式為:2012 6 7"<<endl; cin>>year>>month>>day; c1=(day>=1)&&
7、(day<=31); c2=(month>=1)&&(month<=12); c3=(year>=1900)&&(year<=2050); if (!c1) cout<<"Value of day not in the range 131"<<"n" if (!c2) cout<<"Value of month not in the range 112"<<"n" if (!c3) cout<<
8、"Value of year not in the range 19002050"<<"n" switch(month) case 5: case 7: case 10: case 12: if(day>1) lastday=day-1; lastmonth=month; lastyear=year; else lastday=30; lastmonth=month-1; lastyear=year; break; case 2: case 4: case 6: case 8: case 9: case 11: if(day>1)
9、 lastday=day-1; lastmonth=month; lastyear=year; else lastday=31; lastmonth=month-1; lastyear=year; break; case 3: if(day>1) lastday=day-1; lastmonth=month; lastyear=year; else if(year%4=0&&year%100!=0|year%400=0) lastday=29; lastmonth=2; lastyear=year; else lastday=28; lastmonth=2; lastye
10、ar=year; break; case 1: if(day>1) lastday=day-1; lastmonth=month; lastyear=year; else lastday=31; lastmonth=12; if(year!=1900) lastyear=year-1; else cout<<"lastyear is not in range"<<endl; break; default: cout<<"error!"<<endl; if(c1&&c2&&
11、;c3) cout<<"the lastday is:"<<lastyear<<" "<<lastmonth<<" "<<lastday<<"n"<<endl; return 0;測試方法:白盒測試語句覆蓋、分支覆蓋、條件覆蓋、分支/條件覆蓋、條件組合覆蓋及根本路徑測試方法測試用例設計: 程序的流程圖如下列圖:YUXWVTJPHGFECBAOYesYesNoYesYesYesYesYesNoNoNoNoNoNoNodef
12、aultSQLNMK開始天數1到31月份1到12打印輸入天數出錯打印輸入月份出錯年份1812到2012Month匹配打印輸入年份出錯day>1day>1day>1day>1語句語句5,7,10,122,4,6,8,9,11語句語句語句潤年語句語句語句year!=1812語句語句語句c1&&c2&&c3打印結束31DIRYZ1. 語句覆蓋 語句覆蓋就是設計假設干個測試用例,運行被測程序,使得每一可執行語句至少執行一次。n 測試用例的設計格式如下:n 【輸入的(a, b, x),輸出的(a, b, x)】測試數據執行路徑預期結果實際結果mon
13、th=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2022OBDFHLYthe las
14、tday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year
15、=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=
16、1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934602. 分支覆蓋 執行足夠的測試用例,使得程序中的每一個分支至少都通過一次 測試數據執行路徑預期結果實際結果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in t
17、he range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022m
18、onth=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2000 OBDFJRYthe lastday is2 29 2000the last
19、day is2 29 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in
20、rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934603. 條件覆蓋 執行足夠的測試用例,使得判定中的每個條件獲得各種可能的結果。 測試數據執行路徑預期結果實際結果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not i
21、n the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=1800OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in t
22、he range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022m
23、onth=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2000 OBDFJRYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday
24、is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934604.
25、 分支/條件覆蓋 執行足夠的測試用例,使得分支中每個條件取到各種可能的值,并使每個分支取到各種可能的結果。測試數據執行路徑預期結果實際結果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year
26、 not in the range 1812.2012error!month=0,day=0,year=1800OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=
27、12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastda
28、y is10 31 2022month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2004OBDFJRUYthe lastday is2 29 2004the lastday is2 29 2004month=3,day=1,year=2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022
29、the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31
30、-8589934605. 條件組合覆蓋執行足夠的例子,使得每個判定中條件的各種可能組合都至少出現一次。測試數據執行路徑預期結果實際結果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year n
31、ot in the range 1812.2012error!month=0,day=0,year=1800 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0
32、,day=1,year=1800OBCEGZValue of month not in the range 1.12Value of year not in the range 1812.2012error!Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=2000OACFGZValue of day not in the range 1.31Value of month not in the range 1.12error!Value of
33、day not in the range 1.31Value of month not in the range 1.12error!month=0,day=1,year=2000OBCFGZValue of month not in the range 1.12error!Value of month not in the range 1.12error!month=1,day=0,year=1800OADFKTXZValue of day not in the range 1.31Value of year not in the range 1812.2012Value of day no
34、t in the range 1.31Value of year not in the range 1812.2012month=1,day=1,year=1800OBDEKTXZValue of year not in the range 1812.2012Value of year not in the range 1812.2012month=1,day=0,year=2000OADFKTXZValue of day not in the range 1.31Value of day not in the range 1.31month=1,day=1,year=2000OBDFKTXY
35、the lastday is12 31 1999the lastday is12 31 1999month=12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day
36、=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2004OBDFJRUYthe lastday is2 29 2004the lastday is2 29 2004month=3,day=1,year=2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000
37、month=3,day=1,year=2022OBDFJRUYthe lastday is2 29 2022the lastday is2 29 2022month=3,day=1,year=2001OBDFJRUYthe lastday is2 28 2001the lastday is2 28 2001month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is
38、1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934606. 根本路徑測試方法 設計足夠的測試用例,覆蓋程序中所有可能的路徑,其中控制流圖如下列圖:123456798101114151312161718211920222
39、9252662324272830303031 測試數據執行路徑預期結果實際結果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012err
40、or!month=0,day=0,year=1800 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=1,year=1800OBCEGZValue
41、of month not in the range 1.12Value of year not in the range 1812.2012error!Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=2000OACFGZValue of day not in the range 1.31Value of month not in the range 1.12error!Value of day not in the range 1.31Value of month not in the range 1.12error!month=0,day=1,year=2000OBCFGZValue of month not in the range 1.12error!Value of month not in the range 1.12error!month=1,day=0,year=1800OADFKTXZValue of day not in the range 1.31Value of year not in the range 1812.2012Value of day not in the range 1.31V
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 公司新春福利活動方案
- 公司活動室建立策劃方案
- 公司日常游戲活動方案
- 公司羽毛球運動活動方案
- 公司游藝類拓展活動方案
- 公司整頓活動方案
- 公司聚餐溫馨活動方案
- 公司登高節活動方案
- 公司晚會活動策劃方案
- 公司環境日活動方案
- 湖南省婁底市漣源市2023-2024學年六年級下學期6月期末英語試題
- 上海市徐匯區市級名校2025屆物理高一第二學期期末考試模擬試題含解析
- 天一大聯盟2024屆高一數學第二學期期末統考試題含解析
- (高清版)JTG 3370.1-2018 公路隧道設計規范 第一冊 土建工程
- 【語文】西安外國語大學附屬小學(雁塔區)小學五年級下冊期末試卷(含答案)
- 新編旅游職業道德 課件 譚為躍 第3-5章 旅行社從業人員道德素養、酒店從業者道德素養、景區點從業人員道德素養
- 小學數學“組題”設計分析 論文
- 附件16:地下室燈帶臨時照明系統方案
- 中央空調維護保養服務投標方案(技術標)
- 服務認證培訓課件
- 風電場反事故措施
評論
0/150
提交評論