由于基于構(gòu)件的軟件開發(fā)技術(shù)使得大量結(jié)構(gòu)相似的應(yīng)用程序可重用,縮短了軟件
開發(fā)周期、減少了軟件開發(fā)成本,因而成為當(dāng)前軟件開發(fā)的主流技術(shù),與此同時(shí),相
關(guān)的質(zhì)量保證技術(shù)研究成為重要的研究內(nèi)容,其中構(gòu)件測試作為最有效、最直接的質(zhì)
量保證技術(shù)手段成為近年來軟件工程領(lǐng)域的研究熱點(diǎn)。但是,由于構(gòu)件的異構(gòu)性以及
構(gòu)件開發(fā)方和構(gòu)件使用方之間信息的缺乏使得構(gòu)件在集成到具體應(yīng)用環(huán)境時(shí)無法實(shí)
施全面、高效的集成測試,這樣構(gòu)件系統(tǒng)的可靠性、安全性就無法保證。
針對上述問題,對基于元數(shù)據(jù)的構(gòu)件測試所涉及的相關(guān)理論、模型及其應(yīng)用展開
了研究,旨在加強(qiáng)構(gòu)件開發(fā)方和構(gòu)件使用方信息交流,提高構(gòu)件可測試性,其主要途
徑是通過由構(gòu)件開發(fā)方提供描述構(gòu)件有關(guān)靜態(tài)和動態(tài)信息的元數(shù)據(jù),使得構(gòu)件使用方
所實(shí)施的集成測試不再是純粹的黑盒測試,而是一定程度上的白盒測試。
根據(jù)構(gòu)件應(yīng)用的特點(diǎn)以及構(gòu)件元數(shù)據(jù)的一般功能和需求,引入分層元數(shù)據(jù)的概
念,將其分為描述性元數(shù)據(jù)和操作性元數(shù)據(jù),其中描述性元數(shù)據(jù)按照標(biāo)識、應(yīng)用、成
熟性、變更和質(zhì)量保證五個(gè)層次進(jìn)行劃分,操作性元數(shù)據(jù)則要根據(jù)構(gòu)件所完成的相關(guān)
操作或任務(wù)來確定,一般來說,分為輸入/輸出、運(yùn)行系統(tǒng)需求、遠(yuǎn)程操作三個(gè)層次,
將這兩種元數(shù)據(jù)封裝在一起,構(gòu)成一個(gè)元數(shù)據(jù)對象,具體使用時(shí)對該對象進(jìn)行操作,
直接進(jìn)行應(yīng)用;應(yīng)用上述定義,描述分層元數(shù)據(jù)的參考模型及其UML表示,并進(jìn)一
步構(gòu)造分層元數(shù)據(jù)系統(tǒng)的層次結(jié)構(gòu)和一般性框架;在此基礎(chǔ)上,將分層元數(shù)據(jù)應(yīng)用到
構(gòu)件測試用例生成中,根據(jù)分層元數(shù)據(jù)的具體內(nèi)容,用UML用例和場景來刻劃測試
功能需求,使用相應(yīng)的映射方法將其映射成形式化的測試用例元模型,進(jìn)而構(gòu)成嵌入
元數(shù)據(jù)的測試元模型,實(shí)施集成測試。
可將分層元數(shù)據(jù)應(yīng)用在回歸測試中,通過對構(gòu)件的變更進(jìn)行分析、分類,構(gòu)造分
層元數(shù)據(jù)中描述變更的變更模型,使用變更-接口映射圖、方法依賴圖、分層描述性
元數(shù)據(jù)的接口模型以及相應(yīng)的算法來實(shí)現(xiàn)構(gòu)件內(nèi)方法變更到構(gòu)件接口變更的映射,使
得構(gòu)件使用方只對發(fā)生變更所影響的測試用例實(shí)施回歸測試,回歸測試用例數(shù)減少到
最小,回歸測試時(shí)間明顯縮短。
分層描述性元數(shù)據(jù)中的分析模型基于構(gòu)件內(nèi)變量和方法之間的耦合信息來構(gòu)造,根據(jù)形式化的構(gòu)件耦合測試準(zhǔn)則描述,使用構(gòu)件方法耦合圖的概念描述構(gòu)件中方
法之間的耦合關(guān)系,進(jìn)而構(gòu)造包含構(gòu)件內(nèi)定義和使用信息的DU表,并引入旨在提高
構(gòu)件可觀察性的基于觀察點(diǎn)的監(jiān)控機(jī)制,構(gòu)造一個(gè)基于構(gòu)件耦合信息的可測試構(gòu)件的
總體實(shí)現(xiàn)框架。應(yīng)用該框架可以較好地發(fā)現(xiàn)構(gòu)件中的異常。
分層元數(shù)據(jù)系統(tǒng)中構(gòu)件之間依賴關(guān)系的描述可用構(gòu)件依賴關(guān)系矩陣的形式來表
示,對構(gòu)件之間的依賴關(guān)系進(jìn)行了分析,其中包含了八種構(gòu)件依賴關(guān)系,可以用構(gòu)件
依賴圖的形式來構(gòu)造構(gòu)件依賴模型,并用構(gòu)件依賴關(guān)系矩陣CmDM和復(fù)雜依賴關(guān)系
矩陣CmDDM來描述構(gòu)件Cm與構(gòu)件系統(tǒng)中其它構(gòu)件之間的依賴關(guān)系,可使用基于源
代碼和規(guī)范說明的構(gòu)件依賴關(guān)系確認(rèn)方法來明確這些依賴關(guān)系,構(gòu)件依賴關(guān)系的確定
可幫助構(gòu)件使用方更明確地實(shí)施集成測試,而且當(dāng)構(gòu)件發(fā)生變更時(shí)可用構(gòu)件依賴矩陣
來確定回歸測試用例集合,另外當(dāng)構(gòu)件重用時(shí)也可應(yīng)用構(gòu)件依賴矩陣來確定與該構(gòu)件
有關(guān)的構(gòu)件集合,因此,使用構(gòu)件依賴關(guān)系矩陣可提高構(gòu)件集成測試效率。
關(guān)鍵詞:構(gòu)件,基于構(gòu)件的軟件測試,構(gòu)件元數(shù)據(jù),耦合測試,構(gòu)件依賴關(guān)系A(chǔ)bstract
Because component-based software development technique make a lot of applications
with similar architecture reuse,and shorten development cycle,decrease software
development cost,thus it has become main development technique now.At the same time,
relevant research of quality guarantee technique has yet become an important research
aspect.In those,Component-based software testing,as one of the most directly and
effectively quality quaranttee means,has become a research hot point in software
engineering field.But it makes component-based software integration testing diffcult to
implement fully and effectively when component is integrated into actual application
environment,because of the heterogeneity of cpmponent and lack of information between
component developers and component users.So the reliability and safety of
component-based software system are not ensured.
Addressed to above problems,relevant theory,model and application about
component-based software testing based on metadata is developed,which aims to extend
mutual information between component developers and component users,and increase
component testability.The main way is that metadata describing static and dynamic
information about component is provided by component developers to component users.
This may make integration testing implemented by component users not a complete
black-box testing,but a white-box testing to a certain extent.
According to the features of component applied,the general functionalities and
requirements of component metadata,grouped-metadata is introduced,which is divided
into descriptive metadata and operational metadata.Descriptive metadata describes the
static attributes of components,including five groups including identification,use,
maturity,changes and quality assurance.Operational metadata is identified according to
relevant operations and tasks accomplished.In general,it may be divided into three groups
including input/output,run-time requirements,and remote operation.These two
metadatum are encapsulated together to construct a metadata object.When it is
implemented integration operation,it may be directly applied.According to above
definitions,a reference model of grouped-metadata and its UML representation isconstructed.And further construct an aritecture and a general framework of
grouped-metadta system.Based on these,grouped-metadata reference model is applied to
test cases generation.UML use cases and scenarios are applied to describe the functional
requirements according to the detail of grouped-metadata.And relevant mapping method is
used to map informal use cases to formal test cases meta-model.Then a test meta-model
embedded in grouped-metadata to implement integration testing is constructed. |
|