Understanding and Mitigating Flaky Software Test Cases