"Bollocks" /ˈbɒləks/ is a word of Middle English origin, meaning "testicles". The word is often used figuratively in colloquial British English and Hiberno-English as a noun to mean "nonsense", an expletive following a minor accident or misfortune, or an adjective to mean "poor quality" or "useless". Similarly, common phrases like "Bollocks to this!" and "That's a load of old bollocks" generally indicate contempt for a certain task, subject or opinion. Conversely, the word also figures in idiomatic phrases such as "the dog's bollocks", "top bollock(s)", or more simply "the bollocks" (as opposed to just "bollocks"), which will refer to something which is admired, approved of or well-respected.
The word has a long and distinguished history, with the Oxford English Dictionary (OED) giving examples of its usage dating back to the 13th century. One of the early references is Wycliffe's Bible (1382), Leviticus xxii, 24: "Al beeste, that ... kitt and taken a wey the ballokes is, ye shulen not offre to the Lord..." (any beast that is cut and taken away the bollocks, you shall not offer to the Lord, i.e. castrated animals are not suitable as sacrifices).
The OED states (with abbreviations expanded): "Probably a derivative of Teutonic ball-, of which the Old English representative would be inferred as beall-u, -a, or -e".
The Teutonic ball- in turn probably derives from the Proto-Indo-European base *bhel-, to inflate or swell. This base also forms the root of many other words, including "phallus".