In a large distributed enterprise multiple organizations may be involved in a collaborative effort to provide software components that they developed and maintain based on their own policies. When a local system downloads a component from a remote system into such an environment, the downloaded component should be checked to find if it contains internal failures or malicious codes before it is executed in the local system. Although the software was tested by the original developer in its local environment, we cannot simply assume that it will work correctly and safely in other organizations' computing environments. Furthermore, there is a possibility that some malicious codes are added to the original component by a mistake or intentionally. To address this problem, we propose a cooperative component-testing architecture that consists of three testing schemes, a provider node testing, a multiple-aspect testing, and a cooperative testing. The proposed architecture is able to effectively and efficiently detect malicious codes in a component. The provider node testing can increase the possibility of choosing the cleanest (least infected) component among components that exist on multiple remote systems. The multiple-aspect testing can improve the ability to detect a fault or malicious contents. And the cooperative testing scheme provides fast detection speed by integrating detection schemes effectively. Finally, we simulate our proposed ideas and provide a performance evaluation.