Font Size: a A A

IO Example-based Code Search With Functional Semantics

Posted on:2022-02-05Degree:MasterType:Thesis
Country:ChinaCandidate:Z Z ChenFull Text:PDF
GTID:2518306725981139Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Nowadays,since computer technology becomes more and more popular,practitioners from all walks of life are beginning to develop codes.As the quantity of open source code accessible on the Internet grows,it has become an urgent need to implement an effective and efficient code search technique for developers to obtain and reuse existing open code source code.In most cases,searching for code through the traditional approach using search engines or code hosting platforms based on keywords ignores the functional semantics and logic of the code.Meanwhile,developers can turn to programming Q&A websites for help by asking for codes they need.This will need manually answering and require professionals to check the question and write answers,so there is a disadvantage of low real-time performance.In order to solve these problems and make code querying more accurate and fast,we propose an approach for IO example-based code search with functional semantics,named Quebio,and implement the corresponding tool.In coding stage,Quebio explores the executing paths of a program through symbolic execution,uses constraint templates to bypass the API invokations that symbolic execution can hardly handle,extracts the functional semantics and encodes them into the form of constraints.In the process of code query Quebio uses the IO examples,which is a lightweight query specification,to write query requests,and employs a three-step filtering approach based on method signature,keyword and constraint solving to improve the efficiency when screening candidate codes.We conducts an experiment to evaluate the effectiveness and efficiency of Quebio.Source code and query questions in the experiment are derived from real development environments to verify the practicability of Quebio.We constructed a repository of14792 methods from 723 distinct Java projects on Git Hub and applied the approach to resolve 47 queries extracted from Stack Overflow.As a result,Quebio found correct answers for 43 queries,with the average query time of only 213.2 seconds.It is obvious that Quebio is quite effective and efficient solving queries,which means it can replace traditional keyword search and manually answering to a certain extent.
Keywords/Search Tags:Code Search, Symbolic Execution, Constraint Solving
PDF Full Text Request
Related items