Specification mining and automated testing of mobile applications