There are lots of different software metrics discovered and used for defect prediction in the literature. Instead of dealing with so many metrics, it would be practical and easy if we could determine the set of metrics that are most important and focus on them more to predict defectiveness. In this book, we use Bayesian modeling to determine the influential relationships among software metrics and defect proneness. Furthermore, we propose a novel technique for defect prediction that uses plagiarism detection tools. We use kernel programming to model the relationship between source code similarity and defectiveness and suggest that source code similarity is a good means of predicting both defectiveness and the number of defects in software systems.