test script optimization