# On the Use of Context in Recommending Exception Handling Code Examples

arXiv: https://arxiv.org/abs/1807.02261 · HTML: https://mlsanity.com/paper/1807.02261/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 6 Jul 2018.

## Built on by (most cited first, 3 of 3)

- [Unveiling the potential of large language models in generating semantic and cross-language clones](https://mlsanity.com/paper/2309.06424/) (2023)
- [A Systematic Review of Automated Query Reformulations in Source Code Search](https://mlsanity.com/paper/2108.09646/) (2021)
- [Code Sophistication: From Code Recommendation to Logic Recommendation](https://mlsanity.com/paper/2201.07674/) (2022)

## Abstract (arXiv)

Studies show that software developers often either misuse exception handling features or use them inefficiently, and such a practice may lead an undergoing software project to a fragile, insecure and non-robust application system. In this paper, we propose a context-aware code recommendation approach that recommends exception handling code examples from a number of popular open source code repositories hosted at GitHub. It collects the code examples exploiting GitHub code search API, and then analyzes, filters and ranks them against the code under development in the IDE by leveraging not only the structural (i.e., graph-based) and lexical features but also the heuristic quality measures of exception handlers in the examples. Experiments with 4,400 code examples and 65 exception handling scenarios as well as comparisons with four existing approaches show that the proposed approach is highly promising.
