A Percolative Approach to Reliability of Thin Films