To figure out the "rules" the dogs use to herd sheep, the researchers developed a mathematical model - a "self-propelled particle model of local attraction-repulsion type" to model the way a shepherd would move a group of interacting animals towards a goal. By outfitting the dog and sheep with GPS trackers, the researchers could record the movements of every animal. They could then compare the model to the dogs behavior under different conditions to test how well it predicts the actual behavior of the dog and sheep.
Strombom D, RP Mann, AM Wilson, S Hailes, AJ Morton, DJT Sumpter, & AJ King. 2014. Solving the shepherding problem- heuristics for herding autonomous, interacting agents. Journal of the Royal Society Interface 11:201407819 (pdf)