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