In this paper we propose a new procedure for testing independence of random variables, which is based on the conditional expectation. As it is well known, the behaviour of the conditional expectation may determine a necessary condition for stochastic independence, that is, the so called mean independence. We provide a necessary and sufficient condition for independence in terms of conditional e...