由于基于構(gòu)件的軟件開發(fā)技術使得大量結(jié)構(gòu)相似的應用程序可重用,縮短了軟件
開發(fā)周期、減少了軟件開發(fā)成本,因而成為當前軟件開發(fā)的主流技術,與此同時,相
關的質(zhì)量保證技術研究成為重要的研究內(nèi)容,其中構(gòu)件測試作為最有效、最直接的質(zhì)
量保證技術手段成為近年來軟件工程領域的研究熱點。但是,由于構(gòu)件的異構(gòu)性以及
構(gòu)件開發(fā)方和構(gòu)件使用方之間信息的缺乏使得構(gòu)件在集成到具體應用環(huán)境時無法實
施全面、高效的集成測試,這樣構(gòu)件系統(tǒng)的可靠性、安全性就無法保證。
針對上述問題,對基于元數(shù)據(jù)的構(gòu)件測試所涉及的相關理論、模型及其應用展開
了研究,旨在加強構(gòu)件開發(fā)方和構(gòu)件使用方信息交流,提高構(gòu)件可測試性,其主要途
徑是通過由構(gòu)件開發(fā)方提供描述構(gòu)件有關靜態(tài)和動態(tài)信息的元數(shù)據(jù),使得構(gòu)件使用方
所實施的集成測試不再是純粹的黑盒測試,而是一定程度上的白盒測試。
根據(jù)構(gòu)件應用的特點以及構(gòu)件元數(shù)據(jù)的一般功能和需求,引入分層元數(shù)據(jù)的概
念,將其分為描述性元數(shù)據(jù)和操作性元數(shù)據(jù),其中描述性元數(shù)據(jù)按照標識、應用、成
熟性、變更和質(zhì)量保證五個層次進行劃分,操作性元數(shù)據(jù)則要根據(jù)構(gòu)件所完成的相關
操作或任務來確定,一般來說,分為輸入/輸出、運行系統(tǒng)需求、遠程操作三個層次,
將這兩種元數(shù)據(jù)封裝在一起,構(gòu)成一個元數(shù)據(jù)對象,具體使用時對該對象進行操作,
直接進行應用;應用上述定義,描述分層元數(shù)據(jù)的參考模型及其UML表示,并進一
步構(gòu)造分層元數(shù)據(jù)系統(tǒng)的層次結(jié)構(gòu)和一般性框架;在此基礎上,將分層元數(shù)據(jù)應用到
構(gòu)件測試用例生成中,根據(jù)分層元數(shù)據(jù)的具體內(nèi)容,用UML用例和場景來刻劃測試
功能需求,使用相應的映射方法將其映射成形式化的測試用例元模型,進而構(gòu)成嵌入
元數(shù)據(jù)的測試元模型,實施集成測試。
可將分層元數(shù)據(jù)應用在回歸測試中,通過對構(gòu)件的變更進行分析、分類,構(gòu)造分
層元數(shù)據(jù)中描述變更的變更模型,使用變更-接口映射圖、方法依賴圖、分層描述性
元數(shù)據(jù)的接口模型以及相應的算法來實現(xiàn)構(gòu)件內(nèi)方法變更到構(gòu)件接口變更的映射,使
得構(gòu)件使用方只對發(fā)生變更所影響的測試用例實施回歸測試,回歸測試用例數(shù)減少到
最小,回歸測試時間明顯縮短。
分層描述性元數(shù)據(jù)中的分析模型基于構(gòu)件內(nèi)變量和方法之間的耦合信息來構(gòu)造,根據(jù)形式化的構(gòu)件耦合測試準則描述,使用構(gòu)件方法耦合圖的概念描述構(gòu)件中方
法之間的耦合關系,進而構(gòu)造包含構(gòu)件內(nèi)定義和使用信息的DU表,并引入旨在提高
構(gòu)件可觀察性的基于觀察點的監(jiān)控機制,構(gòu)造一個基于構(gòu)件耦合信息的可測試構(gòu)件的
總體實現(xiàn)框架。應用該框架可以較好地發(fā)現(xiàn)構(gòu)件中的異常。
分層元數(shù)據(jù)系統(tǒng)中構(gòu)件之間依賴關系的描述可用構(gòu)件依賴關系矩陣的形式來表
示,對構(gòu)件之間的依賴關系進行了分析,其中包含了八種構(gòu)件依賴關系,可以用構(gòu)件
依賴圖的形式來構(gòu)造構(gòu)件依賴模型,并用構(gòu)件依賴關系矩陣CmDM和復雜依賴關系
矩陣CmDDM來描述構(gòu)件Cm與構(gòu)件系統(tǒng)中其它構(gòu)件之間的依賴關系,可使用基于源
代碼和規(guī)范說明的構(gòu)件依賴關系確認方法來明確這些依賴關系,構(gòu)件依賴關系的確定
可幫助構(gòu)件使用方更明確地實施集成測試,而且當構(gòu)件發(fā)生變更時可用構(gòu)件依賴矩陣
來確定回歸測試用例集合,另外當構(gòu)件重用時也可應用構(gòu)件依賴矩陣來確定與該構(gòu)件
有關的構(gòu)件集合,因此,使用構(gòu)件依賴關系矩陣可提高構(gòu)件集成測試效率。
關鍵詞:構(gòu)件,基于構(gòu)件的軟件測試,構(gòu)件元數(shù)據(jù),耦合測試,構(gòu)件依賴關系Abstract
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. |
|