Is 'bug' a term or a slang word?
The story of the real-life moth as a computer "bug" is told at length under the title "First Computer Bug." Even in this case, though, the way the people involved treated the incident suggests that the word bug was already understood metaphorically:
On the 9th of September, 1947, when the machine was experiencing problems, an investigation showed that there was a moth trapped between the points of Relay #70, in Panel F.
The operators removed the moth and affixed it to the log. (See the picture above.) The entry reads: "First actual case of bug being found."
In fact, an instance where bug is used in the sense of "system problem" appears five years earlier than that, in The Autocar: A Journal Published in the Interests of the Mechanically Propelled Road Carriage, volume 87 (1942) [combined snippets]:
I think everyone will agree that there is a "bug" in the system when, in times of peace, poverty can exist amidst plenty. In fact, during a slump, food is actually destroyed whilst hungry people have no jobs and in consequence insufficient money to buy the food that is being destroyed. Under the existing monetary system everyone is fully employed only in times of war! What a system!
Another early use of bug in this metaphorical sense is from United States Investor, volume 61 (1950):
We are neither Republicans nor Democrats ... Protestants, Catholics nor Jews ... white nor black. We are just Americans who believe that the Democratic system is the best there is, but who also know that the system has "bugs" in it that have to be exterminated in order that democracy can come to its full flower of liberty and service for every citizen.
These "bugs" are not the fault of any particular political party or individual. They have developed within the framework of the executive branch of the government, that has, like Topsy, "just growed".
In both of the preceding examples the buggy system was political or economic. But in answer to an EL&U question (Origin of "bug" in reference to software) posed back in September 2011, researcher extraordinaire Hugo noted that bugs is used in a logbook entry from April 17, 1944, at Harvard’s Computation Laboratory (as reported by Peggy Kidwell in an article published in IEEE Annals of the History of Computing (December–October 1998)) in the specific context of computer operation, three years before the much-discussed moth episode:
Ran test problem. Mr. Durfee from I.B.M. was here to help us find “bugs.”
Oxford Dictionaries online finds a much earlier instance of bug—this time in connection with the new technology of audio recording. From "Was the first computer 'bug' a real insect?":
The term in fact originates not with computer pioneers, but with engineers of a much earlier generation. The first example cited in the 20-volume historical Oxford English Dictionary is from the Pall Mall Gazette of 11 March 1889:
Mr. Edison, I was informed, had been up the two previous nights discovering 'a bug' in his phonograph - an expression for solving a difficulty, and implying that some imaginary insect has secreted itself inside and is causing all the trouble.
The upshot is that bug was in use as a metaphorical or figurative term for a systemic problem in 1889. Whether that makes it a slang term more than a hundred years later is a matter of opinion, I suppose—but the notion that prior to the first figurative use of "computer bug," a bug was strictly and literally an insect appears to be incorrect in any case.
Was bug literal then figurative?
So the question is: if a word used to be a term because it described an object literally (real bug), now is used figuratively (computer error), does it remain a term or is it a slang word?
For slang, it's irrelevant if something was once literal and then figurative. Many things have gone from literal to figurative, some with both terms being slang, others with both terms not being slang, and yet others with just one slang.
It's also not clear that a computer bug was once something literal.
Is bug slang?
So, is a computer bug a slang word?
The Oxford English Dictionary says it is. Their sense 3 of bug, n.2 is "In various slang uses", and 3.b is "A defect or fault in a machine, plan, or the like". Their first example is from 1889, and it's been used in a software context since 1943 (three year's before Hopper's moth, a literal bug, in 1947).
So it's over 125 old, and has been used in computing about as long as there's been computers.
Define slang
It also depends how you define slang. Here's Oxford Dictionaries' definition:
A type of language consisting of words and phrases that are regarded as very informal, are more common in speech than writing, and are typically restricted to a particular context or group of people.
Is "bug" regarded as very informal? Perhaps not very informal, but yes, I'd say it's at least informal.
A good test for informality is the next test: is it more common in speech than writing? Generally, yes. In writing issue and defect are generally preferred.
Is it typically restricted to a particular context or group of people? Yes, computer programmers and users, and in a computing (software) context.
I would not consider "bug" to be a slang term primarily due to the fact that it has no unambiguous synonym, however I would consider it informal because of its etymology (real bugs getting stuck in vacuum tubes and causing computer errors). For example "defect" is ambiguous: Does it refer to a product or does it refer to a computer programming error?
Dictionary.com backs this opinion and has "bug" defined as 4. (Informal) a defect or imperfection as in a mechanical device, computer program or plan.
In short: "Bug" is informal but not slang.