Transistors and diodes are similar, although, superficially, they appear quite different. Diodes have two wires; transistors have three. Diodes allow current to flow in one direction only. Transistors act as fast electronic switches in computers and as amplifiers in audio and telephone equipment. Inside, both components are made of semiconductors and operate on similar principles.
Semiconductors are a crystal-like structure with a small, carefully control amount of impurity. Depending on the impurity, the semiconductor is either N-type or P-type. N-type semiconductors have free electrons floating around the crystal. P-type semiconductors have free "holes" -- the absence of electrons -- floating around the crystal. If you apply a positive potential to an N-type semiconductor, the electrons are attracted to the point where the positive potential is applied. If you apply a positive potential to a P-type semiconductor, the holes are pushed away from the point where the positive potential is applied. The opposite effects are seen with the application of a negative potential.
A diode consists of an N-type semiconductor and a P-type semiconductor placed together. If a positive potential is applied to the N-type semiconductor and a negative potential is applied to the P-type semiconductor, the holes and electrons are pulled away from the PN junction, and no current flows. If a negative potential is applied to the N-type semiconductor and a positive potential is applied to the P-type semiconductor, the holes and electrons are pushed toward the PN junction, where they combine and current flows. Diodes allow current to flow in one direction but not in the opposite direction.
Transistors are sandwiches of three slices of semiconductor material. The center slice is different from the outer slices. Current trying to flow across the sandwich will encounter a PN junction that acts as a diode no matter which way the current is flowing. How much the sandwich acts as a diode can be changed by applying a very small potential to the center slice. A small change in the center slice can turn "on" or "off" a current flowing across the sandwich. A small variation in a potential applied to the center slice can magnify itself in controlling a larger current flowing across the sandwich. Transistors can act as switches or as amplifiers.
The similarity of diodes and transistors becomes apparent with standard ohmmeter tests. To test a diode, apply the leads of an ohmmeter in both directions. The diode should read less than 100 ohms in one direction and more than 1,000 in the other direction. To test a transistor, apply the probes of an ohmmeter -- both ways -- to the emitter and the base; the base is the wire that goes to the center slice. It should read less than 100 ohms in one direction and more than 1,000 in the other direction. Testing between base and collector should produce the same results.