TW200828011A - Software test method for program running domain - Google Patents
Software test method for program running domain Download PDFInfo
- Publication number
- TW200828011A TW200828011A TW95148661A TW95148661A TW200828011A TW 200828011 A TW200828011 A TW 200828011A TW 95148661 A TW95148661 A TW 95148661A TW 95148661 A TW95148661 A TW 95148661A TW 200828011 A TW200828011 A TW 200828011A
- Authority
- TW
- Taiwan
- Prior art keywords
- program
- domain
- source program
- variable
- equivalent
- Prior art date
Links
- 238000000034 method Methods 0.000 claims abstract description 27
- 238000013522 software testing Methods 0.000 claims description 2
- 208000031968 Cadaver Diseases 0.000 claims 1
- 238000012360 testing method Methods 0.000 description 45
- 238000004458 analytical method Methods 0.000 description 6
- 238000011990 functional testing Methods 0.000 description 3
- 238000010998 test method Methods 0.000 description 3
- 241000282320 Panthera leo Species 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 235000002566 Capsicum Nutrition 0.000 description 1
- 101100126165 Escherichia coli (strain K12) intA gene Proteins 0.000 description 1
- 239000006002 Pepper Substances 0.000 description 1
- 235000016761 Piper aduncum Nutrition 0.000 description 1
- 235000017804 Piper guineense Nutrition 0.000 description 1
- 244000203593 Piper nigrum Species 0.000 description 1
- 235000008184 Piper nigrum Nutrition 0.000 description 1
- 206010041235 Snoring Diseases 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000036770 blood supply Effects 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011981 development test Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013101 initial test Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000007620 mathematical function Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 210000002784 stomach Anatomy 0.000 description 1
- 238000012029 structural testing Methods 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Description
200828011 九、發明說明: 【發明所屬之技術領域】 特別是一種基於程序運行 [0 01 ]本發明係關於一種測試方法 域之私式測試方法。 【先前技術】 陶軟體職狀體開發流財的—個大環節。以測試型態 來做分類辆,可时舰_觀(CQnstruetiGn Testing)、系 統測試(System Testing)、以及特殊測試(Speciai 構性測試是屬於前置㈣職,主妓偏重於程式端的功能測 試,以確練式執行運作正常。_麟是屬种後期的整合測 試,所進行的測試是以使用者的觀點為主,也就是模擬外界的使 用者會如何的使用產品。至於特殊測試所指的是,所進行的測試 需要花費更多的時間與人力才能完成。 _]就測試模式而言,可分為自盒峨(職㈣⑽把邮) 與黑盒測試(BlackBoxTesting)。這兩種方式的測試方向是不同 的,白盒測試是㈣程序結構為主,而黑盒測試是以程式的功能 為主。 [004] 白盒測試也稱為結構性測試(Stmctural Testing),白盒 展N式有兩大層面·資料流程面(DataFlow Coverage)以及控制流 程面(Control Flow Coverage),資料流程面就是測試資料在系統 的進出入於程式内所經過的流程,控制流程面就是測試程式在執 行過程中每個階段的流程。 [005] 進行黑盒測試時,測試人員並不需要對軟體的結構性有 200828011 足夠深層的瞭解,所進行的測試是著重 有人稱之為功能測試。為了要控淑心功⑽:所以也 須要按照測試案例(Test Cases)來逐—進行;^ =人貝必 計的好壞就會直接影_戦結果。 es Cases设 [006]軟體項目有其不同其他項 視性、產品執絲_無姐、產品品崎^^域品的不可 致軟體產品品質报難完美保證。對於項=:完全性、導 ^ T貝㈢旱乂小的或者對品質要求 而言,手工方式—般也能達到預期的效果。但是隨 者產4統的不斷雜,魏的不斷增加,同咖戶對產品品所 要求的提高’導致必須考慮採__試方式方法去適應:二 求。 而 _]軟體產品的複雜性4致在幸墙產品整合及送交品質部 門剛開始測試時,大量的錯誤(bug)出現,這 程師、測试工程師、開發主管、測式主管、心^ 費大量的人力,物力等。 _]-般而言,在產品送測初期產生的bug佔到總bug量的 70-80%左右,因此如何快速的、自動化的提早發現這此bug,h 提南產品品質、縮短開發測試週期以及提高客戶滿意度的關鍵 [009]要檢驗開發的軟體是否有bug,可以採取各種不同的測 減朿略。但是’不論採用哪一種測試策略,設計測試方案都B、則 試階段最關鍵問題。測試以前都需要從程序定義域中選取有代夺 性的測試數據,這也是測試成功與否的關鍵。 【發明内容】 200828011 法。直主要提種基於程式運行域分析_試數據生成方 _二式功能域與運行域的測試數據自動 用程切刀斤母一個應雜源程式的變量類型,完成對應 2式力錢的取得,透獅朗程式本身運行語句進行分析, 触此轉取錢練㈣爾罐去執行測 忒,來發現程式中的問題點。 [〇11]根據本發明之一實施例一- j之種基於紅式運仃域之軟體 /、、- Π先轉-源程序之魏域,接著騎料進行分析, H、程序中取得與—變量有關的語句,以形成序; 根據專償源程序,以取得等價程序的運行域;最後比較源 之的功能域鱗價程序之的運行域是否重和合。 〃 [012]以上之關於本發明内容之說明及以下之實施方式之說 明係用以tf減轉本發明之精神與原理,並且提供本發明之專 利申晴範圍更進一步之解釋。 【實施方式】 []、下在只知方式中詳細敘述本發明之詳細特徵以及優 :、、八谷足、使任何热習相關技蟄者了解本發明之技術内容並 據以實施,且根據本_書所揭露之内容、_請專利顧及圖式, 任何^侧技#者可輕賊理解本發帅關之目的及優點。 [014]在開始说明本發明之前,先對本發明所使用的術語作一 簡介與說明。 [015]每個权體產品或項目都定義有非常詳盡的規格書 (specmcation) ^ t 200828011 範圍,在源程序(source eode)中也會對每個相關參數聲明其具 體的類支了稱之為功能域。各個程式執行時都有其運行的覆蓋 範圍,可稱之為運行域。 與’]規格書是對軟體輸入、輸出的定義,而軟體程式則說明 =現_的料法和數據結構。軸__定了輸入變量的 現树也定義了其找域。'魏在需求 的。,而在開姊獅中是由斯域來描述 ^錢的功能是定義在輸入空間的_個所謂功能域 血運==椒請扇的i顧。如果功能域 出^域不拉全重合,那麼軟體的故障或錯誤(㈣)就可檢測 _]基於規範的功能測試和基於程式的結構測試是兩類常 用的軟體測試方法。功能測試根據規格說明書設計測試範例,檢 ,程式的每—功能是否按照規範的要求正確地執行。它以軟體規 犯為依據碰觀㈣,其正雜依賴於規範的正雜。透過功 (能域與程式運行域的不同縫,可選擇有代表性_試數據以對 私式進行職,以大量節擇測試數據的時間。 [〇18]接著請參考『第1圖1洛 式運行域讀_財法之主錢崎縣之基於程 p 雜序:的魏域(㈣⑽),接㈣源程序 200),其主要β ^有關的語句’形成等價程序P,(步驟 無關的語句及函數。^ 態程序並剔除與輸入變量 接者’根據料、程序P,,以取得等價程序P, 200828011 的運行域(步驟300)。 [020]最後比較源程序P的魏域解價程序p,的運行域(步 驟4〇0)是否重合,以得到比較結果。如果功能域與運行域不能 70全重合’那麼权體的故障或錯誤(bug)就可檢測出來。 剛續請參考『第2圖』,鱗示m中取得源程序 P的功能域的流程圖。 自級入源程序p之語句(步驟ιοί),接著% 源程序ρ之函數’錢判斷讀人之語句是否為函數(步驟10Γ) 若不是函數,則繼續讀入源程序ρ(步驟1〇1)。如 j 源程序p為函數,則建立函數參數表(步驟ι〇3) 用表(步驟104)、變量表t 罨立函數§ 步雜至而步驟107相以j、w複合語句表(步驟106) 至步謂峨立二:,”繩;而步驟10 mum« 析所需的源程序的各〇 束,則繼續建立複合語句表(步若未衾 源程序P是否讀取結束(步_),_^ =則判處 ⑽),若未結束,則回到 ^ I。束(步觸 _胸參考『第 ^ ^源程序P。 P,的流程圖。 罘1圖』中取得源程序 [025]首先,將掃暗步 以取得-個變量(步驟lu j建立的變量表(步驟110), 驟II2)’並判斷所讀人之θ接著°胃人源轉1"的-行語句(步 驟113),若無闕,則繼⑴所取得之變量有關(步 认軸序?的語句,若«,則記錄 200828011 至源程序p,中。
若未讀取完畢, 則繼續取得T -個後f複上述的步驟 115 )’若未結 。若讀取結束,則判斷變 。若讀取完畢,則結束, 步驟115。 111至 依據輸入空間的範圍進行選擇劃分。 [027]如果函數中有-些表達式及其他—些數學函數,則應該 _]-般而言’輸人空間可關分為四部份,即:时川 E2UE3UE4,其中: [029] El={x |x£DfflDp} [030] Ε2={χ |χ^η DfRDp} [031] Ε3={χ |xeDfnnDp} [032] Ε4={χ |χΕ] Dfn~i Dp} [033] Df表示輸入變量的功能域,Dp表示運行域。 [034] E1表示規範與程序有相同的輸入子域,但實現與說明 是否一致,還需進一步測試。 [035] E2表明程序產生了一個結果,但規範並沒有要求1對 於這種情況,可補充規範或者縮小其程序的運行域。 [036] E3表明規範的某些要求,程序沒有處裡。 [037] E4關於例外處理,即規範既未要求,程序也無從處理 對於規範未指明的輸入’程序可能產生不可預料的結果。因此, 在可靠的軟體程式中,例外處理為必要之程序。 10 200828011 、陶根據以上之酬書,_序p以文件形式私,再建立 關;原私序p的各種變量紀錄,並依據紀錄提供的信扈、,從源程 =程中嫌量的靜態 貝王 ,y後確定輸入變量的運行域。 陶下面將對本發明進行舉例說明,首先給出源程序卜由 |nam(),xpomt〇,f〇,p〇wer〇組成,其輪入變量為 X, [040]給定一源程序p如下: 、'、
intp〇wer(intX,inti) { intp; f〇r(p=l; i>〇; -i) P = P*x; retum(p); } float f(float x) { float y; y = ((χ_0·5)*χ+16·0)*χ - 80·〇; retum(y); } float xpoint(float xl) { float y; y=xl *f(xl)/(f(xl+1.0) - f(3.453))· retum(y); 11 200828011
void mainQ { int k; float x ? y; printf(7n-----Print the value of function power-----/n”); for(k=0;k<l 0;k++) printf(n%d%d%d \nn,k,power(2,k) ’ power(-3,k)); printf(7n-----Print the value of function xpoint-----/n”);
Scan(,,%r,&x}; while(x>0) { y=xpoint(x); ,x,y); scanf(f!%f! 5 &x); } } [041]基於輸入變量對上述之源程序p分析,以得到一 序,如下: 1貝程 float f(float x) { float y; y=((x-0.5)*x+16.0)*x-80.0; retum(y); float xpoint(float xl) 12 200828011 float y; y=xl * f(xl) / (f(xl+1.0>f(3.453)); retum(y); } void main() { float x,y; scan(’’%r,&x); while(x>〇) { y^xpoin^x); printf(ff%f%f! 5 x ^ y);
Scanf(ff%f! ? &x); } , [〇42]根據本發明所減<方法,首先取得紀錄程式中的變 量,此程式變量列表中只有變量义、^、]^。 接著針對變量x的程式分析,得到等價程序p,,等價p, 中去掉了與輸人變量x無關的變量。k及其相關語句與函數 POWER() P中變量與函數都與輸入變量χ有關,並且與p二者 辛=專彳貝口此,P與P的運行域一致。但是,p,只分析與輸 入k里有關的部份,有利於程式運行域的確定。 [044]接著分析p’以確定運行域。對函數進行分析,例如對 P ·、0進行刀析,其變量為χι,類型為丘〇at,打〇泔型變量,其功 此域疋義為卜3.4028235E38,3.4028235E38]同時函數中,其表達 13 200828011 式中分母不能為G ’則可得xl内容不能f於2·453,如此綜合參 考其功能域及運行域範圍,可得其可執行域範圍, [-3·402δ235Ε38,-1],卜1,〇],[〇,1],[1,2.453),(2.453, 3.4028235Ε38] ’職其絲是否核。轉如上—些特殊值等去 測試其結果,如此可不需每個變量值均去執行一遍,從 量時間。 '' 、[〇45]本發明係一種基於程式運行域分析的測試數據生成方 法三其主要提出了-種基於程式功能域與運行域的測試數據自動 確定方,其通過分析每-個應用於原程式的變量類型,完 用程式功能域的獲取,透過對應用程式本身運行語句進 了 運行域’通過此法獲取有代表性的測試數據去執行測 忒’來發現程式中的問題點。 、 [〇46]雖穌發明以前述之實施觸露如上,㈣ 定本發明。在不雌本發明之精彻 更 、 均屬太由, 国門所為之更動與潤飾, δ月之專利保護範圍。關於本發明所界 考所附之申請專利範圍。 更耗圍叫參 【圖式簡單說明】 =,係為第1圖中取得源程序p的功能域的流程圖。 ® ’躺弟1®中取得馳序p,的流程圖。 【主要7L件符號說明】 無 14
Claims (1)
- 200828011 十、申請專利範圍: L 一種基於程式運行域之軟體測試方法,包括有: 取得—源程序之功能域; 、·.、/原、私序進行分析,以自該源程序中取得與—變量有關 的語句,以戦—等價源程序; 根^該等價源程序’以取得等價程序的運行域;以及 比較該源程序之的該功能域與該等價程序之的運行威是 备重和合。 2.如申明專利範圍第工項所 丄 序之函數步驟。,之方広,其中更包括-取得該雜 〇·如申碩專利範圍第2項狀 數之步驟包括有:兵中該取得該源程序之函 迩行讀入該源程序之語句;以及 表、-函數二:句艾則根據該函數建立—函數參數 Π用衣 艾I衣以及— 4.如申請專利範圍第3述之方法,句表。 數,則繼、_人_財之語句二^讀蚊語句不為一函 _ 』<步驟。 :>·如申言月專利範圍第3項所述之方 是否結束之步驟。 ,/、中更包括有判斷該函數 6·如申請專利翻第!項所述之^ 序之讀入是否結束之步驟。 /、中更包括有判斷該源程 7·如申請專利範圍第3項所述之方法,苴 行域之步驟包括: 一中該取得等價程序的運 15 200828011 自該變量表中取得一變量; 讀入該源程序之一語句;以及 若該語句與該變量有關,則將該語句記錄至該等價源程序 中。 8. 如申請專利範圍第7項所述之方法,其中更包括有判斷該函數 是否結束之步驟。 9. 如申請專利範圍第7項所述之方法,其中更包括有判斷該變量 表是否讀取完畢之步驟。 16
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW95148661A TW200828011A (en) | 2006-12-22 | 2006-12-22 | Software test method for program running domain |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW95148661A TW200828011A (en) | 2006-12-22 | 2006-12-22 | Software test method for program running domain |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW200828011A true TW200828011A (en) | 2008-07-01 |
| TWI322351B TWI322351B (zh) | 2010-03-21 |
Family
ID=44817498
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW95148661A TW200828011A (en) | 2006-12-22 | 2006-12-22 | Software test method for program running domain |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TW200828011A (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI571737B (zh) * | 2015-11-18 | 2017-02-21 | 財團法人資訊工業策進會 | 軟體測試系統、方法及其非暫態電腦可讀取紀錄媒體 |
| TWI761917B (zh) * | 2020-08-19 | 2022-04-21 | 鴻海精密工業股份有限公司 | 程式調試方法、裝置及可讀存儲介質 |
-
2006
- 2006-12-22 TW TW95148661A patent/TW200828011A/zh not_active IP Right Cessation
Also Published As
| Publication number | Publication date |
|---|---|
| TWI322351B (zh) | 2010-03-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Ahire et al. | An empirical comparison of statistical construct validation approaches | |
| KR20150041050A (ko) | 문서 참조 템플릿들의 생성 및 관리를 위한 소프트웨어 툴 | |
| Abraham et al. | AutoTest: A tool for automatic test case generation in spreadsheets | |
| CN105589837B (zh) | 一种电子文档的自动查错方法 | |
| CN111124912B (zh) | 一种软件开发项目的质量评估方法及装置 | |
| Umar et al. | Analyzing non-functional requirements (NFRs) for software development | |
| Barraood et al. | Test case quality factors | |
| TW200828011A (en) | Software test method for program running domain | |
| Ding et al. | Self-checked metamorphic testing of an image processing program | |
| Siegl et al. | Model based requirements analysis and testing of automotive systems with timed usage models | |
| Villalobos-Arias et al. | Evaluation of a model‐based testing platform for Java applications | |
| Hauptmann et al. | Generating refactoring proposals to remove clones from automated system tests | |
| JP7141690B2 (ja) | イベント分析装置、イベント分析方法、およびプログラム | |
| do Nascimento et al. | An experimental evaluation of approaches to feature testing in the mobile phone applications domain | |
| Törner et al. | Defects in automotive use cases | |
| CN114937043B (zh) | 基于人工智能的设备缺陷检测方法、装置、设备及介质 | |
| Nayyar et al. | Analyzing test case quality with mutation testing approach | |
| Segura et al. | Functional testing of feature model analysis tools: a test suite | |
| Cheikhi et al. | Investigation of the Relationships Between the Software Quality Models of the ISO 9126 Standard: An Empirical Study Using the Taguchi Method. | |
| Godboley et al. | Poster: VeriSol-MCE: Verification-Based Condition Coverage Analysis of Smart Contracts Using Model Checker Engines | |
| Fogelström et al. | Test-case driven versus checklist-based inspections of software requirements–an experimental evaluation | |
| Chen et al. | EdiVal-Agent: An Object-Centric Framework for Automated, Fine-Grained Evaluation of Multi-Turn Editing | |
| Al Dallal et al. | Estimating the coverage of the framework application reusable cluster-based test cases | |
| Wang et al. | A security assurance framework combining formal verification and security functional testing | |
| Kannan et al. | Design time validation of service orientation principles using design diagrams |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| MM4A | Annulment or lapse of patent due to non-payment of fees |