1-3
課件介紹:
- test:test generation--->execution--->verfication
- debug:
測試用例選取:
Question:如何從t1,t2,t3(fail),t4,...,t100中找到能找到導致失敗t3。
- test階段最重要的是test case generation。而在entire input domain中,我們測試用到的只是small subset。所以test case generation的關鍵在於找failure causing input。
- 測試用例選取的初衷在於:such that(希望)if P runs successful on test case in T',then the chance for P to fail on test case in T-T' is small.
- the more effective testing,the better.
測試用例產生方式:
- random testing
- ECR:Equivalence Class for variable Range,分類每一個類中選取一個。基於“coverage”的思想
- BVA:Boundary Value Analysis,選取邊界值
- mind mapping,需要從人的角度出發分析程序特點
測試用例產生步驟:
- Identity the input domain
- Equivalence classing
- Combine equivalence classes
- Identify infeasible equivalence classes
4-10
Coverage Principle:涉及權重問題
- 插樁原則:插樁越少越好,因爲在大型程序中插樁會大幅度提高overhead。
- w postdominate v if every path from v to exit contains w.
- u predominate v if every path from entry to v contains u.
- basic block: anyone statement of basic block can go to other statement of basic block.
- super block:
- Coverage Testing SDL Models:www.sdl-forum.org
- Requirements(usecase paragraph)--->architecture(class paragraph)--->coding--->testing
- c-use:變量聲明和使用同時覆蓋到
- p-use:變量聲明和decision中使用且Right branch和Wrong branch同時覆蓋到
- decision-->simple decision-->multiple decision
11-20
如何選擇迴歸測試用例:
- 以前失敗的測試用例
- 以前成功但是執行到修改處的測試用例
- 以前成功但是執行到修改處的測試用例,如果數目太多則只能測試一部分那麼,要做到的原則是:選儘可能少的測試用例,而進可能多的覆蓋到整個程序代碼。
Oracle的生成:
- 簡單程序的預期值就是oracle,但複雜軟件系統是沒有預期值的
- 理想情況下oracle可以根據軟件需求推導出,但實際情況複雜軟件系統是做不到這一點的。比如一個計算器程序,如何根據“8+9”算式正確的情況來證明覆雜算式“log3 * 8^2"的正確性
- v2版本的部分oracle可以由v1來驗證。(尤其是沒有執行到v2較之於v1修改的那一部分)
重點:testing和debugging流程全圖
- 構件軟件測試全局觀念,軟件測試的每一步、每一個概念都可以從該流程圖中找到其所屬的地位