Test amplification enhances the effectiveness of existing tests. As software evolves, developers often manually amplify tests, which is tedious and time-consuming. Automated techniques have shown promise in addressing this challenge, while Large Language Models (LLMs) have demonstrated potential for test generation. However, empirical evidence of how developers amplify tests remains limited, and the effectiveness of these approaches has not yet been evaluated on a common dataset. To address this gap, we construct a dataset of 117 developer-amplified tests and characterize manual test amplifications. We amplify the corresponding original tests using DSpot (a tool) and ChatGPT (an LLM) and compare their effectiveness in terms of code and mutation coverage. We find that manual amplifications achieve modest improvements (mean line and branch: $0.74 \%$, mutation: $0.90 \%$). Method calls, inputs, expected outputs, and assertions are modified in $102,104,85$, and 65 tests, respectively. DSpot substantially outperforms developers in all metrics (mean line: $\mathbf{5 . 6 6 \%}$, branch: $\mathbf{4 . 1 3 \%}$, mutation: $\mathbf{4 . 4 4 \%}$). While ChatGPT outperforms both developers and DSpot in line (mean $8.91 \%$) and branch (mean 9.74%) coverage, it underperforms DSpot in mutation score (mean 3.20 %). These findings can guide the design of more effective and intelligent test amplification tools.
Library migration is the process of replacing a library with a similar one in a software project. Manual library migration is time consuming and error prone, as it requires developers to understand the Application Programming Interfaces (API) of both libraries, map equivalent APIs, and perform the necessary code transformations. Due to the difficulty of the library migration process, most of the existing automated techniques and tooling stop at the API mapping stage or support a limited set of libraries and code transformations. In this paper, we develop an end-to-end solution that can automatically migrate code between any arbitrary pair of Python libraries that provide similar functionality. Due to the promising capabilities of Large Language Models (LLMs) in code generation and transformation, we use LLMs as the primary engine for migration. Before building the tool, we first study the capabilities of LLMs for library migration on a benchmark of 321 real-world library migrations. We find that LLMs can effectively perform library migration, but some post-processing steps can further improve the performance. Based on this, we develop MigrateLib, a command line application that combines the power of LLMs, static analysis, and dynamic analysis to provide accurate library migration. We evaluate MigrateLib on 717 real-world Python applications that are not from our benchmark. We find that MigrateLib can migrate 32
Writing effective unit tests is often tedious, difficult, and time-consuming. Test recommendation techniques facilitate this process by recommending existing manually written tests from other similar systems for developers to reuse. However, developers still have to put non-trivial effort into modifying the recommended tests. For example, they have to understand vari-ous code elements in the recommended tests to accurately replace them with semantically similar code elements from the target system. In this paper, we propose JTESTMIGRATOR, a technique to automatically migrate unit tests between semantically similar methods across applications. Given a source and a target method with similar functionality across applications, where the source method has some unit tests, JTESTMIGRATOR migrates unit tests by transforming the test code. JTESTMIGRATOR uses semantic similarity and type compatibility of code elements in the source and target systems to transform test code. We implement JTESTMIGRATOR to migrate JUnit tests and evaluate it on 104 tests for 42 methods across 5 popular libraries. JTESTMIGRATOR successfully migrates 76 (73%) of the tests for 32 (76%) of the methods across the 5 libraries. 10 (13%) of the successfully migrated tests increase the code coverage of 4 target methods.
Regression testing is critical for maintaining software quality. Therefore, developers must maintain efficient and effective regression test suites. However, the task can be tedious and challenging, especially in Continuous Integration (CI) where developers frequently change code. With each code change, developers may need first to identify all relevant tests for the code change and then identify specific tests among the relevant tests that need to be modified. This process can reduce developers' productivity if they do this manually. Developers may also not modify test suites due to time constraints, resulting in inefficient and ineffective test suites. In this paper, we propose a technique and tool, TREC, that identifies relevant tests for code changes in CI and recommends tests to developers for modifications. TREC performs method and test co-evolution and method call analysis to identify and recommend tests for code changes. We evaluate the effectiveness of TREC by recommending tests for 1,699 developers' modified methods in 437 commits from three open-source Java projects. We find TREC's recommended tests include 2,886 (84.39%) of the 3,420 developers' modified tests for the 1,699 methods, indicating TREC's capability to successfully identify and recommend the majority of tests that need to be modified for the methods. Demo: https://www.youtube.com/watch?v=WgIveZuPDBU
Developers heavily rely on Application Programming Interfaces (APIs) from libraries to build their software. As software evolves, developers may need to replace the used libraries with alternate libraries, a process known as library migration. Doing this manually can be tedious, time-consuming, and prone to errors. Automated migration techniques can help alleviate some of this burden. However, designing effective automated migration techniques requires understanding the types of code changes required to transform client code that used the old library to the new library. This paper contributes an empirical study that provides a holistic view of Python library migrations, both in terms of the code changes required in a migration and the typical development effort involved. We manually label 3,096 migration-related code changes in 335 Python library migrations from 311 client repositories spanning 141 library pairs from 35 domains. Based on our labeled data, we derive a taxonomy for describing migration-related code changes, PyMigTax. Leveraging PyMigTax and our labeled data, we investigate various characteristics of Python library migrations, such as the types of program elements and properties of API mappings, the combinations of types of migration-related code changes in a migration, and the typical development effort required for a migration. Our findings highlight various potential shortcomings of current library migration tools. For example, we find that 40 program elements, while most library migration techniques typically assume that function calls from the source library will map into (one or more) function calls from the target library. As an approximation for the development effort involved, we find that, on average, a developer needs to learn about 4 APIs and 2 API mappings to perform a migration, and ... (truncated)
Unit tests play a critical role in improving software quality. However, writing effective unit tests from scratch is difficult and tedious. One way to reduce this difficulty is to recommend existing tests of semantically similar functions. However, modifying the recommended tests manually might still be difficult and tedious. For example, developers have to understand various code elements in the recommended tests to accurately replace them with semantically similar code elements from the target application. One way to mitigate the issue is by developing a test migration or reuse technique that could automatically transform the code elements in the recommended tests and migrate them to the target application. However, to develop such a technique, we first need to identify what types of code transformations are required to successfully migrate the recommended tests. Therefore, in this paper, we first recruit two external participants to create JTESTMIGBENCH, a benchmark of 510 manually migrated JUnit tests for 186 methods from five popular libraries. We then analyze the code changes in the migrated tests to create JTEsTMIGTAx, a taxonomy of test code transformation patterns. Our contributions provide the necessary foundations to develop automated unit test migration or reuse techniques.
Developers heavily rely on Application Programming Interfaces (APIs) from libraries to build their projects. However, libraries might become obsolete, or new libraries with better APIs might become available. In such cases, developers replace the used libraries with alternative libraries, a process known as library migration. Since manually migrating between libraries is tedious and error prone, there has been a lot of effort towards automated library migration. However, most of the current research on automated library migration focuses on Java libraries, and even more so on version migrations of the same library. Despite the increasing popularity of Python, limited research has investigated migration between Python libraries. To provide the necessary data for advancing the development of Python library migration tools, this paper contributes PYMIGBENCH, a benchmark of real Python library migrations. PYMIGBENCH contains 59 analogous library pairs and 75 real migrations with migration-related code changes in 161 Python files across 57 client repositories.
While Application Programming Interfaces (APIs) allow easier reuse of existing functionality, developers might make mistakes in using these APIs (a.k.a. API misuses). If an API usage specification exists, then automatically detecting such misuses becomes feasible. Since manually encoding specifications is a tedious process, there has been a lot of research regarding pattern-based specification mining. However, while annotations are widely used in Java enterprise microservices frameworks, most of these pattern-based rule discovery techniques have not considered annotation-based API usage rules. In this industrial case study of MicroProfile, an open-source Java microservices framework developed by IBM and others, we investigate whether the idea of pattern-based discovery of rules can be applied to annotation-based API usages. We find that our pattern-based approach mines 23 candidate rules, among which 4 are fully valid specifications and 8 are partially valid specifications. Overall, our technique mines 12 valid rules, 10 of which are not even documented in the official MicroProfile documentation. To evaluate the usefulness of the mined rules, we scan MicroProfile client projects for violations. We find 100 violations of 5 rules in 16 projects. Our results suggest that the mined rules can be useful in detecting and preventing annotation-based API misuses.
Frameworks and libraries provide functionality through Application Programming Interfaces (APis). Developers might misuse these APis, because their usage rules are often implicit, undocumented, or not readily available in the form of checkable rules. At the same time, manually writing usage rules for each API is time consuming. Therefore, researchers have proposed various techniques to automatically mine API usage rules. However, mined rules are not always accurate, resulting in false positives when used for misuse detection. To overcome these trade-offs, we combine rule mining and manual rule authoring approaches by creating a human-in-theloop API usage rule generation pipeline. Based on our industrial collaborator's needs, our work focuses on generating annotationbased API usage rules for MicroProfile, a framework designed for building microservices using Enterprise Java. We use a frequentitemset based pattern-mining technique to mine MicroProfile annotation usage rules and design a GUI-based rule validation tool (RVT) that allows experts to browse through the mined rules to validate (accept, edit, discard) them. Our pipeline then automatically generates checkable API usage rules from the confirmed rules, which can then be used to detect misuses or to enhance documentation. To assess the usefulness of having mined rules as a starting point for rule authoring and to assess the usability ofRVT in validating rules, we perform a user study with MicroProfile API experts.
This study aims to interpret the non-linear steady-state heat conduction for temperature-dependent thermal conductivity ($k$ ($T$)) using Element-Free Galerkin (EFG) method. In this present study, a one-dimensional heat conduction problem with uniform heat generation was explicated. Moving Least Squares (MLS) approximants were applied to estimate the unknown function of temperature $T$ ($x$) with $T^h$ ($x$) using linear basis and weight functions. The variational method has been used to develop discrete equations. Essential boundary conditions are enforced by using the Penalty method. The results have been obtained for the one-dimensional model using essential MATLAB codes. The results obtained by the EFG method are compared with the analytical and finite-element method results. The results are also studied by increasing the number of nodes to study the convergence which indicated that EFG has good convergence behavior. The results have also been obtained for different values of the scaling parameter ($α_s$) and any values of αs between 1.8 and 2.0 were found suitable for providing better results in the EFG method.
: Limestone being sedimentary rock contains multiple bedding planes, which has vertical cracks or joints. As explosives apply high dynamic loading rate during blasting i.e. rock fragmentation & comminution process, the measure of critical SIF (stress intensity factor) is pertinent to be measured and is known as dynamic fracture toughness of limestone. In order to investigate the influence of several factors on the mode-I fracture toughness and fracture behavior of limestone, dynamic fracture toughness tests (mode-I) were conducted under various conditions of loading rate. The microstructure of rocks was also investigated to understand the dynamic fracture toughness and fracture mechanism of limestone. This paper deals with results of 11 limestone specimen subjected to dynamic fracture toughness tests. It was observed that crack surface velocity increases with increase in dynamic fracture toughness. The fracture velocity also increases with increase in dynamic fracture toughness. The fracture velocity in limestone increases between 1.14-5.09 times with increased fracture toughness. The crack surface velocity of limestone increases between 1.39-3.09 times with increase in dynamic fracture toughness.
Understanding the adoption and usage of any programming language feature is crucial for improving it. Existing studies indicate that Java annotations are widely used by developers. However, there is currently no empirical data on annotation usage in Android apps. Android apps are often smaller than general Java applications and typically use Android APIs or specific libraries catered to the mobile environment. Therefore, it is not clear if the results of existing Java studies hold for Android apps. In this paper, we investigate annotation practices in Android apps through an empirical study of 1,141 open-source apps. Using previously studied metrics, we first compare annotation usage in Android apps to existing results from general Java applications. Then, for the first time, we study why developers declare custom annotations. Our results show that the density of annotations and the values of various other annotation metrics are notably less in Android apps than in Java projects. Additionally, the types of annotations used in Android apps are different than those in Java, with many Android-specific annotations. These results imply that researchers may need to distinguish mobile apps while performing studies on programming language features. However, we also found examples of extreme usage of annotations with, for example, a large number of attributes, as well as a low adoption rate for most annotations. By looking at such results, annotation designers can assess adoption patterns and take various improvement measures, such as modularizing their offered annotations or cleaning up unused ones. Finally, we find that developers declare custom annotations in different apps but with the same purpose, which presents an opportunity for annotation designers to create new annotations.
Embedded software developers assume the behavior of the environment when specifications are not available. However, developers may assume the behavior incorrectly, which may result in critical faults in the system. Therefore, it is important to detect the faults caused by incorrect assumptions. In this letter, we propose a log-based testing approach to detect the faults. First, we create a UML behavioral model to represent the assumed behavior of the environment, which is then transformed into a state model. Next, we extract the actual behavior of the environment from a log, which is then incorporated in the state model, resulting in a state model that represents both assumed and actual behaviors. Existing testing techniques based on the state model can be used to generate test cases from our state model to detect faults.
This study presents Numerical modeling and Experimental analysis of enhancement of gas-side convective heat transfer coefficient of plain fire-tube boiler using turbulators. Insertion of twisted tape and coil wire turbulators served to arrest the thermal boundary layer formation on the 2nd and 3rd pass of the 3-pass fire tube boiler by preventing transition of hot flue gases from turbulent to laminar region and sustaining gaseous turbulence intact. This increased the pumping power inside the tubes, but the enhancement achieved by integrating turbulators exceeded the increment in friction factor by great extent. The geometry of the heat exchangers was constructed in CATIA® v5R20 and the meshing was performed in ICEM CFD 17.0. The computational simulation was carried out by ANSYS® CFX 17.0 solver using Finite Element Approach. For experimental verification, experimental testing procedure with equipment was established. The results from CFD showed 1.26-1.78 times enhancement in heat transfer for twisted tape turbulators and 1.17-1.93 for coil wire turbulators. Similarly, the experimental results depicted 1.2-1.83and 1.32-2.08-times augmentation for twisted tape and coil wire turbulators respectively. The reduction in stack temperatures for twisted tape and coil wire turbulators were found to be 73°C and 117°C respectively. The combined effects of enhancement of heat transfer and reduction in stack losses was observed as 3.4% and 5.7% increment in energy efficiency for twisted tape and coil wire turbulators respectively. Consequently, the evaporation ratio for conventional plain fire tube boiler increased from 13.39 to 13.96 for twisted tape turbulators and 14.34 for coil wire turbulators using diesel fuel.
In deep underground rock engineering projects, rocks are under static pre-load and they may further experience dynamic load due to earthquakes or production blasts. It is thus desirable to consider dynamic failure of rocks subjected to static pre-load. Besides, bending load is commonly encountered near underground openings. Therefore, this study considers the effect of the pre-load on the dynamic bending strength of Laurentian granite (LG). Using a modified split Hopkinson pressure bar system, the semi-circular bend (SCB) method is applied to carry out the bending tests. Five groups of SCB specimens are tested under different pre-loads and loading rates. The results show that under a given pre-load, the flexural tensile strength of LG increases with the loading rate, and decreases with the static pre-load at a given loading rate. The total flexural tensile strength is roughly independent of the pre-load. An empirical equation is used to represent the effects of the loading rate and the pre-load force on the dynamic flexural tensile strength. Furthermore, the flexural tensile strengths measured from SCB tests have higher values than the tensile strengths measured using the Brazilian disc method for the same rock. A nonlocal failure theory is utilized to quantitatively interpret this discrepancy.
Android platform provides a unique framework for app development. Failure to comply with the framework may result in serious bugs. Android platform is also evolving rapidly and developers extensively use APIs provided by the framework, which may lead to serious compatibility bugs if developers do not update the released apps frequently. Furthermore, Android apps run on a wide range of memory-constrained devices, which may cause various device-specific and memory-related bugs. There are several other Android-specific issues that developers need to address during app development and maintenance. Failure to address the issues may result in serious bugs manifested as crashes. In this paper, we perform an empirical study to investigate and characterize various Android-specific crash bugs, their prevalence, root causes, and solutions by analyzing 1,862 confirmed crash reports of 418 open source Android apps. The investigation results can help app developers in understanding, preventing, and fixing the Android-specific crash bugs. Moreover, the results can help app developers and researchers in designing effective bug detection tools for Android apps.
Android platform is evolving rapidly. Therefore, evolution and maintenance of Android apps are major concerns among developers. One of the essential components of each app is an Android manifest file, which is a configuration file used to declare various key attributes of apps. This paper presents an empirical study to understand app evolution through configuration changes. The results of this study will help developers in identifying change-proneness attributes, including change patterns and the reason behind the change, understanding the adoption of different attributes introduced in different versions of the Android platform, and understanding effort distribution pattern in configuration changes and taking proactive measures to reduce the effort. In this paper, we use a data mining approach. We analyze commit histories of Android manifest files of 908 apps to understand the app evolution. The results of this study show that most of the apps extend core functionalities and improve user interface over time, configuration changes are mostly influenced by functionalities extension, platform evolution, and bug reports, very few numbers of existing apps adopt new attributes introduced by the platform, apps are generally slow in adopting new attributes, and significant effort is wasted in changing configuration and then reverting back the change. (C) 2019 Elsevier Inc. All rights reserved.
Integrating high photovoltaic (PV) on distribution grid system has a positive impact by significantly reducing the losses and improving the voltage profile at the same time reducing the pollution of the environment However, integrating high proportions of PV in the distribution grid can bring the grid to its operational limits and result in power quality issues. The maximum PV capacity that can be integrated without incurring any grid impacts is referred to as the PV hosting capacity of the grid. This paper intends to evaluate the hosting capacity of solar PV in Dodhara-Chandani (DoC) distribution feeder as one of the feeder of Integrated Nepal Power System (INPS), considering grid parameters and operating condition in Nepal. Three main criteria were investigated for determining the hosting capacity of PV; reverse power flow, maximum voltage deviation of feeder and current carrying limit of conductor. The analysis has been performed by means of static load-flow simulation in Electrical Transient & Analysis Program (ETAP) and coding in MATLAB R2017a. The study shows that PV of rated capacity 687kWp can be installed at a point of interconnection (POI) whereas an optimal placement of solar PV is found to be at 18th node (in between starting and end of the feeder) considering minimum system losses. The minimum voltage profile at end of the feeder has improved by 8 % while the active power loss reduction of network has reduced by 83.6 % after the integration of solar PV. The results indicate voltage at different buses and the ampacity of most of the conductors have been improved after the integration of PV system into DoC feeder.
Android apps are generally developed by an individual developer or a small team of developers, and the developers may not have experience of testing Android apps or they may not have experience of testing any software systems. Furthermore, even an individual that does not have a basic knowledge of Android can build Android apps using various app generator tools available in the market. In this environment, apps may not get tested at all or developers may not prioritize the testing activities, which may result in low-quality or error-prone apps. Eventually, users may give negative reviews to the apps or they may abandon the apps due to bugs. Therefore, instead of designing and writing new test cases, developers need tools and techniques that can automatically test their apps by utilizing the test cases of existing apps. It will not only help novice app developers in testing their apps but also help experience app developers in reducing time and effort to test their apps. In this paper, we propose a framework for testing Android apps by reusing test cases. The framework leverages test cases and domain knowledge of existing open-source Android apps to test new Android apps.
The design and synthesis of organic molecules having aggregation induced emission (AIE) property has been a prime area of research in recent years. In this regard, we have synthesized new pyranone based AIEgens with interesting photophysical properties. The synthesized donor-acceptor based pyranones 3 and 4a-d show multicolour emission in the range of 476-585 nm in solid state. The compound 3 also showed blue emission (485 nm) in DMSO solution and surprisingly exhibits orange emission (572 nm) with remarkable bathochromic shift in 99% water in DMSO due to AIE characteristics. The detailed study of AIE behaviour of 3 was carried out in increasing fraction of water (0-99%) in THF, the intensity of emission at 485 nm gradually increased upto 80% of water and then decreased at 90% water. Interestingly, the THF solution of 3 in 99% water showed remarkable bathochromic shift (similar to 100 nm) of emission maximum from blue (lambda(max) 485 nm) to orange region (lambda(m)(ax) 585 nm) due to formation of nano-aggregates leading to restriction in intramolecular rotation (RIR). The time-correlated single photon counting (TCSPC) analysis of 3 in the water-THF (99:1) mixture showed an average lifetime of 4.8 ns for these nano-aggregates. The pyrrolyl-pyranone 3 having Solution-Solid Dual Emissive (SSDE) characteristics may be utilized in exploring its application in both biomedical and material research fields.