Software testing is a widely used validation approach in software industry and it consumes 50% of total development cost. Test case generation is a vital part in software testing which is time consuming and tedious process when done manually. Hence automatic test case generation techniques are emerging to assist developers and testers. Automatic test case generation technique using Particle Swarm Optimization [PSO] is suffering from prematurity, which decreases the test case generation efficiency. A novel technique to automate the test case generation process for branch coverage criteria is developed by applying Adaptive Particle Swarm Optimization [APSO] which uses self-adaptive inertia weight to restrain the prematurity.