Software components are popular in nowadays software industries. However, how to test software components is a problem since the source code of the software component under test may not be available for the third-party user. In this paper we show that the software component should be tested in an adaptive manner in the sense that the software defect detection rates are estimated on-line by using testing data collected during testing to improve test case selections. In doing so, we use a recursive least squares estimation method to do on-line parameter estimations. This paper further justifies the advantages of the controlled Markov chain (CMC) approach to software testing in particular, and the practicality of the idea of software cybermetics in general.