In this paper, a variant of particle swarm optimization (PSO) algorithm using modified time varying acceleration coefficients (PSO-TVAC) has been proposed and applied in creation of new test cases for modified code in regression testing. The performance of the proposed algorithm is compared with other existing PSO algorithms on five well known benchmark test functions. The experiments prove that the proposed algorithm has better performance. The test cases generated by the proposed PSO-TVAC algorithm have greater code coverage capability over the initial test cases.