A stochastic approach to failure analysis in electromigration phenomena