滕士波
摘 要: 軟件可靠性模型是定量評(píng)估軟件質(zhì)量的重要手段,通過(guò)綜合分析軟件故障檢測(cè)率及故障引入率建立改進(jìn)的NHPP軟件可靠性模型,并對(duì)可靠度進(jìn)行分析,證明所提模型的有效性,最后通過(guò)對(duì)現(xiàn)有的數(shù)據(jù)進(jìn)行分析,并與經(jīng)典模型進(jìn)行比較,證明所提模型的優(yōu)良性。
關(guān)鍵字: NHPP; 軟件可靠性模型; 故障引入率; 最小誤差平方和
中圖分類號(hào): TN710?34 文獻(xiàn)標(biāo)識(shí)碼: A 文章編號(hào): 1004?373X(2015)05?0123?02
Improved reliability model for NHPP software assessment
TENG Shi?bo
(Jiangsu Automation Research Institute, Lianyungang 222061, China)
Abstract: Software reliability model is an important method for software quality quantitative assessment. An improved re?liability model of NHPP software is built by analyzing software fault detection rate and fault introducing rate. Its reliability is analyzed to prove the validity of the model mentioned above. The excellent characteristics of the improved model were proved by analyzing the available data and comparing with the classic model.
Keywords: NHPP; software reliability model; fault introducing rate; least sum of square error
0 引 言
NHPP類軟件可靠性模型是最常見(jiàn)并且應(yīng)用最廣泛的軟件可靠性模型,大多數(shù)NHPP類軟件可靠性模型通過(guò)分析軟件總故障數(shù)及故障檢測(cè)率來(lái)求得軟件可靠度,文獻(xiàn)[1]通過(guò)綜合分析軟件運(yùn)行覆蓋率及測(cè)試人員努力程度來(lái)求得故障檢測(cè)率,文獻(xiàn)[2]通過(guò)分別分析軟件總故障數(shù)與時(shí)間成正比及軟件總故障數(shù)與期望故障數(shù)成正比建立NHPP類軟件可靠性模型。在實(shí)際工程中,隨著軟件的運(yùn)行,軟件的故障將變得比較隱蔽,開(kāi)發(fā)人員對(duì)故障的排除率也將變得比較困難,在排除錯(cuò)誤的過(guò)程中,也有可能引入新的錯(cuò)誤。本文通過(guò)綜合考慮故障檢測(cè)率、故障排除率、故障引入率、軟件預(yù)期故障總數(shù)來(lái)建立了一種改進(jìn)的NHPP軟件可靠性模型,并對(duì)2組經(jīng)典數(shù)據(jù)進(jìn)行實(shí)例分析,通過(guò)與現(xiàn)有的NHPP軟件可靠性模型進(jìn)行比較分析,證明本文所改進(jìn)的NHPP軟件可靠性模型的優(yōu)良性。
1 改進(jìn)的NHPP軟件可靠性模型
為構(gòu)建改進(jìn)的NHPP軟件可靠性模型,需做如下假設(shè):
(1) 軟件實(shí)際運(yùn)行環(huán)境與測(cè)試可靠性剖面完全一致;
(2) 到時(shí)間[t]時(shí)刻累計(jì)錯(cuò)誤數(shù)[C(t)]服從均值函數(shù)為 [m(t)] 的泊松過(guò)程;
(3) 在[t,t+Δt]時(shí)間范圍內(nèi)期望發(fā)現(xiàn)的故障數(shù)與軟件剩余錯(cuò)誤數(shù)成正比,比例為錯(cuò)誤檢測(cè)率[φ(t),][0<φ(t)<1;]
(4) 在[t,t+Δt]時(shí)間范圍內(nèi),軟件累計(jì)排除的錯(cuò)誤數(shù)[x(t)]與在此段時(shí)間范圍內(nèi)期望發(fā)現(xiàn)的故障數(shù)[m(t)]成正比,比例為[μ(t)-ω(t)],[μ(t)]為錯(cuò)誤排除率,[ω(t)]為錯(cuò)誤引入率,[0<ω(t)<μ(t)<1];
(5) 軟件預(yù)期故障數(shù)[a(t)]與軟件初始時(shí)刻故障數(shù) [β]之差同軟件累計(jì)排除的錯(cuò)誤數(shù)[x(t)]成正比,比例為 [η(t)],[0<η(t)<1]。
根據(jù)上述假設(shè),可得如下方程:
[dm(t)d(t)=φ(t)a(t)-x(t)dx(t)d(t)=(μ(t)-ω(t))dm(t)d(t)a(t)=β+η(t)x(t)] (1)
初始條件為:
[m(0)=0x(0)=0] (2)
聯(lián)立方程 (1),(2)可得期望軟件故障數(shù)為:
[m(t)=β0tφ(τ)(1+0τφ(τ)exp(-0τφ(τ)(η(τ)-1)(μ(τ)-ω(τ))dτ)η(τ)exp(0τφ(τ)(η(τ)-1)(μ(τ)-ω(τ))dτ)×0τφ(τ)exp(-0τφ(τ)(η(τ)-1)(μ(τ)-ω(τ))dτ)(μ(τ)-ω(τ))dτ)dτ] (3)
因?yàn)槔鄯e故障數(shù)[C(t)]服從均值函數(shù)為[m(t)]的泊松過(guò)程,故累積故障數(shù)為:
[P(C(t)=n)=m(t)nn!e-m(t), n=0,1,2,…,k] (4)
由非齊次泊松分布的性質(zhì)可得軟件可靠度函數(shù)為:
[R(t+δ|t)=P{C(t+δ)-C(t)=0}=e-(m(t+δ)-m(t))] (5)
隨著測(cè)試人員測(cè)試過(guò)程的進(jìn)行,軟件的錯(cuò)誤會(huì)隱蔽的比較深,發(fā)現(xiàn)錯(cuò)誤的概率會(huì)減小,伴隨著錯(cuò)誤的排除,當(dāng)[t→∞]時(shí),錯(cuò)誤檢測(cè)率將趨于零。故可假設(shè)錯(cuò)誤檢測(cè)率為:
[φ(t)=kexp(-rt)] (6)
式中:[k]為初始時(shí)刻的檢測(cè)率,[0
為方便計(jì)算,在此假設(shè)軟件開(kāi)發(fā)人員在排除錯(cuò)誤過(guò)程中錯(cuò)誤排除率[μ(t)]及錯(cuò)誤引入率[ω(t),][η(t)]為常數(shù),即:
[μ(t)=μω(t)=ωη(t)=η] (7)
式中[0<ω<μ<1,][0<η<1。]
將式(6)及式(7)代入式(3)得在[t]時(shí)刻軟件期望故障數(shù)為:
[m(t)=βexpk(1-e-rt)(1-η)(μ-ω)r-1(1-η)(μ-ω)] (8)
通過(guò)最小二乘法即可求得[m(t)]中的參數(shù)。
2 模型驗(yàn)證及評(píng)價(jià)
為了期望故障數(shù)[m(t)]更好地逼近實(shí)驗(yàn)數(shù)據(jù),可通過(guò)最小誤差平方和(SSE)來(lái)預(yù)估其中的參數(shù)。
[SSE=i=1n(yi-m(ti))2] (9)
式中:[n]為軟件失效樣本數(shù)量;[yi]為[ti]時(shí)刻觀測(cè)到的錯(cuò)誤數(shù)。
[?SSE?β=i=1n2(yi-m(ti))?m(ti)?β=0?SSE?k=i=1n2(yi-m(ti))?m(ti)?k=0?SSE?r=i=1n2(yi-m(ti))?m(ti)?r=0?SSE?η=i=1n2(yi-m(ti))?m(ti)?η=0?SSE?μ=i=1n2(yi-m(ti))?m(ti)?μ=0?SSE?ω=i=1n2(yi-m(ti))?m(ti)?ω=0] (10)
在[0<β<∞,0 可通過(guò)MSE來(lái)度量模型的擬合效果,MSE方程如下: [MSE=1ni=1nm(ti)-yi2] (11) 由方程(11)可知,MSE越小,擬合效果越好。 為了檢驗(yàn)改進(jìn)的NHPP軟件可靠性模型,本文使用文獻(xiàn)[3]中的數(shù)據(jù)(見(jiàn)表1)進(jìn)行實(shí)驗(yàn),并與文獻(xiàn)[2,4?5] 進(jìn)行對(duì)比,實(shí)驗(yàn)結(jié)果如圖1所示。 由表2可看出,本文提出的模型擬合效度較優(yōu)。 3 結(jié) 語(yǔ) 本文提出了一種改進(jìn)的NHPP軟件可靠性模型并對(duì)提出的模型進(jìn)行仿真實(shí)驗(yàn)及比較,證明了本文提出模型的優(yōu)良性,在后續(xù)研究中可以更好地通過(guò)分析缺陷探測(cè)率、軟件運(yùn)行覆蓋率、排除錯(cuò)誤時(shí)錯(cuò)誤引入率等特性,代入本文提出的模型中,從而達(dá)到更好的擬合效果。 參考文獻(xiàn) [1] 李海峰,劉暢,鄭軍,等.考慮測(cè)試工作量與覆蓋率的軟件可靠性模型[J].軟件學(xué)報(bào),2013,24(4):749?760. [2] PHARN H, ZHANG Xue?mei. NHPP software reliability and cost models with testing coverage [J]. European Journal of Ope?rational Research, 2003, 145(2): 445?454. [3] OHBA M. Software reliability analysis models [J]. IBM Journal of Research and Development, 1984, 28(4): 428?443. [4] PHAM H. An imperfect?debugging fault?detection dependent?parameter software [J]. International Journal of Automation and Computing, 2007, 4(4): 325?328. [5] HUANG Chin?yu, LIN Chu?ti. Software reliability analysis by considering fault dependency and debugging time lag [J]. IEEE Transactions on Reliability, 2006, 55(3): 436?450. [6] 侯春燕,崔剛,劉宏偉,等.基于構(gòu)件的INHPP類軟件可靠性增長(zhǎng)模型的研究[J].計(jì)算機(jī)科學(xué),2009,36(4):195?199. [7] 孫志安,裴曉黎.軟件可靠性工程[M].北京:北京航空航天大學(xué)出版社,2009. [8] ZHANG X M, TENG X L, PHAM H. Considering fault remo?val efficiency in software reliability assessment [J]. IEEE Tran?sactions on Systems, Man, and Cybernetics: Systems and Humans, 2003, 33(1): 114?119. [9] PHAM H,NORDMANN L,ZHANG X. A general imperfect?software?debugging model with S?shaped fault?detection rate [J]. IEEE Transactions on reliability, 1999, 48(2): 169?175.