Code Recommendation for Open Source Software Developers

Yiqiao Jin, Yunsheng Bai, Yanqiao Zhu, Yizhou Sun, Wei Wang

TL;DR

CODER is a novel graph-based recommendation framework designed to match Open Source Software (OSS) developers with specific code files they are likely to contribute to. By fusing deep code semantics (via CodeBERT) with project hierarchical structures and multi-level user behaviors (like starring or forking), it significantly outperforms traditional recommendation models, especially in "cold-start" scenarios where a developer is new to a project.

What Problem Does This Paper Address?

The Open Source Software ecosystem is massive—GitHub alone hosts over 200 million repositories. This creates a "needle in a haystack" problem: developers struggle to find meaningful tasks that match their expertise, while project maintainers find it difficult to recruit competent contributors.

Existing recommendation systems fall short in the OSS domain for three reasons:

  1. Multimodal Complexity: OSS data isn't just a user-item matrix; it involves code text, file hierarchies (directories), and different types of interactions (committing code vs. starring a repo).
  2. Extreme Sparsity: Most developers only contribute to a tiny fraction of available files, making traditional collaborative filtering inaccurate.
  3. Structural Blindness: Traditional models treat files as independent items, ignoring the fact that files in the same directory (e.g., models/ or utils/) often share functional and semantic similarities.

Methods

The authors introduce CODER (COde DEveloper Recommendation), which operates through three main components:

  • Node Semantics Modeling: Instead of just looking at file names, CODER uses CodeBERT to encode the actual source code. Crucially, it employs a code-user modality fusion strategy. This uses a co-attention mechanism to blend code features with the "expertise profiles" of historical contributors, recognizing that a file’s "flavor" is defined both by its logic and by the people who maintain it.
  • Structural-level Aggregation: Projects are modeled as hierarchical graphs. CODER uses Graph Attention Networks (GAT) to propagate information from files up to directories and the root repository. This allows a file to "inherit" context from its neighbors in the file tree.
  • Multi-behavioral Modeling: The system jointly models "microscopic" interactions (direct commits to a file) and "macroscopic" interactions (starring or watching a project). By using a LightGCN-style propagation, the model learns that a user’s interest in a project (macro) is a strong signal for their potential contribution to specific files (micro).

To handle data sparsity, the authors also incorporate structure-contrastive learning, forcing the model to learn similar representations for users and items that share structural neighborhoods.

Datasets

Because no standard benchmark existed for this specific task, the authors curated three large-scale datasets from GitHub, categorized by topic:

  • ML (Machine Learning): 239k files, 21k users, 663k interactions.
  • FS (Fullstack): 568k files, 51k users, 1.5M interactions.
  • DB (Database): 415k files, 30k users, 1.9M interactions.

These datasets are significantly larger and more diverse than previous software-related recommendation benchmarks, which often focused on single languages or smaller scales.

Key Insights and Ideas

  • The "Who" defines the "What": One of the most interesting "aha" moments is the modality fusion. The authors argue that a developer's contribution "injects" their expertise into a file. Therefore, matching a new developer to a file is as much about matching them to the previous contributors as it is about the code itself.
  • Hierarchy as a Knowledge Transfer Tool: By modeling the file tree, the model can recommend files in a new project to a developer if that project's structure mirrors one they have worked on before (e.g., similar naming conventions in transformers vs. roberta repositories).
  • Macro-Signals Solve Cold-Starts: For a "cold-start" developer who hasn't committed code yet, their "stars" and "watches" act as a vital bridge, allowing the model to narrow down their interests from millions of files to a specific project sub-tree.

Key Results

CODER was tested against several state-of-the-art baselines, including LightGCN and NCL (Neighborhood-enriched Contrastive Learning).

  • Superior Performance: CODER outperformed the best baseline (NCL) by 17.9% on NDCG@20 for the ML dataset and a staggering 37.1% on NDCG@5 for the Fullstack dataset.
  • Cold-Start Success: In scenarios where users had two or fewer prior interactions, CODER showed improvements of up to 53% over baselines, proving that its multimodal approach effectively compensates for missing history.
  • Ablation Studies: The results showed that Project-level aggregation (modeling stars/watches) was the most critical component for performance, followed closely by the Structural-level aggregation (the file tree).

Limitations and Future Work

  • Existing Files Only: Currently, CODER only recommends contributions to existing files. It cannot suggest that a developer create a brand-new file or subdirectory.
  • Granularity: The model treats files as the smallest unit. Future work could look at recommending specific functions or classes within a file using Abstract Syntax Trees (ASTs).
  • Social Dynamics: While the model uses developer-file-project links, it doesn't yet account for direct developer-to-developer social networks (e.g., following other experts), which could further refine expertise matching.

Summary updated

BibTeX
@inproceedings{jin2023code,
  author = {Yiqiao Jin and Yunsheng Bai and Yanqiao Zhu and Yizhou Sun and Wei Wang},
  title = {{Code Recommendation for Open Source Software Developers}},
  booktitle = {The Web Conference},
  year = {2023},
  doi = {10.1145/3543507.3583503},
}
Figure