This paper presents a method to calculate the reliability of component-based software. The method uses the data sheet of COTS (Commercial Off -The Shelf components), partitioning every component?s input into sub-domains. Then it creates the Markov chain and calculates the whole system?s reliability based on the relation of components. This method is plausible in calculating the reliability of component-based software.