Software testing is an important and complicated phase of software development cycle. Software test process acquires test cases as input for the system under test to evaluate the behavior of the product. If test cases are prepared before coding, it will help the developers to control their code to conform to specification. White box testing requires a set of predefined test paths to generate test cases, therefore generating a set of reliable test paths is a critical task. The most common approach in white box testing is to generate test paths from source code while the generation process must be delayed until completion of source code. Using sequence diagram as an input artifact for generating test path is cost and time efficient due to the fact that test process starts before implementation phase. Furthermore, tester involvement in source code complexity is reduced to a minimum. Test paths are generated from the control flow graph, which is extracted from sequence diagrams. Among all graph based coverage criteria, Prime path coverage subsumes different graph based coverage criteria that lead us to complete path coverage. Also, prime path coverage concentrates on visiting all nodes and edges in the control flow graph rather than traversing all existing paths, which results in test effort reduction. Genetic algorithm is applied minimize the number of test cases required to reach the highest coverage.In this paper, we proposed a model to generate all prime paths automatically and extract minimum paths with shortest possible length, which covers all prime paths by means of genetic algorithm. The experimental results show the generated paths can easily turn into optimal test paths with the best prime path coverage having the least number of test paths.