Natural Language Code Search Service Integration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software developers face challenges in finding relevant source code snippets efficiently, as existing tools often require switching between development environments and external resources, lacking comprehensive capabilities for completing programming tasks without leaving the development tool.
Innovation Solution
A natural language code search service that combines search engine and neural model-generated code snippets to provide idioms and frequently-used code patterns, using data mining techniques to detect and rank high-quality code snippets based on type usage and method/API invocations, enhancing the quality and relevance of search results.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If developers use existing software development tools, then they have basic code writing capabilities, but they cannot find relevant code snippets efficiently without switching to external resources
Solution Approach 1:
The patent combines multiple code search sources (search engine results, neural model-generated code, frequent subtree mining results) into a unified search service that integrates directly within the development tool, eliminating the need to switch between external resources and reducing search time
2Reliability
If developers review multiple external resources for code snippets, then they may find relevant code, but they spend considerable time switching between tools and resources
Solution Approach 1:
The patent segments the code search process into distinct components (search engine provider, neural model provider, frequent subtree mining) that operate in parallel and contribute different types of code snippets, which are then integrated and ranked to provide comprehensive yet efficient search results
Solution Approach 2:
The system performs preliminary actions by pre-generating code snippets through neural models and frequent subtree mining before the actual search query, so that when a developer searches, relevant code is already prepared and immediately available, reducing wait time
3Adaptability or versatility
If developers use online documentation and forums for code information, then they can find usage examples, but they lack integrated capabilities within the development tool
Solution Approach 1:
The patent creates a universal code search service that can handle multiple types of code information needs (usage examples, implementation patterns, frequent idioms) through a single integrated interface within the development tool, replacing the need to switch between documentation, forums, and code repositories
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A natural language code search service provides idioms or frequently-occurring code patterns for a code fragment based on similar type usage and method/API invocation usage. The search service uses a data mining technique that mines code snippets found from various websites and code snippets generated from a neural model to detect idioms in the code snippets that were previously unknown and which can be reused. A search is initiated through a natural language query within a code development tool or application thereby avoiding the need to switch out of the current application to perform the search.