The wide use of off-the-shelf component brings a great convenience to software development, but it also brings some challenges to software engineering due to the unavailability of source code. In general, most functions of component-based system are realized through coordination and communication between different components. And thus dependencies between components become inevitable. However, as for off-the-shelf component, it is difficult to extract component dependencies, because the dependency information can only be obtained from component files and specification documents while no strict standard for specifications has been set up until now.Dynamic analysis of component dependency can extract real-time dependencies during the runtime. The framework consists of five modules: interface analysis, system configuration, monitoring execution, dependency analysis and graph display.Based on the information extracted from the original component, a proxy component which has the same name, interface and methods as the original component is generated accordingly. Moreover, each method of the proxy component is instrumented with pre-probe and post-probe which are tagged with method-specific information. When the test suites executing in proxy component system, the probes record the invocation sequence of each method in a log file. Dependency analysis algorithm is proposed to extract dependencies, through reading, analyzing and matching the records of the log file. The result is saved in XML file, and shown visually via component dependency graph.Regression testing is one of the important phases in software development. Except for retesting the component modified, it is also necessary to validate the normal running of other components which are affected by the modified component. Based on the component dependency, a research on regression testing is conducted. The object of regression testing is obtained from component dependency graph. Adopting the criterion based on directed edge, test suites are selected from original test suites when the coverage can be guaranteed and testing cost can be cut down as much as possible. At last, in order to reduce the complexity, components are tested orderly in accordance with dependency. |