An optimization design method was proposed for linear phased array ultrasonic imaging testing. In the method, main lobe width and the amplitude ratio of side lobe to main lobe were served as optimization objectives to judge the test- ing precision of phased array beam directivity. The combination of element of width and inter-element space was served as optimize parameter for the optimization objectives. The combination of optimal parameters for phased array transducer was finally achieved and applied to phased array B-mode imaging ultrasonic testing on a flat bottom hole in standard test block. The results show that the method can not only obtained the optimal parameters for linear array of phased array transducer, but also improve the accuracy of the location and size for defect detection.