The OED gives 'attaboy' as a "careless pronunciation" of "that's the boy!", though the more common expression is "that's a [good] boy!", which derives from the expressions "That's my [good] boy" which first appears in Shakespeare's Titus Andronicus.
It has otherwise been suggested that attaboy goes back to the hunters’ language, in which boy acquired the meaning “hunted animal.” attaboy (or ataboy, as it is sometimes spelled, because no one knows the “right” spelling of this phrase) would go back to "a tout a boy!" ("a tout", a call to incite dogs). (Attaboy! Or, The Male-Intimate Affectionate Overtones Questions By Anatoly Liberman, December 13th, 2006)
- (idiomatic, colloquial) Used to show encouragement or approval to a boy or man.
- Attaboy! That's the way to hit a home run!
attaboy (plural attaboys)
- A cry of "attaboy"; an accolade.
2007 June 30, David M. Halbfinger, “How a Fan of Comic Books Transformed Himself Into a Hollywood Player”, New York Times:
- LOS ANGELES, June 29 — Drink in hand, attaboys coming at him from every direction, Tom DeSanto was living the fanboy dream.