The invention relates to a test tube comprising a tubular container, which tubular container at its bottom end is provided with an optically readable coding such as a dot code, and in which the optically readable coding is applied to an optically substantially opaque surface. The optically opaque surface is preferably substantially flat and faces downwards. For constructional reasons it is very advantageous if the optically opaque surface is applied to a carrier part fixed to the bottom end of the tubular container. The invention also relates to a rack with a multiplicity of accommodation positions for accommodating test tubes according to the invention therein, the accommodation positions being optically open at the underside. The invention further relates to an assembly comprising a rack according to the invention and an optical reading mechanism for reading the optical codings on the underside of the test tubes according to the invention placed in the rack.