Test cases optimization