您的位置:首页 > 编程语言 > C语言/C++

Automation Testing Framework by c++, Practice-1: tips from POSA4

2007-08-15 13:10 417 查看
When I am reading some chapters in "Pattern.Oriented.Software.Architecture.Volume4: A Pattern Language for Distributed Computing",
one glue came into my mind if we can use some "Reflection" pattern to build up the test framework.
Further more, it also can help Transactive in supporting "plug-in-out" features in future as a real configurable product.

As one summary introduces this practice in page 199, that is:

An INTROSPECTIVE INTERFACE (286) and a DYNAMIC INVOCATION INTERFACE (288) support application-external clients such as test frameworks or object browsers, to obtain information about base level domain objects without becoming dependent on their internal structure, as well as invoking methods on them without the need to use their functional interfaces.

Below is of detail explanations for those two patterns,

The INTROSPECTIVE INTERFACE (286) pattern offers a supplementary interface that supports clients in accessing information about a component’s type, functionality, public interface, internal structure, behavior, and computational state. Clients or application-external tools can use this information to monitor a component or control their use of the component.

The DYNAMIC INVOCATION INTERFACE (288) pattern offers a supplementary
interface that allows clients to invoke methods on
components dynamically, composing the calls at runtime rather
than selecting them from declarations.

My thought is,
Since I studied some libs done by c++, implementing Reflection, it's very useful to build one part of the framework to call the interfaces provided by Transactive.

Further, we also can use XML as an assistant to work with Reflection, so that the test cases can be configured one by one.

A link to C++ Reflection lib: http://seal-reflex.web.cern.ch/seal-reflex/
A link to XML lib: http://www.gccxml.org/HTML/Install.html



But, it needs to modify the current Transactive, since the reflection mechanism must be imported first.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: