During the while lifecycle of software development, software testing is one of the key steps to ensure the high quality of software. With the popular application of Object-Oriented technology focus on Object-Oriented testing more and more. But some characters of Object-Oriented programs, such as encapsulation, inheritance, polymorphism, and exception handling mechanism, bring some new challenging problems to software testing. Exploiting a new system of testing theory and technology for these new specialties is essentially important. Object-Oriented software testing can be classified into four different levels: method level, class level, cluster level, and system level. There is no significant different between the methods in class and the procedures in traditional program, while the class and cluster level testing encounter the new problems.UML is a powerful language for modeling. It provided a method mechanism and a set of visual diagrams to help developing and managing systems. UML describes the system in concise and accurate way, so it is popular used. So testing abased UML diagrams have realistic meaning. As the result, people are considering UML in testing. A testing method base on UML sequence diagram can product the testing cases at the time of making specification. This can provide test cases at the beginning of development, and let the test cases are consistent with the software design.This paper proposes an approach for object-oriented testing at cluster-levels. According to sequence diagrams, this approach can pick up class interaction information, generate testing case. And this approach can generate test stub for class and insert some probe function into source code to generate a testing instruction. Finally, it run the testing instruction by test driver and generates test result. This approach includes solution for sequence diagrams new characters presented in UML2.0.Finally, implement the correspondence arithmetic in Visual C++2005 base on the theory. |