api usage patterns have been considered as significant materials in reusing software library apis for saving development time and improving software quality. Although efforts have been made on discovering and searchin...
详细信息
api usage patterns have been considered as significant materials in reusing software library apis for saving development time and improving software quality. Although efforts have been made on discovering and searching api usage patterns, the following two issues are still largely unexplored: how to provide a well-organised view of the discovered api usage patterns? and how to recommend follow-up api usage patterns once a usagepattern is adopted? This paper proposes two methods for categorizing and recommending api usage patterns: first, categories of the usagepatterns are automatically identified based on a proposed degree centrality-based clustering algorithm;and second, follow-up usagepatterns of an adopted pattern are recommended based on a proposed metric of measuring distances between patterns. In the experimental evaluations, the patterns categorization can achieve 85.4% precision rate with 83% recall rate. The patterns recommendation had approximately half a chance of correctly predicting the follow-up patterns that were actually used by the programmers.
Calling Application Programming Interfaces (apis) shall follow various constraints (e.g., call orders). If these constraints are violated, api misuses are introduced to code, and such misuses can cause severe bugs. To...
详细信息
ISBN:
(纸本)9781665437844
Calling Application Programming Interfaces (apis) shall follow various constraints (e.g., call orders). If these constraints are violated, api misuses are introduced to code, and such misuses can cause severe bugs. To effectively detect api misuses, most prior approaches mine constraints from client code, and assume that the violations of constraints are potential misuses. However, as client code only illustrates a small portion of apiusages, constraints mined from client code are typically incomplete. As a result, when mined constraints are used to detect bugs, many violations of constraints turn out to be false positives. In this paper, our research purpose is to find more misuses and to reduce false positives. As library code contains many details on apis, we propose an approach that mines api constraints from both client and library code. From client code, our approach builds apiusage graphs and uses a frequent subgraph mining algorithm to mine frequent usagepatterns as api constraints. From library code, our approach derives various types of constraints with our predefined strategies. With constraints from both sources, our graph matching algorithm can detect api misuses. As a result, our approach takes advantage from both the comprehensiveness and informativeness of library-based constraints and the accuracy of client-based patterns. We compared our approach with MuDetect on the MuBench dataset. Our results show that it significantly improves the detection effectiveness of MuBench from 39.5% to 50.2% of the recall, and from 30.6% to 41.7% of the precision.
Programmers often consult Q&A websites such as Stack Overflow(SO) to learn new apis. However, online code snippets are notalways complete or reliable in terms of apiusage. To help program-mers assess online code ...
详细信息
ISBN:
(纸本)9781450355735
Programmers often consult Q&A websites such as Stack Overflow(SO) to learn new apis. However, online code snippets are notalways complete or reliable in terms of apiusage. To help program-mers assess online code snippets, we build a Chrome-extension, EXAMPLECHECKTHAT detects apiusage violations in SO posts usingapi usage patterns mined from 380K GitHub projects. It quantifies how many GitHub examples follow common apiusage and illustrates how to remedy the detected violation in a given SO snippet. With EXAMPLECHECK, programmers can easily identify the pitfalls of a given SO snippet and learn how much it deviates from common api usage patterns in GitHub. The demo video is at http://***/WOnN-wQZsH0.
Automatically generating code from natural language query is a very promising but much challenging direction. Existing approaches either try to generate the whole code or only predict a small part of critical code ele...
详细信息
ISBN:
(纸本)9781728119700
Automatically generating code from natural language query is a very promising but much challenging direction. Existing approaches either try to generate the whole code or only predict a small part of critical code elements such as api sequence. Meanwhile, api usage patterns, including apis and api-related control-flow statements, have the moderate complexity, but can provide enough code framework information and are very helpful for developers to implement various functionalities. Therefore, in this work, we study the problem of generating api usage patterns, represent api usage patterns by one special constrained tree api-MCTree and design one new api-MCTree decoder for automatically transforming natural language queries to api usage patterns, which can leverage both the difference of control-flow statement types and the syntactic knowledge of api usage patterns. We evaluate our model with annotated code snippets in real Java projects collected from GitHub, and the experimental results show that our approach is effective and outperforms the related approaches.
Although efforts have been made on discovering and searching api usage patterns, how to categorize and recommend follow-up api usage patterns is still largely unexplored. This paper advances the state-of-the-art by pr...
详细信息
ISBN:
(纸本)9781509034383
Although efforts have been made on discovering and searching api usage patterns, how to categorize and recommend follow-up api usage patterns is still largely unexplored. This paper advances the state-of-the-art by proposing two methods for categorizing and recommending api usage patterns: first, categories of the usagepatterns are automatically identified based on a proposed degree centrality-based clustering algorithm;and second, follow-up usagepatterns of an adopted pattern are recommended based on a proposed metric of measuring distances between patterns. In the experimental evaluations, the patterns categorization can achieve 85.4% precision rate with 83% recall rate. The patterns recommendation had approximately half a chance of correctly predicting the follow-up patterns that were actually used by the programmers.
Considerable effort has gone into the discovery of api usage patterns or examples. However, how to enable programmers to search for discovered apiusage examples using natural language queries is still a significant r...
详细信息
Considerable effort has gone into the discovery of api usage patterns or examples. However, how to enable programmers to search for discovered apiusage examples using natural language queries is still a significant research problem. This paper presents an approach, referred to as Codepus, to facilitate the discovery of apiusage examples based on mining comments in open source code while permitting searches using natural language queries. The approach includes two key features: api usage patterns as well as multiple keywords and tf-idf values are discovered by mining open source comments and code snippets;and a matchmaking function is devised for searching for apiusage examples using natural language queries by aggregating scores related to semantic similarity, correctness, and the number of apis. In a practical application, the proposed approach discovered 43,721 api usage patterns with 641,591 apiusage examples from 15,814 open source projects. Experiment results revealed the following: (1) Codepus reduced the browsing time required for locating apiusage examples by 46.5%, compared to the time required when using a web search engine. (2) The precision of Codepus is 91% when using eleven real-world frequently asked questions, which is superior to those of Gists and Open Hub.
Learning to use existing or new software libraries is a difficult task for software developers, which would impede their productivity. Much existing work has provided different techniques to mine api usage patterns fr...
详细信息
ISBN:
(纸本)9781538615898
Learning to use existing or new software libraries is a difficult task for software developers, which would impede their productivity. Much existing work has provided different techniques to mine api usage patterns from client programs in order to help developers on understanding and using existing libraries. However, this techniques produce incomplete patterns, i.e., without temporal properties, or simple ones. In this paper, we propose a new formulation of the problem of api temporal pattern mining and a new approach to solve it. Indeed, we learn complex temporal patterns using a genetic programming approach. Our preliminary results show that across a considerable variability of client programs, our approach has been able to infer non-trivial patterns that reflect informative temporal properties.
Mobile devices are an inseparable part of modern era. Smartphones are used for various purposes in our daily life, such as- making calls, sending and receiving emails, listening to music, taking photos, reading books,...
详细信息
Mobile devices are an inseparable part of modern era. Smartphones are used for various purposes in our daily life, such as- making calls, sending and receiving emails, listening to music, taking photos, reading books, booking tickets, etc. Hundreds of apps, countless tasks and lots of processing power with improved user experience is a common trend for every smartphone. But the issue of battery life is struggling to keep up with the improvement of processor, memory, storage and other hardwares. However, excessive energy consumption of apps in mobile devices due to bad programming practices, inefficient api usage patterns or energy greedy hardware can significantly reduce battery life. Moreover multitasking ca- pability of smartphones have opened up a new dimension to its users. Frequent switching between apps often cause previously used apps to run in idle mode either in foreground or in background. In this thesis an analysis has been done to measure the energy cost of api methods called by an application during execution in idle states. The experiments were conducted on ten android apps from different domains. For energy consumption measure- ments of these apps on the device Greenspector software tool is used, as this thesis work is conducted collaboratively between Universit´ e de Lorraine and Greenspector. Based on the collected data from application's energy consumption measurements, an analysis has been done on api calls invoked by the application during execution and its impact on the device to find anomalies in order to reduce platform discharge. Finally, the work is summarised by providing a reference ranking to developers regarding energy consumption of certain cate- gories of Android apis.
Mobile devices are an inseparable part of modern era. Smartphones are used for various purposes in our daily life, such as- making calls, sending and receiving emails, listening to music, taking photos, reading books,...
详细信息
Mobile devices are an inseparable part of modern era. Smartphones are used for various purposes in our daily life, such as- making calls, sending and receiving emails, listening to music, taking photos, reading books, booking tickets, etc. Hundreds of apps, countless tasks and lots of processing power with improved user experience is a common trend for every smartphone. But the issue of battery life is struggling to keep up with the improvement of processor, memory, storage and other hardwares. However, excessive energy consumption of apps in mobile devices due to bad programming practices, inefficient api usage patterns or energy greedy hardware can significantly reduce battery life. Moreover multitasking ca- pability of smartphones have opened up a new dimension to its users. Frequent switching between apps often cause previously used apps to run in idle mode either in foreground or in background. In this thesis an analysis has been done to measure the energy cost of api methods called by an application during execution in idle states. The experiments were conducted on ten android apps from different domains. For energy consumption measure- ments of these apps on the device Greenspector software tool is used, as this thesis work is conducted collaboratively between Universit´ e de Lorraine and Greenspector. Based on the collected data from application's energy consumption measurements, an analysis has been done on api calls invoked by the application during execution and its impact on the device to find anomalies in order to reduce platform discharge. Finally, the work is summarised by providing a reference ranking to developers regarding energy consumption of certain cate- gories of Android apis.
EKEKO is a Clojure library for applicative logic meta-programming against an Eclipse workspace. EKEKO has been applied successfully to answering program queries (e.g., "does this bug pattern occur in my code?&quo...
详细信息
ISBN:
(纸本)9781479937523
EKEKO is a Clojure library for applicative logic meta-programming against an Eclipse workspace. EKEKO has been applied successfully to answering program queries (e.g., "does this bug pattern occur in my code?"), to analyzing project corpora (e.g., "how often does this api usage pattern occur in this corpus?"), and to transforming programs (e.g., "change occurrences of this pattern as follows") in a declarative manner. These applications rely on a seamless embedding of logic queries in applicative expressions. While the former identify source code of interest, the latter associate error markers with, compute statistics about, or rewrite the identified source code snippets. In this paper, we detail the logic and applicative aspects of the EKEKO library. We also highlight key choices in their implementation. In particular, we demonstrate how a causal connection with the Eclipse infrastructure enables building development tools interactively on the Clojure read-eval-print loop.
暂无评论