test.md - cccnqu/se106a GitHub Wiki
T = N * F^2
T: 測試的總次數 N: 開發團隊人數 F: 總函數量
IEEE 的定義
- Failure : Observable incorrect behavior
- Fault : Incorrect code
- Error : Cause of a fault
單元測試 => 整合測試 => 系統測試
Unit test=> Integration test => System Test
單一模組 => 很多模組合起來 => 整個系統
- Testing
- 對某些輸入測試一遍!
- 優點 (pros) No false positive, 缺點 (cons) Incomplete
- Static verification
- 對所有可能的輸入都測試一遍!
- 優點 (pros) Consider all program behavior, 缺點 (cons) Generate false positives
- Inspection
- 人工檢查, Review, Walk through
- 優點 (pros) Systematic, Thorough, 缺點 (cons) Informal, subjective (主觀)
- Formal proof of correctness
- 數學證明
- 優點 (pros) Strong garantees, 缺點 (cons) Complex, expensive
- 形式化驗證 (Formal Verification)
Bill Gates : 50% of my company employs are tester, and the rest spends 50% of their time testing.
Goodenouth & Gerhert : A test is successful if program fails
- Unit Testing
- Integration Testing
- System Testing
- Functional Testing
- Non-functional Testing
- Relyability
- Usability
- Maintainability
- X-ability
- Acceptance Testing
- 驗收測試
- Regression Testing
- 回歸測試:每次修改程式碼後,重複執行既有的全部或部分的相同測試。
https://classroom.udacity.com/courses/ud805/lessons/1778878537/concepts/4450985580923
- Developer Testing : 開發者測試
- Alpha Testing : 內部測試
- Beta Testing : 先期使用者測試 (封測) !
- Release : 正式上線使用
- 黑箱測試 (Black-Box Testing)
- 沒有看程式碼!
- 白箱測試 (White-Box Testing)
- 有看程式碼!
- Executing the faulty statement is a necessary condition for revealing a fault.
- Functional Specification
- add(int a, int b)
- excel
- Independent Testable Feature
- Relevant Inputs
- How long will it take to test add(int a, int b)
- Random Testing
- Partition Testing (Sparse part, Dense part)
(ex: split(str, size), size>=<0, len>=<size)
- Error tend to occor at the boundary of a sub domain (ex: -1, 0, MAX_INT, ....)
- Test-Case Specification
- Category-Partition Method
- Model-based testing - 1. Finite State Machine 2. Decision Table ....
- Test-Cases
-
- Identify independently testable feature
-
- Identify categories :
- split(str, size) , str.length, content, size.value
-
- Partition categories into choices :
- length: 0, size-1, ... size:
- size:
>=<0
-
- Identify constraints among choices
- eliminate meaningless combinations
- reduce the number of test cases
- Three types: property ... IF, ERROR, SINGLE
-
- Produce/Evaluate test case specifications
- can be automated
- product test frames
-
- Generate test cases from test case specifications
- TSL generator
- grep
實際案例: ud805:Category Partition Demo
https://classroom.udacity.com/courses/ud805/lessons/1719379003/concepts/5470286680923
分析 => 設計 => 實作 => 上線
bug 越晚發現代價愈高,分析錯誤代價最高 (幾何成長)。
設計修改 change 代價愈前期愈高,分析錯誤的代價比測試錯誤更高。
- 英雄主義 Heroics
- 不良工作環境 Working environment
- 不良人員管理 People management
- 時程問題 Schedule:過度樂觀
- 計畫因素 Planning : 計畫不符、被迫放棄或更改 ....
- 金盤子問題:計畫需求 >>> 實際需求 (設計太多用不到的功能,系統過度膨脹)
- 研究 v.s 產品
- 銀彈問題 Silver bullet:過度相信神奇科技
- 在執行中期加入新工具 Switching Tool
- 缺乏版本管理系統 No version control