I believe the answer is: operant conditioning
Operant conditioning refers to a method of learning that could only be done through the use of reward and behaviour. In the example above Timmy learn to favor his misbehaviour because it always resulted in him obtaining the reward that he wants (attention)