Contract Usage and Evolution in Android Mobile Applications
- URL: http://arxiv.org/abs/2401.14244v1
- Date: Thu, 25 Jan 2024 15:36:49 GMT
- Title: Contract Usage and Evolution in Android Mobile Applications
- Authors: David R. Ferreira, Alexandra Mendes, and Jo\~ao F. Ferreira
- Abstract summary: We present the first large-scale empirical study on the presence and use of contracts in Android applications, written in Java or Kotlin.
We analyzed 2,390 Android applications from the F-Droid repository and processed more than 51,749 KLOC.
Our findings show that it would be desirable to have libraries that standardize contract specifications in Java and Kotlin.
- Score: 45.44831696628473
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Formal contracts and assertions are effective methods to enhance software
quality by enforcing preconditions, postconditions, and invariants. Previous
research has demonstrated the value of contracts in traditional software
development contexts. However, the adoption and impact of contracts in the
context of mobile application development, particularly of Android
applications, remain unexplored.
To address this, we present the first large-scale empirical study on the
presence and use of contracts in Android applications, written in Java or
Kotlin. We consider different types of contract elements divided into five
categories: conditional runtime exceptions, APIs, annotations, assertions, and
other. We analyzed 2,390 Android applications from the F-Droid repository and
processed more than 51,749 KLOC to determine 1) how and to what extent
contracts are used, 2) how contract usage evolves, and 3) whether contracts are
used safely in the context of program evolution and inheritance. Our findings
include: 1) although most applications do not specify contracts,
annotation-based approaches are the most popular among practitioners; 2)
applications that use contracts continue to use them in later versions, but the
number of methods increases at a higher rate than the number of contracts; and
3) there are many potentially unsafe specification changes when applications
evolve and in subtyping relationships, which indicates a lack of specification
stability. Our findings show that it would be desirable to have libraries that
standardize contract specifications in Java and Kotlin, and tools that aid
practitioners in writing stronger contracts and in detecting contract
violations in the context of program evolution and inheritance.
Related papers
- Codev-Bench: How Do LLMs Understand Developer-Centric Code Completion? [60.84912551069379]
We present the Code-Development Benchmark (Codev-Bench), a fine-grained, real-world, repository-level, and developer-centric evaluation framework.
Codev-Agent is an agent-based system that automates repository crawling, constructs execution environments, extracts dynamic calling chains from existing unit tests, and generates new test samples to avoid data leakage.
arXiv Detail & Related papers (2024-10-02T09:11:10Z) - Efficacy of Various Large Language Models in Generating Smart Contracts [0.0]
This study analyzes the application of code-generating Large Language Models in the creation of Solidity smart contracts on the immutable.
We also discovered a novel way of generating smart contracts through prompting new strategies.
arXiv Detail & Related papers (2024-06-28T17:31:47Z) - Specification Mining for Smart Contracts with Trace Slicing and Predicate Abstraction [10.723903783651537]
We propose a specification mining approach to infer contract specifications from past transactionhistories.
Our approach derives high-level behavioral automata of function invocations, accompanied byprogram invariants statistically inferred from the transaction histories.
arXiv Detail & Related papers (2024-03-20T03:39:51Z) - Formally Verifying a Real World Smart Contract [52.30656867727018]
We search for a tool capable of formally verifying a real-world smart contract written in a recent version of Solidity.
In this article, we present our search for a tool capable of formally verifying a real-world smart contract written in a recent version of Solidity.
arXiv Detail & Related papers (2023-07-05T14:30:21Z) - ConReader: Exploring Implicit Relations in Contracts for Contract Clause
Extraction [84.0634340572349]
We study automatic Contract Clause Extraction (CCE) by modeling implicit relations in legal contracts.
In this work, we first comprehensively analyze the complexity issues of contracts and distill out three implicit relations commonly found in contracts.
We propose a novel framework ConReader to exploit the above three relations for better contract understanding and improving CCE.
arXiv Detail & Related papers (2022-10-17T02:15:18Z) - Detecting Logical Relation In Contract Clauses [94.85352502638081]
We develop an approach to automate the extraction of logical relations between clauses in a contract.
The resulting approach should help contract authors detecting potential logical conflicts between clauses.
arXiv Detail & Related papers (2021-11-02T19:26:32Z) - CLAUSEREC: A Clause Recommendation Framework for AI-aided Contract
Authoring [7.3246387015020025]
We introduce the task of clause recommendation, as a first step to aid and accelerate the author-ing of contract documents.
We propose a two-staged pipeline to first predict if a specific clause type is relevant to be added in a contract, and then recommend the top clauses for the given type based on the contract context.
arXiv Detail & Related papers (2021-10-26T09:20:16Z) - ContractNLI: A Dataset for Document-level Natural Language Inference for
Contracts [39.75232199445175]
We propose "document-level natural language inference (NLI) for contracts"
A system is given a set of hypotheses and a contract, and it is asked to classify whether each hypothesis is "entailed by", "contradicting to" or "not mentioned by" (neutral to) the contract.
We release the largest corpus to date consisting of 607 annotated contracts.
arXiv Detail & Related papers (2021-10-05T03:22:31Z) - Profiling Gas Consumption in Solidity Smart Contracts [3.0378875015087567]
We propose GasMet, a suite of metrics for statically evaluating the code quality of a smart contract from the gas consumption perspective.
An experiment involving 2,186 smart contracts demonstrates that the proposed metrics have direct associations with deployment costs.
arXiv Detail & Related papers (2020-08-12T17:26:55Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.