Software testing is the process of running an application with the goal of finding bugs and subsequently improving its quality. Software testing, as a key process, plays a role in ensuring the quality of software systems. Testing is currently considered an industry in the field of software. Given that about 40% of the cost of producing any software is spent on testing, creating tools for automatically generating test data will significantly reduce the current costs of software development. This process can be considered an optimization problem, and thus, search algorithms can be used for tackling it. The Genetic Algorithm (GA) is one of the widest algorithms in this field. In this paper, we have proposed a novel GA approach, called Group-based GA (G-GA), which differs from the standard GA algorithm in the following ways. First of all, a new fitness function has been utilized that uses search space information to guide the population. The population is divided into four groups, each of which is updated according to its fitness level. Finally, in the proposed algorithm, the selection operator has been omitted and thus, the algorithm has less complexity and calculations than the standard GA. Also, the proposed algorithm considers a good level of exploration and exploitation at each step. Experiments have shown that the proposed G-GA method, in terms of the convergence speed and the search time, significantly outperforms the basic GA, its variations, PSO, Tabu Search, and Simulated Annealing.