The method involves illuminating a reference surface (72) with preset optical characteristics with illumination light of a light source (22). Images of the reference surface are detected by an imaging device e.g. endoscope (10), and a camera (31). Operating conditions of the camera are detected during detection of the images. Efficiency of an optical inspection system is determined based on detected operating conditions. Distal ends (12) of the imaging device are arranged at a preset position relative to the reference surface. Application of the optical inspection system is detected. Independent claims are also included for the following: (1) a computer program comprising a program code for executing a method for testing optical inspection system (2) a controller for executing a method for testing optical inspection system.