This test can be done without removing the shock absorber from the vehicle.
Visually inspect the shock absorber for evidence of leakage. If an excessive amount of oil is found, the shock is defective and must be replaced.
If there is no sign of excessive leakage (a small amount of weeping is normal) bounce the car at one corner by pressing up and down on the fender or bumper. When you have the car bouncing as much as possible, step back and count how many times the car bounces by itself until it stops. It should stop bouncing after the first rebound. If it continues to bounce past the center point of its up-and-down motion more than once, the shock absorbers are worn and should be replaced.