Software Testing in Continuous Integration with Machine Learning and Constraint Optimization