Here's the definition, right out of the NRA Firearms Sourcebook. It is “...the minor interior diameter of a barrel that is the diameter of a circle formed by the tops of the lands.” That is the bore diameter, but groove diameter is “...the diameter of a circle circumscribed by the bottom of the grooves...”
Look at it this way—a gunmaker starts with a thick-walled steel tube when he or she goes about making a barrel for a firearm. The tube is gun-drilled, straight and true to a dimension that is a few thousandths less than the diameter of the bullet. This dimension will be just about the same as the bore diameter in the finished barrel. He then forces or draws a button or cutter through the barrel with a twisting motion in order to impart spiral grooves evenly down the bore. This action removes or displaces enough metal as to produce consistently deep, evenly-spaced grooves from end to end. The dimension from the bottom of the groove to the bottom of the opposite groove is the groove diameter.
When the gun is fired, a bullet is forced into the barrel under great pressure. The bullet has a diameter very close to the groove diameter of the barrel, so it is a tight fit. Expanding powder gasses force it forward, thereby engraving it into the rifling and causing it to turn. The fit is tight enough to prevent powder gasses from getting around the bullet as it traverses the barrel, so it comes out of the barrel spinning at a rate imparted by the twist rate of those spiral grooves.
There are two diameters in a barrel. The greater (major) diameter is the groove; the lesser (minor) is the bore.