版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、 SOFTWARE ENGINEERINGCodeGenerationThe Development PhaseSoftwareTestingSoftwareDesign SOFTWARE ENGINEERINGSoftware Quality Assurance 軟件質(zhì)量保證(SQA)應(yīng)該從產(chǎn)品的計(jì)劃和設(shè)計(jì)開始,直到投入使用和售后服務(wù)的軟件生存周期的每一個階段中的每一個步驟,每一個有關(guān)的人,包括軟件開發(fā)人員、測試人員、項(xiàng)目經(jīng)理、銷售人員和用戶都必須嚴(yán)把質(zhì)量關(guān),只有這樣才能保證軟件的高質(zhì)量,這就是現(xiàn)代軟件質(zhì)量保證的基本策略。 SOFTWARE ENGINEERINGSoftware Testi
2、ng測試是軟件生命周期中的一個重要階段。它直接影響著軟件的質(zhì)量和軟件的可靠性。因此,人們往往花費(fèi)了大量的時間和人力用于軟件測試。在軟件開發(fā)的全過程中,盡管對每個階段均有嚴(yán)格的技術(shù)審查,但是,要發(fā)現(xiàn)所有的錯誤是不可能的。因此,軟件在投入生產(chǎn)性運(yùn)行之前要盡可能多地發(fā)現(xiàn)軟件中的差錯,以提高軟件的質(zhì)量。 SOFTWARE ENGINEERINGSoftware Testing一旦編碼開始,正式測試必須隨即開始。 測試要求開發(fā)者首先拋棄“剛開發(fā)的軟件是正確的”這一先入為主的觀念,然后努力去構(gòu)造測試用例來“破壞”軟件。神話:若我們確實(shí)擅長編程,就應(yīng)當(dāng)不會有錯誤。 SOFTWARE ENGINEERINGS
3、oftware Testing測試不應(yīng)該被看作是安全網(wǎng)只有在軟件體系結(jié)構(gòu)完成后,獨(dú)立的測試組(ITG)才介入任何測試策略都必須包含測試計(jì)劃測試用例設(shè)計(jì)、測試執(zhí)行及測試結(jié)果數(shù)據(jù)的收集與評估測試是可以事先計(jì)劃并可以系統(tǒng)地進(jìn)行的一系列活動 SOFTWARE ENGINEERINGSoftware TestingThe importance of software testing and its implications with respect to software quality cannot be overemphasized.Software testing is a critical el
4、ement of software quality assurance and represents the ultimate review of specification,design,and coding. SOFTWARE ENGINEERINGSoftware Testing開發(fā)人員應(yīng)該意識到:所有的錯誤都是嚴(yán)重的,不存在微不足道的錯誤。這樣才能少犯錯誤。 錯誤的分類是技術(shù)性的。如:手冊錯誤可能導(dǎo)致機(jī)毀人亡。假設(shè)某個財務(wù)軟件有兩個錯誤:錯誤A使該系統(tǒng)死機(jī),錯誤B導(dǎo)致工資計(jì)算錯誤。按分類,錯誤A比錯誤B嚴(yán)重。但事實(shí)上B要比A嚴(yán)重。 SOFTWARE ENGINEERINGSoftwar
5、e TestingIn fact,testing is the one step in the software engineering process that could be viewed (psychologically,at least) as destructive rather than constructive.Software developer are by their nature constructive people.錯覺:“程序編完后,研制工作就接近尾聲了”。實(shí)際:“測試占開發(fā)費(fèi)用的40%至50%,對有關(guān)生命危險的軟件甚至占80%” SOFTWARE ENGINEE
6、RINGSoftware Testing測試可靠性模型糾錯評價軟件配置測試配置測試結(jié)果錯誤改正預(yù)期的結(jié)果錯誤率數(shù)據(jù)預(yù)測的可靠性測試必須按照軟件需求和設(shè)計(jì)階段所制訂的測試計(jì)劃進(jìn)行,其結(jié)果以“測試分析報告”的形式提交。回歸測試測試計(jì)劃文檔的一部分 SOFTWARE ENGINEERING測試工作量 到目前為止,證明軟件百分之百正確是不可能的,而且進(jìn)行窮舉測試也是不可能的。你永遠(yuǎn)也不能完成測試。因此我們的測試策略是在一定的開發(fā)周期和某種經(jīng)濟(jì)條件下,通過有限的測試以盡可能多地發(fā)現(xiàn)錯誤。按軟件工程中的402040規(guī)則(編程工作占開發(fā)工作的20%,編程前-計(jì)劃、需求分析、概要設(shè)計(jì)和詳細(xì)設(shè)計(jì),和編程后-測試
7、的工作量各占開發(fā)工作的40%)。測試在整個軟件的開發(fā)中必須占40%左右的工作量。各類測試在測試總工作量所占的比例根據(jù)具體項(xiàng)目及開發(fā)人員的配置情況而定。 SOFTWARE ENGINEERING測試結(jié)束標(biāo)志 依照測試工作量及下述標(biāo)準(zhǔn)可判定是否可以結(jié)束測試過程:如果測試沒有發(fā)現(xiàn)錯誤,說明測試失敗,則必須更換測試人員作進(jìn)一步測試。如果有規(guī)律地出現(xiàn)一些嚴(yán)重的,需要修改設(shè)計(jì)的錯誤,則說明軟件的質(zhì)量和可靠性存在問題,必須重寫相應(yīng)模塊,甚至整個軟件。如果軟件功能正常,發(fā)現(xiàn)的錯誤容易糾正,則說明軟件的質(zhì)量和可靠性可接受(不排除測試不充分的可能)。 SOFTWARE ENGINEERINGTesting Obj
8、ectivesTesting is a process of executing a program with the intent of finding an error.A good test case is one that has a high proba-bility of finding an as-yet undiscovered error.A successful test is one that uncovers an as-yet undiscovered error.Testing cannot show the absence of defects,it can on
9、ly show that software errors are present. SOFTWARE ENGINEERINGTesting Objectives理解測試的目的是個很重要的意識問題。如果說測試的目的是為了說明程序中沒有缺陷,那么測試人員就會向這個目標(biāo)靠攏,因而下意識地選用一些不易暴露錯誤的測試示例。這樣的測試是虛假的。目前的科技成果鑒定會普遍存在類似的虛假現(xiàn)象。盡管已經(jīng)明白了測試的目的是為了發(fā)現(xiàn)盡可能多的缺陷,但當(dāng)測試人員真的發(fā)現(xiàn)了一堆缺陷時,卻不可樂顛顛地跑去恭喜那個倒霉的開發(fā)者,否則會打架的。 SOFTWARE ENGINEERING測試與質(zhì)量測試有助于提高軟件的質(zhì)量,但是提
10、高軟件的質(zhì)量不能依賴于測試。測試與質(zhì)量的關(guān)系很象在考試中“檢查”與“成績”的關(guān)系。 學(xué)習(xí)好的學(xué)生,在考試時通過認(rèn)真檢查能減少因疏忽而造成的答題錯誤,從而“提高”了考試成績(取得他本來就該得的好成績)。 而學(xué)習(xí)差的學(xué)生,他原本就不會做題目,無論檢查多么細(xì)心,也不能提高成績。 軟件的高質(zhì)量是設(shè)計(jì)出來的,而不是靠測試修補(bǔ)出來的。 SOFTWARE ENGINEERINGTesting Principles(1)All tests should be traceable to customer requirements.Tests should be planed long before testin
11、g begins.The Pareto principle applies to software testing. Stated simply,the Pareto principle implies that 80 percent of all errors uncovered during testing will likely be traceable to 20 percent of all program modules. SOFTWARE ENGINEERINGTesting Principles(2)Testing should begin “in the small” and
12、 progress toward testing “in the large.”Exhaustive testing is not possible.To be most effective,testing should be conducted by an independent third party. SOFTWARE ENGINEERINGTesting Principles(3)程序員或程序設(shè)計(jì)機(jī)構(gòu)不應(yīng)測試自己設(shè)計(jì)的程序;測試用例設(shè)計(jì)不僅要有確定的輸入數(shù)據(jù),而且要有確定的、詳盡的預(yù)期輸出數(shù)據(jù);測試用例設(shè)計(jì)不僅要有合理的輸入數(shù)據(jù),還要有不合理的輸入數(shù)據(jù);除了檢查程序是否做完了它應(yīng)做的事
13、之外,還要檢查它是否做了不應(yīng)做的事;保留全部測試用例,并作為軟件配置的組成部分之一;程序中存在錯誤的概率與該段程序中已經(jīng)發(fā)現(xiàn)的錯誤數(shù)成正比。 SOFTWARE ENGINEERINGTestability(可測試性)Operability: “The better it work,the more efficiently it can be tested.”O(jiān)bservability: “What you see is what you test.”Controllability: “The better we can control the software,the more the tes
14、ting can be automated and optimized.” SOFTWARE ENGINEERINGTestability(可測試性)Decomposability: “By controlling the scope of testing,we can more quickly isolate problems and perform smarter retesting.”Simplicity: “The less there is to test,the more quickly we can test it.”Stability: “The fewer the chang
15、es,the fewer the disruptions to testing.”Understandability: “The more information we have,the smarter we will test.” SOFTWARE ENGINEERINGAttributes of a “good” testA good test has a high probability of finding an error.A good test is not redundant.A good test should be “best of breed.” The test that
16、 has the highest likelihood of uncovering a whole class of errors should be used.A good test should be neither too simple nor too complex. SOFTWARE ENGINEERING軟件測試分類測試分為如下的幾類: 模塊測試(單元測試、分調(diào)、單調(diào)) 組裝測試(整體測試、集成測試、聯(lián)調(diào)) 有效性測試 (確認(rèn)測試)系統(tǒng)(組裝、集成)測試 并行測試(平行測試、雙軌制運(yùn)行) 測試、測試驗(yàn)收測試(接收測試):由用戶完成此外部分測試可能需要進(jìn)行回歸測試。 SOFTWARE
17、 ENGINEERING軟件測試步驟模塊測試確認(rèn)測試組裝測試模塊模塊測試模塊測試模塊模塊系統(tǒng)測試設(shè)計(jì)信息經(jīng)裝配好 的軟件測試過的模塊軟件需求確認(rèn)過的軟件其他系統(tǒng)元素可運(yùn)行的系統(tǒng)軟件試運(yùn)行、驗(yàn)收 SOFTWARE ENGINEERING測試過程和研制過程的對應(yīng)關(guān)系系統(tǒng)定義需求分析詳細(xì)設(shè)計(jì)組裝測試模塊測試確認(rèn)測試系統(tǒng)測試驗(yàn)收測試軟件計(jì)劃概要設(shè)計(jì)編碼研制是一個自頂向下逐步細(xì)化的過程,而測試則是按相反順序的集成過程。 SOFTWARE ENGINEERING測試方法和測試技術(shù)測試方法和測試技術(shù)靜態(tài)技術(shù)動態(tài)技術(shù)桌前檢查代碼會審黑盒測試步行檢查白盒測試路徑測試條件測試數(shù)據(jù)測試循環(huán)測試等價類劃分邊界值分析比
18、較測試 SOFTWARE ENGINEERING測試用的程序?qū)嵗切螁栴}:接受3個1100之間的整數(shù),判別由這3條邊構(gòu)成的三角形的類型:等邊、等腰、不等邊或非三角形。NextDate函數(shù):接受3個整數(shù),輸出非法日期或輸入日期的下一個日期。傭金問題:銷售商根據(jù)不同的銷售額可以獲得不同的獎勵。 SOFTWARE ENGINEERING測試方法和測試技術(shù)程序的靜態(tài)分析檢查邏輯設(shè)計(jì)和編碼錯誤。不涉及程序的實(shí)際執(zhí)行,用人工進(jìn)行分析。桌前檢查(Desk Check):程序員自己檢查程序效果不太理想。解決辦法:互相交換程序檢查。代碼會審(Code Inspections):由一組人通過閱讀、討論和爭議,對
19、程序進(jìn)行靜態(tài)分析的過程。步行檢查(Walkthroughs):預(yù)先準(zhǔn)備測試數(shù)據(jù),讓與會者充當(dāng)“計(jì)算機(jī)”一檢查程序的狀態(tài)。有時比真正運(yùn)行程序可能發(fā)現(xiàn)更多的錯誤。 SOFTWARE ENGINEERING測試方法和測試技術(shù)程序的動態(tài)測試在程序的測試中,十全十美的測試情況是不存在的,即任何程序的測試都是不徹底的,測試不能發(fā)現(xiàn)程序中的所有錯誤。在測試方法中,最簡單的,也是最差的一種測試方法是隨機(jī)輸入的測試。這種將隨機(jī)選擇的輸入值作為輸入數(shù)據(jù)的測試往往檢測不出較多的錯誤。通常,在程序的測試中采用二類方法:黑盒法和白盒法。 SOFTWARE ENGINEERING測試方法和測試技術(shù)程序的動態(tài)測試無論是白盒
20、法還是黑盒法,關(guān)鍵都是如何選擇高效的測試用例(高效的測試用例是指一個用例能夠覆蓋盡可能多的測試情況,從而提高測試效率)。Black-box testing alludes to test that are conducted at the software interface.White-box testing of software is predicated on close examination of procedural detail. SOFTWARE ENGINEERING測試方法和測試技術(shù)程序的動態(tài)測試由于無法進(jìn)行窮舉測試,所以測試用例(test case)的設(shè)計(jì)在軟件測試中起
21、很重要的作用。測試用例設(shè)計(jì)的基本目的是確定一組最有可能發(fā)現(xiàn)某個錯誤或某類錯誤的測試數(shù)據(jù)。 測試用例的設(shè)計(jì)技術(shù)有許多種。如:路徑測試,各種邏輯覆蓋(語句、條件、循環(huán)等),等價類劃分,邊界值分析,因果圖和程序圖等圖形技術(shù)。 SOFTWARE ENGINEERING測試方法和測試技術(shù)White-box TestingWhite-box testing,sometimes called glass-box testing,is a test case design method that uses the control structure of the procedural design to de
22、rive test cases.白盒法檢查程序的內(nèi)部結(jié)構(gòu),即檢測程序的邏輯。 SOFTWARE ENGINEERING測試方法和測試技術(shù)White-box TestingUsing white-box testing methods,the software engineer can derive test cases that (1)guarantee that all independent paths within a module have been exercised at least once;(2)exercise all logical decision on their tr
23、ue and false sides;(3)execute all loops at their boundaries and within their operational bounds;and (4)exercise internal data structures to assure their validity. SOFTWARE ENGINEERINGWhite-box TestingBasic Path TestingThe basic path method enables the test designer to derive a logical complexity mea
24、sure of a procedural design and use this measure as a guide for defining a basic set of execution paths.Test cases derived to exercise the basic set are guaranteed to execute every statement in the program at least one time during testing. SOFTWARE ENGINEERINGWhite-box Testing Basic Path TestingFlow
25、 Graph NotationSequenceIf-then-elseCaseWhileUntilFlow graph Notation SOFTWARE ENGINEERINGTranslating Flow chart and PDL to a flow graph.2,3987614,51011R1R4R3R2NodeEdgeRegionWhite-box Testing Basic Path TestingFlow Graph Notation SOFTWARE ENGINEERINGMcCabe認(rèn)為程序的復(fù)雜性很大程度上取決于程序控制流的復(fù)雜性。Cyclomatic(環(huán)路) Comp
26、lexity is a software metric that provides a quantitative measure of the logical complexity of a program.Cyclomatic complexity has a foundation in graph theory and provides us with an extremely useful software metric.White-box Testing Basic Path TestingCyclomatic complexity SOFTWARE ENGINEERINGComple
27、xity is computed in one of three ways:The number of regions of flow graph correspond to the cyclomatic complexity.Cyclomatic complexity,V(G),for a flow graph G is define as V(G)=Edge-Node+2.cyclomatic complexity,V(G),for a flow graph G is also define as V(G)=P+1,where P is the number of predicate no
28、des contained in the flow graph G.White-box Testing Basic Path TestingCyclomatic complexity SOFTWARE ENGINEERINGCyclomatic complexity for example can be computed:The flow graph has 4 regions.V(G)=11edges-9nodes+2=4V(G)=3 predicate nodes+1=4測試工作量和潛在錯誤的個數(shù)與V(G)成正比McCabe認(rèn)為在一個模塊內(nèi) V(G)一般應(yīng)控制在10以內(nèi),當(dāng)V(G)在3至9
29、之間時被認(rèn)為是良好的結(jié)構(gòu)和恰當(dāng)?shù)膹?fù)雜性(度)。White-box Testing Basic Path TestingCyclomatic complexity SOFTWARE ENGINEERINGThe value computed for cyclomatic complexity defines the number of independent paths I the basic set of a program and provide us with an upper bound for the number of the tests that must be conducted
30、 to ensure that all statements have been executed at least once.White-box Testing Basic Path TestingIndependent Paths SOFTWARE ENGINEERINGAn independent path is any path through the program that introduces at least one new set of processing statements or a new condition.When stated in terms of a flo
31、w graph,an independent path must move along at least edge that has not been traversed before the path is defined. White-box Testing Basic Path TestingIndependent Paths SOFTWARE ENGINEERINGA set of independent paths for example:Path 1:1-11Path 2:1-2-3-4-5-10-1-11Path 3:1-2-3-6-8-9-10-1-11Path 4:1-2-3
32、-6-7-9-10-1-11The path 1-2-3-4-5-10-1-2-3-6-8-9-10-1-11is not considered to be an independent path.White-box Testing Basic Path TestingIndependent Paths SOFTWARE ENGINEERINGThe basic path testing method can be applied to a procedural design or to source code.Using the design or code as a foundation,
33、 draw a corresponding flow graph.Determine the cyclomatic complexity of the resultant flow graph.Determine a basic set of linearly independent paths.Prepare test cases that will force execution of each path in the basic set.White-box Testing Basic Path TestingDeriving Test Cases SOFTWARE ENGINEERING
34、白盒法又稱為邏輯覆蓋法,因?yàn)橐猿绦颍K)內(nèi)部的邏輯結(jié)構(gòu)為基礎(chǔ)來設(shè)計(jì)測試用例,主要用于單元測試。White-box TestingCondition Testing語句覆蓋判定覆蓋條件覆蓋判定條件覆蓋條件組合覆蓋弱強(qiáng) SOFTWARE ENGINEERINGCondition testing is a test case design method that exercises the logical conditions contained in a program module.The condition testing method focuses on testing each co
35、ndition in the program.條件測試包括四類覆蓋:判定覆蓋、條件覆蓋 、判定/條件覆蓋 、條件的組合覆蓋White-box TestingCondition Testing SOFTWARE ENGINEERINGWhite-box TestingCondition Testing開始X=X/A A1 AND B=0結(jié)束 X=X+1 A=2 OR X1YY被測試的程序的流程圖aedcbNN SOFTWARE ENGINEERING判定覆蓋又稱作分支覆蓋,它是使程序中的每個判定至少出現(xiàn)一次“真值”和一次“假值”,即程序中的每個分支至少經(jīng)過一次。對此,我們可以設(shè)計(jì)如下測試數(shù)據(jù)對判
36、定邏輯進(jìn)行覆蓋: A=3,B=0,X=1(通過路徑acd) A=2,B=1,X=3(通過路徑abe)White-box TestingCondition Testing判定覆蓋 SOFTWARE ENGINEERING條件覆蓋是判定中的每個條件的所有可能的結(jié)果至少出現(xiàn)一次,并且使每條語句(不是每個分支)至少執(zhí)行一次(語句覆蓋)。 對此,條件覆蓋的測試可由下面兩組數(shù)據(jù)進(jìn)行: A=2,B=0,X=4 (通過路徑ace) A=1,B=1,X=1 (通過路徑abd)條件覆蓋一般情況下比判定覆蓋要強(qiáng)。 White-box TestingCondition Testing條件覆蓋 SOFTWARE ENG
37、INEERING但是,也有例外的情況(如果,測試數(shù)據(jù)設(shè)計(jì)得不好的話),例如下例所示:IF A1 AND B=0 中,若設(shè)計(jì)一組條件覆蓋的測試數(shù)據(jù)如下: A=2,B=1 A=1,B=0則這組數(shù)據(jù)滿足條件覆蓋,但不會執(zhí)行IF語句中的THEN的子句。White-box TestingCondition Testing條件覆蓋 SOFTWARE ENGINEERING設(shè)計(jì)下面兩組數(shù)據(jù): A=1,B=0,X=3 A=2,B=1,X=1滿足條件覆蓋(四個條件:A1, B=0, A=2, X1均取過“真”值和“假”值)但它們都通過路徑abe,所以不滿足判定覆蓋。 White-box TestingCondi
38、tion Testing條件覆蓋 SOFTWARE ENGINEERING判定/條件覆蓋方式是使判定中每個條件的所有可能結(jié)果至少出現(xiàn)一次。而每個判定本身所有的可能結(jié)果也至少出現(xiàn)一次。 下面兩組數(shù)據(jù)滿足判定/條件覆蓋: A=2,B=0,X=4 (通過路徑ace) A=1,B=1,X=1 (通過路徑abd)White-box TestingCondition Testing判定/條件覆蓋 SOFTWARE ENGINEERING條件的組合覆蓋所設(shè)計(jì)的測試數(shù)據(jù)使每個判定中的條件的各種組合至少出現(xiàn)一次,并且每條語句至少執(zhí)行一次。例子中條件的所有可能組合有8種:A1,b0 A2,X1A1,b0 A2,X
39、1A1,b0 A2,X1A1,b0 A2,X1White-box TestingCondition Testing條件的組合覆蓋 SOFTWARE ENGINEERING要測試上述8種組合(滿足條件組合覆蓋),可設(shè)計(jì)下述4組數(shù)據(jù):A=2,B=0,X=4 覆蓋A=2,B=1,X=1 覆蓋A=1,B=0,X=2 覆蓋A=1,B=1,X=1 覆蓋但上述的4組測試數(shù)據(jù)并沒有覆蓋所有的每一條路徑(路徑acd未通過)。White-box TestingCondition Testing條件的組合覆蓋 SOFTWARE ENGINEERINGThe data flow testing method sele
40、cts test paths of a program according to the location of definition and uses of variables in the program.One simple data flow testing strategy is to require that every DU chain be covered at least once.We refer to this strategy as the DU testing strategy. It has been shown that DU testing does not g
41、uaranteed to be coverage of all branches of a program.White-box TestingData Flow Testing SOFTWARE ENGINEERINGLoop testing is a white-box testing technique that focuses exclusively on the validity of loop constructs. Four different classes of loops can be defined: simple loops,concatenated loops,nest
42、ed loops, and unstructured loops.White-box TestingLoop Testing SOFTWARE ENGINEERINGThe following set of tests should be applied to simple loops.Skip the loop entirely.Only one pass through the loop.Two passes through the loop.M passes through the loop where mn.n-1,n,n+1 passes through the loop.Where
43、 n is the maximum number of allowable passes through the loop.White-box Testing Loop TestingSimple Loops SOFTWARE ENGINEERINGBeizer suggests an approach that will help to reduce the number of tests:Start at the innermost loop.Set all other loops to minimum values.Conduct simple loop tests for the in
44、nermost loop while holding the outer loops at their minimum iteration parameter(e.g.,loop counter)values.Add other tests for out-of range or excluded values.White-box Testing Loop TestingNested Loops(1) SOFTWARE ENGINEERINGWork outward,conducting tests for the next loop,but keeping all other outer l
45、oops at minimum values and other nested loops to “typical” values.Continue until all loops have been tested.White-box Testing Loop TestingNested Loops(2) SOFTWARE ENGINEERINGConcatenated loops can be tested using the approach defined above for simple loops if each of the loops is independent of the
46、other. When the loops are not independent,the approach applied to nested loops is recommended.White-box Testing Loop TestingConcatenated Loops SOFTWARE ENGINEERINGWhenever possible,this class of loops should be redesigned to reflect the use of the structured programming constructs.White-box Testing
47、Loop TestingUnstructured Loops SOFTWARE ENGINEERING測試方法和測試技術(shù)Black-box Testing黑盒法是把測試對象看作一個黑盒,測試時完全不考慮程序的內(nèi)部的邏輯結(jié)構(gòu)與內(nèi)部特性,只需根據(jù)需求規(guī)格說明書,測試程序的功能或程序的外部特性。因此黑盒法又稱為功能測試或數(shù)據(jù)驅(qū)動測試。常用的測試方法有:等價分類法邊值分析法錯誤推測法因果圖法軟件輸入輸出 SOFTWARE ENGINEERING測試方法和測試技術(shù)Black-box TestingBlack-box testing focuses on the functional requiremen
48、ts of the software.That is,black-box testing enables the software engineer to derive sets of input conditionals that will fully exercise all functional requirements for a program.Black-box testing is not an alternative to white-box techniques.Rather,it is a complementary approach that is likely to u
49、ncover a different class of errors than white-box methods. SOFTWARE ENGINEERING測試方法和測試技術(shù)Black-box TestingBlack-box testing attempts to find errors in the following categories:Incorrect or missing functions;Interface errors;Errors in data structures or external data base access;Performance errors;and
50、Initialization and termination errors. SOFTWARE ENGINEERING測試方法和測試技術(shù)Black-box TestingUnlike white-box testing,which is performed early in the testing process,black-box testing terns to be applied during later stages of testing. Because black-box testing purposely disregards control structure,attenti
51、on is focused on the information domain. SOFTWARE ENGINEERING測試方法和測試技術(shù)Black-box TestingTests are designed to answer the following questions:How is functional validity tested?What classes of input will make good test cases?Is the system particularly sensitive to certain input values?How are the bound
52、aries of a data class isolated?What data rates and data volume can the system tolerate?What effect will specific combinations of data have on system operation? SOFTWARE ENGINEERINGThe first step in black-box testing is to understand the objects that are modeled in software and the relationships that
53、 connect these objects.Once this has been accomplished,the next step is to define a series of tests that verify “all objects have the expected relationship to one another.”Black-box TestingGraph-Based Testing SOFTWARE ENGINEERINGStated in another way,software testing begins by creating a graph of im
54、portant objects and their relationships and then devising a series of tests that will cover the graph so that each object and relationship is exercised and errors are uncovered.Black-box TestingGraph-Based Testing SOFTWARE ENGINEERINGEquivalence partitioning is a black-box testing method that divide
55、s the input domain of a program into classes of data from which test cases can be derived.Equivalence partitioning strives to define a test case that uncovers classes of errors,thereby reducing the total number of test cases that must be developer.Black-box TestingEquivalence Partitioning SOFTWARE E
56、NGINEERINGTest case design for equivalence partitioning is based on an evaluation of equivalence classes for an input condition.Equivalence classes may be defined according to the following guidelines:If an input condition specifies a range,one valid and two invalid equivalence classes are defined.B
57、lack-box TestingEquivalence Partitioning SOFTWARE ENGINEERINGIf an input condition requires a specific value,one valid and two invalid equivalence classes are defined.If an input condition specifies a member of a set, one valid and one invalid equivalence classes are defined.If an input condition is
58、 Boolean,one valid and one invalid class are defined.Black-box TestingEquivalence Partitioning SOFTWARE ENGINEERINGApplying the guidelines for the derivation of equivalence classes,test cases for each input domain data item could be developed and executed.Test cases are selected so that the largest
59、number of attributes of an equivalence class are exercised at once.Black-box TestingEquivalence Partitioning SOFTWARE ENGINEERINGFor reason that are not completely clear, a greater number of errors tend to occur at the boundaries of the input domain than in the “center.”It is for this reason that bo
60、undary value analysis(BVA) has been developed as a testing technique.Boundary value analysis leads to a selection of test cases that exercise bounding value.Black-box TestingBoundary Value Analysis SOFTWARE ENGINEERINGBoundary value analysis(BVA) is a test case design technique that complements equi
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 拱橋模架施工方案(3篇)
- 風(fēng)蝕護(hù)肩施工方案(3篇)
- 年底小區(qū)活動策劃方案(3篇)
- 開封訂餐活動方案策劃(3篇)
- 服裝生產(chǎn)加工工藝規(guī)范(標(biāo)準(zhǔn)版)
- 景觀設(shè)計(jì)方案匯報
- 櫻花節(jié)活動方案
- 生物醫(yī)學(xué)金屬材料全面解析
- 2025年高職(化妝品技術(shù))化妝品生產(chǎn)工藝試題及答案
- 2025年大學(xué)本科四年級(土地資源管理)土地規(guī)劃利用測試題及答案
- 超標(biāo)準(zhǔn)洪水應(yīng)急預(yù)案、度汛方案
- 客戶品質(zhì)年終總結(jié)
- 2025貴州省山地智能農(nóng)機(jī)產(chǎn)業(yè)發(fā)展有限公司招聘15人筆試考試備考題庫及答案解析
- 大學(xué)英語四級考試2025年6月真題及答案(第二套)
- 機(jī)關(guān)單位wifi管理制度(3篇)
- 數(shù)據(jù)中心節(jié)能技術(shù)實(shí)施方案
- 醫(yī)療器械使用與維護(hù)常見問題匯編
- 中國資產(chǎn)托管行業(yè)發(fā)展報告2025
- 聯(lián)合培養(yǎng)研究生協(xié)議
- 虛擬電廠課件
- 部隊(duì)核生化防護(hù)基礎(chǔ)課件
評論
0/150
提交評論