In the standard model of core accretion, the cores of the giant planets form by the accretion of planetesimals. In this scenario, the evolution of the planetesimal population plays an important role in the formation of massive cores. Recently, we studied the role of planetesimal fragmentation in the in situ formation of a giant planet. However, the exchange of angular momentum between the planet and the gaseous disk causes the migration of the planet in the disk. In this new work, we incorporate the migration of the planet and study the role of planet migration in the formation of a massive core when the population of planetesimals evolves by planet accretion, migration, and fragmentation.