Playful raillery, banter (French), from the verb badiner, to joke or jest. The noun badine means a switch, and in France they catch wild ducks by covering a boat with switches, in which the ducks seek protection. A person quizzed is like these wild ducks.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Badinage from Fact Monster: