Genome-wide association studies (GWAS) often find association signals between many genetic variants and traits of interest in a genomic region. Functional annotations of these variants provide valuable prior information that helps prioritize biologically relevant variants and enhances the power to detect causal variants. However, due to substantial correlations among these variants, a critical question is how to rigorously control the false discovery rate while effectively leveraging prior knowledge. We introduce annotation-informed knockoffs (AnnoKn), a knockoff-based method that performs annotation-informed variable selection with strict control of the false discovery rate. AnnoKn integrates the knockoff procedure with adaptive Lasso regression to evaluate the importance of multiple covariates while incorporating functional annotation information within a unified Bayesian framework. To facilitate real-world applications where individual-level data are not accessible, we further extend AnnoKn to operate on summary statistics. Through simulations and real-world applications to GTEx and GWAS datasets, we show that AnnoKn achieves superior power in detecting causal genetic variants compared with existing annotation-informed variable selection methods, while maintaining valid control over false discoveries.
As deep learning (DL) software becomes more widely employed, there is a growing demand for robust debugging techniques to enhance its quality and reliability. Due to the data-driven paradigm of DL software, data plays a fundamental role throughout its lifecycle, whose errors have received far less attention than program and model errors, which can also degrade model performance. Existing data debugging methodologies primarily focus on the software development phase, mainly overlooking the subsequent software iterations. Given the inherent characteristics of DL software, these iterative processes often include model fine-tuning, in which fine-tuning data would be central element in determining the performance of fine-tuned DL software. Moreover, the finetuning datasets may be extracted from the application context with unavoidable noise or other interference factors that cause DL software defects. Despite the significance of fine-tuning data, there is currently little research specifically focused on the debugging of fine-tuning data. In this paper, we propose a new set of change metrics based on the runtime information collected during pretraining and fine-tuning processes, which contains two aspects: Descriptive Statistics Difference Metrics (DSDM) and Multidimensional Data Comparison Metrics (MDCM). Our critical insight is that some changes in data captured during pretraining and fine-tuning processes may be related to bugs in the fine-tuning data. We build predictive models using five learners separately with our change metrics on six datasets and 233 DL models. The results indicate that (a) our change metrics are more effective than the baseline in fault diagnosis for fine-tuning data; (b) in most cases, using DSDM and MDCM together is more effective than using them separately; (c) the time cost of our approach primarily depends on the model training process, which is generally acceptable overall.
Machine Learning (ML) software employs statistical algorithms to perform high-stake tasks in our daily lives, whose results are usually discriminatory due to protected features (e.g., gender), i.e., one part (called privileged, e.g., male) may be more likely to obtain beneficial decisions than the other part (called unprivileged, e.g., female). In alleviating the unfairness, developers have obtained widely held beliefs about the tradeoff between performance and fairness for ML software. Surprisingly, recent research on feature engineering suggests that enlarging the feature set is the perfect way to kill two birds with one stone, i.e., achieving both higher performance and fairness. However, the experiments used in the prior study did not remove the effect of protected features, which have been suggested to be excluded in both industrial applications and academic studies. As a result, the study did not fully explore the tradeoff between performance and fairness. In this article, we first conduct an empirical study to replicate this prior study after excluding the protected features and observe that there is still a tradeoff between performance and fairness with enlarging the features, i.e., more features are not perfect, which would lead to higher performance and lower fairness. Due to more features causing more collection and pre-processing budgets, we aim to search for an effective alternative. Inspired by the "less is more" principle, we propose a novel feature ranking method, Hybrid-importance and Early-validation based Feature Ranking (HEFR), to find an efficient subset to replace the full feature set with comparable performance and fairness. Our method, HEFR, employs hybrid feature importances to combine performance and fairness and conducts early validation to check the effectiveness of hybrid importances. We conduct experiments on seven datasets and three classifiers to evaluate our method with five baselines. The results have shown that (a) HEFR is efficient for ML software feature engineering: applying HEFR to choose about 10% of features would construct ML software with better or comparable performance and fairness, and (b) HEFR is actionable with small dataset sizes: applying HEFR with only 10% data size would still help choose the proper feature subset.
Context: Along with developing Deep learning (DL) models, larger datasets and more complex model structures are applied, leading to rising computing resources and energy consumption, which is an alert that green DL models should receive more attention. Objective: This paper focuses on a novel view to analyze DL energy consumption: the effect of hyperparameters on the energy cost of DL models. Method: Our approach involves using mutation operators to simulate how practitioners adjust hyperparameters, such as epochs and learning rates. We train the original and mutated models separately and gather energy information and run-time performance metrics. Moreover, we focus on the parallel scenario where multiple DL models are trained in parallel. Results: To examine the effect of hyperparameters on energy consumption, we conducted extensive experiments on five real-world DL models. The results show that (1) many hyperparameters studied have a (positive or negative) correlation with energy consumption, (2) adjusting hyperparameters can make DL models greener, i.e., lead to less energy consumption without performance damage, and (3) in a parallel environment, energy consumption becomes more susceptible to change. Conclusions: We suggest that hyperparameters need more attention in developing DL models, as appropriately adjusting hyperparameters would cause green DL models.
Context: Deep neural networks (DNNs) have demonstrated outstanding performance in computer vision, speech recognition, and malware detection. However, these models face severe risks from backdoor attacks when deployed in safety-critical tasks. Backdoor attacks inject poisoned data during the training process, causing the model to output an attacker-specified target label when specific trigger conditions appear, posing a serious threat to system reliability and security. Although many studies have proposed various defense methods, most overlook the importance of accurately identifying the attacked class. Accurate identification of the attacked class helps optimize the poisoned sample filtering process and significantly enhances overall defense effectiveness, making it a key challenge in backdoor defense research. Objective: This study proposes a novel backdoor defense method that accurately identifies the attacked class without prior knowledge of the trigger condition or the attacked class, thereby optimizing training data selection and enhancing overall defense performance. Method: We propose the Mutation-based Test for Deep Learning Backdoor Defense (MutDBD) framework. The framework consists of three core steps: (1) Model Mutation: Generate a set of mutated models from the backdoor model; (2) Class Ranking: Rank classes according to the prediction behavior of the poisoned training data across the mutated models to identify the attacked class; (3) Defense Training: Use class ranking to guide training set selection and retrain the backdoor model with filtered data to obtain the final defense model. Results: Experiments are conducted on CIFAR-10, GTSRB, and an ImageNet subset, using three model architectures and four representative backdoor attack methods, resulting in 32 experimental scenarios. The results indicate that MutDBD performs well in defense across these scenarios. We evaluate its effectiveness using three key metrics: the number of poisoned samples in the selected set (PN), the attack success rate (ASR), and the clean accuracy (ACC). Specifically, in most scenarios, MutDBD significantly outperforms baselines on PN and ASR metrics, while its ACC metric remains highly competitive. Conclusion: MutDBD reveals a biased prediction phenomenon in poisoned training sets for mutated models and introduces a class-ranking-based defense strategy. The framework offers a novel perspective for backdoor defense, effectively mitigating attack success rates while maintaining the model’s normal performance.
The evolution (e.g., development and maintenance) of deep learning (DL) models has attracted much attention. One of the main challenges during the development and maintenance of DL models is model training, which often requires a lot of human resources and computing power (such as labeling costs and parameter training). In recent years, to alleviate this problem, researchers have introduced the idea of software engineering (SE) into DL. Researchers consider the DL model a new type of software, borrowing the practice of traditional software reuse, that is, focusing on the reuse of DL models to improve the quality of DL model development and maintenance. This paper focuses on more complex model reuse scenarios, where developers need to combine multiple models with functional overlaps. We explore whether the model combination technique can meet the requirements for such scenarios. We have conducted an empirical study of the research scenario and found that a model composition approach was needed to meet the requirements. Furthermore, we propose a model combination method based on concatenation-parallel called MCCP. First, the multiple models' hidden layer features are connected, and then the multiple models are connected in parallel to construct a joint model with all output categories. The joint model is trained to achieve unified requirements under the limited marking cost. Through experiments on data sets in nine domains and five model structures, the following two conclusions are drawn: (1) we observe noticeable differences (38% at most) in the performance of multiple models within overlapping category data, which calls for effective model combination techniques. (2) MCCP is more effective than the baseline, which performs the best in eight of the nine domains. Our research shows that the joint model generated by combining models with overlapping functions can meet the requirements of complex model reuse scenarios.
Deep learning (DL) models have proven to be highly successful and are now essential to our everyday routines. However, DL models, like traditional software, inevitably contain bugs that affect their performance in real-world scenarios. Effective software engineering techniques are necessary to ensure their dependability. In recent years, fault localization methods for DL models have gained significant attention as a valuable tool for improving the reliability of DL models. Owing to the data-driven programming paradigm, traditional fault localization techniques are challenging to apply directly to DL programs. Previous studies have shown that neuron errors within models can lead to abnormal behavior, and they fix the DL model errors from the perspective of neurons. Nonetheless, there remains a significant gap between the DL program statement and model errors. To tackle this problem, this paper proposes a novel fault localization method for DL models, named weiGhted sUspIciousness anD balancEd aggRegation (\(\mathsf{GUIDER}\)) that revisits the idea and challenge of spectrum-based fault localization in the context of DL models. For pre-trained DL models, \(\mathsf{GUIDER}\) utilizes neuron coverage information and test case confidence to compute weighted neuron suspiciousness values and employs balanced aggregation methods to elevate these values from the neuron level to the layer level, which establishes a bridge between the DL model and the DL program, facilitating the developers’ debugging process. We evaluate \(\mathsf{GUIDER}\) using 161 real model bugs collected from StackOverflow and five state-of-the-art fault localization methods for DL models as baselines. The results indicate that (a) our method successfully localizes 67% of the model bugs by ranking the buggy layer to the first place (i.e., top-\(1\)), significantly outperforming all five baselines, and (b) our method maintains an acceptable time overhead compared with all baseline methods.
The relationship between test code and production code, that is, test-to-code traceability, plays an essential role in the verification, reliability, and certification of software systems. Prior work on test-to-code traceability focuses mainly on Java. However, as Python allows more flexible testing styles, it is still unknown whether existing traceability approaches work well on Python projects. In order to address this gap in knowledge, this paper evaluates whether existing traceability approaches can accurately identify test-to-code links in Python projects. We collected seven popular Python projects and carried out an exploratory study at both the method and module levels (involving a total of 3198 test cases). On these projects, we evaluated 15 individual traceability techniques along with cross-level information propagation and four combining resolution strategies. The results reveal that the performance of test-to-code traceability approaches on Python has many differences with Java: (1) most of the existing techniques have poor effectiveness for Python; (2) after augmenting with cross-level information, the recall surprisingly drops; and (3) machine learning based combination approach achieves the best recall but the worst precision. These findings shed light on the best traceability approaches for Python projects, and also provide guidelines for researchers and the Python community.
Test automation intrusive to the devices under test is difficult to apply on closed or uncommon touch screen systems, e.g., a Switch game console or a digital instrument running a self-defined operating system. There is a lack of non-intrusive test automation techniques for situations where intrusive testing is impossible or not easy to apply. This paper presents RoScript, a novel robotic visual GUI testing system for truly non-intrusive test automation of touch screen applications. RoScript expresses GUI actions in visual test scripts and executes them via a physical robot. A key innovation of RoScript is a test engine armed with environment calibration techniques to achieve automated test execution without manually setting any environment parameter or adjusting the robot arms for a new subject under test. Additionally, two complementary computer vision-based methods are also introduced to record test scripts from videos of human actions on a touch screen. The RoScript test automation does not rely on the internal system of a device under test, making it truly non-intrusive and suitable for touch screen applications running on almost any platform. We evaluated RoScript on a diverse range of devices--including three Android/iOS phones, a Windows tablet, a Linux-based Raspberry Pi, a GoPro camera, and a Switch game console--across over 1100 GUI actions in 160 test scenarios. The results demonstrate RoScript's high accuracy in test execution: 94% for executing test scripts and 97% for replicating GUI actions. Furthermore, RoScript accurately recorded about 85% of human touch screen actions into test code. These results highlight RoScript's potential as a truly non-intrusive, cross-platform solution for GUI test automation.
Machine learning's penetration into high-stakes decision-making—credit approvals, healthcare triage, criminal risk assessment—has amplified pre-existing societal inequities rather than ameliorating them. This study operationalizes John Rawls's "veil of ignorance" (1971) as a computational principle for binary classifiers, confronting a gap: most fairness metrics lack philosophical grounding while Rawlsian theories remain mathematically unformalized. Through three empirical phases—(1) baseline logistic regression on full feature sets, (2) bias quantification via disaggregated metrics across protected groups, and (3) mitigation via pre-processing blindess and post-processing threshold optimization—we demonstrate how ignorance of demographic attributes can be algorithmically imposed. Using the German Credit Dataset (n=1,000), we expose a 12.9% accuracy gap between gender groups in standard models. Our framework collapses demographic parity difference from 15.7% to 0.1% while paradoxically boosting accuracy by 2.8% (from 72.0% to 74.0%), challenging the fairness-accuracy sacrifice orthodoxy. Counterintuitively, naive feature removal worsened bias (+8.9%), only proxy-aware pruning achieved DPD reduction of 32.6%. These findings suggest that Rawlsian principles, when translated into constrained optimization, yield Pareto-superior solutions—though we argue such technical fixes must complement, not substitute for, institutional reform.
The co-evolution of production and test code (PT co-evolution) has received increasing attention in recent years. However, we found that existing work did not comprehensively study various PT co-evolution scenarios, such as the qualification and persistence of their effects on software. Inspired by technical debt (TD), we refer to TD generated during the co-evolution between production and test code as PT co-evolution technical debt (PTCoTD). To better understand PT co-evolution, we first conducted an exploratory study on its characteristics on 15 open-source projects, finding unbalanced PT co-evolution prevalent and summarizing five potential PT flaws. Then we proposed an approach to identify and quantify PTCoTDs of these flaw patterns, considering evolutionary and structural relationships. We also built prediction models to describe cost trajectories and rank all PTCoTDs to prioritize expensive ones. The evaluation on the 15 projects shows that our approach can identify PTCoTDs that deserve attention. The identified PTCoTDs account for about half of the project’s total maintenance costs, and the cost proportion of the expensive Top-5 is 1.8x more than the file proportion they contain. Almost all covered maintenance costs persist as PTCoTD in the future, with an average increase of 6.8% between the last two releases. Our approach also accurately predicts the costs of PTCoTD with an average prediction deviation of only 8.3%. Our study provides valuable insights into PT co-evolution scenarios and their effects, which can guide practices and inspire future work on software testing and maintenance.
Code vulnerability detection is particularly critical in software development and maintenance because it may prevent software instability, data leakage, or more serious security threats. Traditional code vulnerability detection methods usually rely on static analysis. While static analysis covers the entire code base and detects early errors, it may struggle with highly complex code structures, leading to potential false positives or false negatives. Deep learning has introduced new opportunities for detecting vulnerabilities but faces challenges with complex code structures and logical relationships. Efforts to integrate natural language processing embeddings into models like Graph Neural Networks aim to enhance semantic understanding but depend on the quality of the NLP model and embeddings. To address these challenges, we propose a methodology centered around the Structural Semantic Enhancement Method (SSEM), which combines the semantic understanding of deep learning with structured code information provided by static analysis. Specifically, our method extracts the key information of control flow graphs and data dependency graphs and designs specialized SSEM with attention mechanisms. Based on two large-scale datasets, including more than 40,000 code snippets, we experimentally validated the effectiveness of the proposed method. Experimental results show that our method performs better in identifying potential vulnerabilities in code compared to traditional deep learning methods and advanced deep learning vulnerability detection models.
During software maintenance and evolution, developers spend more than half of their time on code comprehension activities. In order to understand an unfamiliar code base, they would naturally ask different types of questions related to code snippets and try to find the answers. In this paper, we conduct an initial work to explore the possibility of automatic question generation for program comprehension. We construct a large-scale data set containing pairs of source code and questions that are automatically transformed from inline comments based on dependency analysis and semantic role labeling. We also build a comprehensive taxonomy of question types so as to generate questions concerning different aspects of code snippets, such as purpose, implementation details and so on. Then, we propose a deep learning-based prototype CodeQG to automatically generates multiple types of questions for code snippets. We evaluate CodeQG by using both typical performance metrics and manual evaluation. The results show that (1) we can achieve a value of 42.02 on BLEU4 and 60.81 on ROUGE-L for the generated questions; (2) overall, the questions are very correct in grammatical, semantic and format; (3) the questions are related to the corresponding code snippet and are helpful for developers in source code comprehension activities. Our work gives insights into automatically generating multiple types of questions for code comprehension. We expect this exploration will improve the applicability and generality of machine code comprehension.
Existing fine-grained predictive mutation testing studies predominantly rely on deep learning, which faces two critical limitations in practice: (1) Exorbitant computational costs. The deep learning models adopted in these studies demand significant computational resources for training and inference acceleration. This introduces high costs and undermines the cost-reduction goal of predictive mutation testing. (2) Constrained applicability. Although modern mutation testing tools generate mutants both inside and outside methods, current fine-grained predictive mutation testing approaches handle only inside-method mutants. As a result, they cannot predict outside-method mutants, limiting their applicability in real-world scenarios. We propose WITNESS, a new fine-grained predictive mutation testing approach. WITNESS adopts a twofold design: (1) With collected features from both inside-method and outside-method mutants, WITNESS is suitable for all generated mutants. (2) Instead of using computationally expensive deep learning, WITNESS employs lightweight classical machine learning models for training and prediction. This makes it more cost-effective and enabling straightforward explanations of the decision-making processes behind the adopted models. Evaluations on Defects4J projects show that WITNESS consistently achieves state-of-the-art predictive performance across different scenarios. Additionally, WITNESS significantly enhances the efficiency of kill matrix prediction. Post-hoc analysis reveals that features incorporating information from before and after the mutation are the most important among those used in WITNESS. Test case prioritization based on the predicted kill matrix shows that WITNESS delivers results much closer to those obtained by using the actual kill matrix, outperforming baseline approaches.
Modern software systems frequently employ multiple programming languages to harness unique strengths of each language. One such language is JavaScript, which enjoys widespread usage, particularly in client-side web development. Nonetheless, JavaScript lacks native support for low-level operations. To address this limitation, developers often repurpose pre-existing C/C++ modules, but they need to write Glue Code to facilitate the adaptation of C/C++ modules to the JavaScript environment. Reusing C/C++ modules can significantly enhance software performance and usability, making it highly sought-after in practical applications. In response to this demand, we present an innovative approach to generating C-to-JavaScript glue code, grounded in a rewrite system. Initially, we define the glue code generation problem with a formal multi-language system that captures interoperation semantics of JavaScript and C++. Subsequently, we abstract a framework for generating glue code and utilize a parameterized template-based rewrite system to implement this framework. Lastly, we implement our method through a tool named CJSBinder and conduct a systematic evaluation, analyzing its accuracy, efficiency, and practical applicability compared to a state-of-the-art tool. The results demonstrate that CJSBinder excels at efficiently generating accurate glue code and is compatible with a variety of real-world project contexts.
General-purpose GPUs are widely used for computational acceleration in various fields. Designing highperformance GPU kernels is challenging due to dynamic kernel variables and complex GPU architectures. Leveraging runtime profiling to identify value-related inefficiencies is effective for optimizing GPU kernels, but it faces several challenges: (1) high profiling overhead, (2) limited analysis of inter-variable correlations, and (3) lack of automated optimization mechanisms. In this paper, we propose a profile-guided optimization technique named ProSpec for GPU Kernel Specialization. It offloads profile collection to CPUs, analyzes inefficiency patterns dependent on multiple hot values, and generates optimization feedback for automatic kernel specialization. The prototype of ProSpec, implemented over the LLVM infrastructure, is evaluated on the Rodinia and Polybench benchmarks. It achieves a maximum speedup of 5.619x and an average of 1.417x on optimized applications, maintaining a low profiling overhead of around 1.01x. Compared to state-of-the-art methods, ProSpec leads in the number of improved kernels and further optimizes half of those already optimized by other tools.
In the rapidly advancing field of software development, the demand for practical code translation tools has surged, driven by the need for interoperability across different programming environments. Existing learning-based approaches often need help with low-resource programming languages that lack sufficient parallel code corpora for training. To address these limitations, we propose a novel training framework that begins with monolingual seed corpora, generating parallel datasets via back-translation and incorporating compiler feedback to optimize the translation model. As a case study, we apply our method to train a code translation model for a new-born low-resource programming language, Cangjie. We also construct a parallel test dataset for Java-to-Cangjie translation and test cases to evaluate the effectiveness of our approach. Experimental results demonstrate that compiler feedback greatly enhances syntactical correctness, semantic accuracy, and test pass rates of the translated Cangjie code. These findings highlight the potential of our method to support code translation in low-resource settings, expanding the capabilities of learning-based models for programming languages with limited data availability.
Tests, as an essential artifact, should co-evolve with the production code to ensure that the associated production code satisfies specification. However, developers often postpone or even forget to update tests, making the tests outdated and lag behind the code. To predict which tests need to be updated when production code is changed, it is challenging to identify all related tests and determine their change probabilities due to complex change scenarios. This paper fills the gap and proposes a hybrid approach named COTE to predict code-to-test co-evolution. We first compute the linked test candidates based on different code-to-test dependencies. After that, we identify common co-change patterns by building a method-level dependence graph. For the remaining ambiguous patterns, we leverage a pre-trained language model which captures the semantic features of code and the change reasons contained in commit messages to judge one test’s likelihood of being updated. Experiments on our datasets consisting of 6,314 samples extracted from 5,000 Java projects show that COTE outperforms state-of-the-art approaches, achieving a precision of 89.0% and a recall of 71.6%. This work can help practitioners reduce test maintenance costs and improve software quality.
Code-line-level defect prediction (CLDP) is an effective technique to incorporate comprehensive measures for buggy line identification to optimize efforts in Software Quality Assurance activities. Most CLDP methods either consider the textual information of the code or rely merely on file-level label information, which have not fully leveraged the essential information in the CLDP context, with historical code-line-level labels being incredibly overlooked in their application. Due to the vast number of code lines and the sparsity of the tokens they contain, leveraging historical code-line-level label information remains a significant challenge. To address this issue, we propose a novel CLDP method, Spectrum infOrmation and caUsality aNalysis based coDe-linelevel defect prediction (SOUND). SOUND incorporates two key ideas: (a) it introduces a spectrum information perspective, utilizing labels from historical defective lines to quantify the contribution of tokens to line-level defects, and (b) it applies causal analysis to obtain a more systematic and comprehensive understanding of the causal relationships between tokens and defects. After conducting a comprehensive study involving 142 releases across 19 software projects, the experimental results demonstrate that our method significantly outperforms existing state-of-the-art (SOTA) CLDP baseline methods in terms of its ability to rank defective lines under three indicators, IFA, Recall@Top20%LOC, and Effort@Top20%Recall. Notably, in terms of IFA, our method achieves a score of 0 in most cases, indicating that the first line in the ranking list generated by our method is actually defective, significantly enhancing its practicality.