Transistor is an active device and it is use to perform rectification, switching and rectification. The name "transistor” is derived from "trans resistor” which means it changes resistance.
The resistance changes between very low resistance as a short circuit for a closed switch and very high resistance as an open switch.
As an electronic repairer you must distinguish between so many types of transistors, there are npn, pnp, n-channel and even p-channel, horizontal output transistor (with or without damper diode) and darlington transistor. Read the part number first and then try finding it from databook or even from the internet.
Once you know the transistor belongs to which type, you can then use the necessary technique to test a transistor.
In the market, there are many test instrument companies that offers a tester that can automatically detect as which type a transistor from. It’s easy and if the transistor is shorted or leaky the tester will prompt you about it.