又稱為功能測試function testing、行為測試behavior testing
黑盒測試測試不知道代碼細節(jié)的軟件
Black box testing test software without knowing how it is coded.
測試目的:判斷輸入和輸出是否符合軟件要求
優(yōu)勢advantage:
1. 不需要知道代碼細節(jié)
2. 相互獨立
3. 可以在說明書完成后就設計測試用例,不用等代碼完成
缺陷disadvantages:
1. 有冗余
2. 沒有說明書
3. 輸出不現(xiàn)實
4. 很難發(fā)現(xiàn)錯誤的位置
靜態(tài)黑盒測試(測試說明書)testing the spec
測試說明書是靜態(tài)黑盒測試。testing the specification is static black box testing.
tips:
1.?當為給顧客考慮時,不要忘記軟件安全問題
2.?
怎么做
high-level
檢查產品說明書(沒有固定格式,實再想不出來就去和開發(fā)團隊聊一聊)
原則
- Don`t start by looking for bugs in great detail
- play at being the customer
- assume nothing-question until you are
- guideline
- review
low-level
產品說明書特征檢查清單specification attributes checklist:complete(內容完整), accurate(不能有歧義), precise, consistent, relevant, feasible, code-free
產品說明書術語檢查清單specification terminology?checklist(慎用): always, every, all, none, never\certainly, therefore, clearly, obviously\some, sometimes, often, usually, ordinarily
動態(tài)黑盒測試dynamic black-box testing
減少測試案例個數
確定哪些案例需要測試
怎么定義最糟糕情況
數據測試data testing
等價位劃分equivalence partitioning
Equivalence partitioning is the process of methodically reducing the huge set of possible test cases into a much smaller, but still equally effective, set
Guidelines
The input domain is usually too large for exhaustive
分為合法輸入(vaild input)、不合法輸入(Invalid input)
例題
電話分為三部分,第一部分為區(qū)號area-code(以0開頭的三位數字),第二部分為pre-fix(四位數字),第三部分為sur-fix(不含0的三位數字)
合法輸入:000 1111 111
非法輸入:100 1111 111、0a0 1111 111、000 a000 111、000 aaaa 111、000 1111 011、000 1111 a11
例2:設有一個檔案管理系統(tǒng),要求用戶輸入以年月表示的日期。假設日期限定在1990年1月2049年12月,并規(guī)定日期由6位數字字符組成,前4位1位表示年,后2位表示月。現(xiàn)用等價類劃分法設計測試用例,來測試程序的“日期檢查功能”。
合法輸入:200212
非法輸入:198901(小于時間)、20210(少一位)、2000-1(有符號)、2001212(多一位)、205003(大于時間)、200113(月份大)、200100(月份小)
BVA(boundary value analysis)
測試案例是4n+1,n為變量
Guideline
范圍
選六個(兩個邊界值,大于和小于邊界值,最大值和最小值)
集合
布爾值
狀態(tài)測試state testing
黑盒測試的一部分,測試軟件的邏輯流向demonstrats logic flow of some software
重點是狀態(tài)和狀態(tài)的轉換
手段:
1. 使用等價位劃分去選擇測試狀態(tài)和路徑
2. 通過智能選擇減少案例
指導
1. 每種狀態(tài)至少訪問一次View each state at least once
2. 測試看起來最普通和最常見的狀態(tài)轉換Test state-to-state transitionns that look like the most common or popular
3. 測試狀態(tài)之間最不常見的分支Test the least common papaths between states
4. 測試所有錯誤狀態(tài)和其返回值Test all the error states and rereturning from the error states
5. 測試隨機狀態(tài)條件Test random state transitions
要求
1. 不要上升到代碼層次
Race condition
Multiple processes racing to a finish line, not knowing which will get first
bad timing
Two or more events line up just right and confuse software that didn't expect to be
interrupted in the middle of its operation, it's bad timing.
重復測試Repetition testing
一直做同樣的事情
壓力測試Stress testing
“餓一餓”軟件:不給必要的數據,資源
在不理想的狀態(tài)時運行,例如內存不足、配置過低,cpu差
其他技術
Behave Like a Dumb User (inexxperienced user)
?Throw out any preconceived iideas
?Look for Bugs Where Youve A Already Found Them
the more bugs you find, the monore bugs there are
Think like a Hacker
Seek to find vulnerabilities and exexploit it& Folow Experience, Intuition, and Huncnches (預感)
Experience is the name everyone giveves to their mistakes
加載測試Load testing
與stress testing相反文章來源:http://www.zghlxwxcb.cn/news/detail-855826.html
給所有軟件所需的資源和任務,甚至遠遠大于要求文章來源地址http://www.zghlxwxcb.cn/news/detail-855826.html
到了這里,關于【軟件測試】黑盒測試black box testing的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!