Optical fibers are tested using a variety of techniques, including optical time-domain reflectometry (OTDR), optical spectrum analysis, and insertion loss testing. These tests help to ensure that the fiber is performing properly and that there are no defects or damage to the fiber.