||The idea of failure clustering is to index all failures due to the same fault together. An effective failure clustering technique provides invaluable guidance to failure report analyses for both traditional applications and context-aware applications. Examples of these analyses include duplicate removal, failure prioritization, and patch suggestion. Underpinning an effective clustering technique is properly designed failure proximity. Failure proximity for conventional applications has been well studied. However, no such study has been conducted on context-aware applications. Existing failure proximity techniques commonly assume that the execution profiles of failing test runs due to different faults diverge. Unfortunately, this assumption does not necessarily hold for context-aware applications, which react to a continual data input stream capturing the contexts of their runtime environment. We observe that only a few segments of the input stream are failure-inducing. Applying failure proximity techniques to the whole input streams that lead to failing test runs do not often result in significantly different execution profiles when these test runs trigger different faults. In this thesis, we propose to perform failure clustering by applying failure proximity techniques only to those failure-inducing segments. Our experiments show that our approach greatly improved the accuracy of failure proximity for context-aware applications. To the best of our knowledge, our work is the first attempt of studying the effectiveness of failure proximity for context-aware applications.