Component-oriented Reliability Analysis and Optimal Version-upgrade Problems for Open Source Software