构件复用是提高软件开发效率的有效途径,构件测试是保证构件质量的重要手段。针对目前构件测试的现状,对构件测试进行了深入研究,提出了一种合约检查的构件测试方法,将Bertrand Meyer的合约概念引入到构件设计开发测试过程中,从构件开发者和复用者的角度分析构件及构件的测试,违反构件合约时抛出异常信息,快速定位异常位置,提高软件开发的效率。
Component reuse is an effective way to improve the efficiency of software development .Component testing is an important way to ensure the quality of components .In view of the present condition of the component testing ,the compo-nent testing conducted in-depth research ,a component testing method is proposed based on contract checking .Bertrand Meyer's contract concept is introduced to component design and development testing process .From the perspective of the component developers and users ,component and component testing are analyzed ,an exception is thrown when the compo-nent contract is violated ,to quickly locate exception position ,improve the efficiency of software development .