Unexpected bearing failures always cause severe production disruptions. Such faults often arise under specific operating conditions correlated with the on-site environment. Therefore, it is highly desired to fine-tune the preventive monitoring models with prior fault data on site. However, bearings in industrial equipment typically exhibit low failure rates, and thus prior fault data cannot be collected in time before faults occur. To tackle this issue, we propose a novel preventive monitoring technology that utilizes a contrastive fine-tuning method for a pre-trained model, only leveraging on-site normal data from bearings. This approach aligns the features of the pre-trained model with practical bearing characteristics, enhancing failure prediction capabilities. Experiments demonstrate its efficiency and effectiveness in the prediction of practical bearing failures. Compared to other popular methods, it can identify an incipient fault at least 63 min earlier, i.e., 312 min before the bearing fault occurs.
Code summarization plays a vital role in aiding developers with program comprehension by generating corresponding textual descriptions for code snippets. While recent approaches have concentrated on encoding the textual and structural characteristics of source code, they often neglect the global hierarchical features, causing limited code representation. Addressing this gap, our paper introduces the statement-grained hierarchy enhanced Transformer model (SHT), a novel framework that integrates global hierarchy, syntax, and token sequences to automatically generate summaries for code snippets. SHT is distinctively designed with two encoders to learn both hierarchical and sequential features of code. One relational attention encoder processes the statement-grained hierarchical graph, producing hierarchical embeddings. Subsequently, another sequence encoder integrates these hierarchical structures with token sequences. The resulting enriched representation is then fed into a vanilla Transformer decoder, which effectively generates concise and informative summarizations. Our extensive experiments demonstrate that SHT significantly outperforms state-of-the-art approaches on two widely used Java benchmarks. This underscores the effectiveness of incorporating global hierarchical information in enhancing the quality of code summarizations.
With the increasing size of code and the increasing complexity of code files,code defect detection tools need to adopt parallel scheduling method for scheduling.In order to better use parallel method for scheduling and improve the efficiency of defect detection and utilization of hardware resources,we propose a method to predict the cost of the module tested in code defect detection.According to the characteristics of the defect testing system(DTS)defect detection process,the time cost feature and space cost feature were extracted.The semantic feature was extracted by deep memory network.The time cost feature and semantic feature were fused to get the fusion feature,and the regression model was used to predict the time cost of the fusion feature and the space cost of the space cost feature.Experimental results on 8 open source C projects show that the proposed method has a good performance in cost prediction.
Fortran语言相比于其他常见的C、C++、Java语言具有高性能计算以及支持复数数据类型计算的特点。函数内的路径是分析函数间路径的基础,为了表示Fortran语言函数内存在的所有路径,使用可达基本路径集来表示函数内路径,针对生成路径集过程中为了找到函数内可达基本路径集而不断增加循环结构执行次数的现象,本文提出了以元素依赖为基础的K次循环结构处理方法处理不可达路径基中的循环结构,根据不可达路径中矛盾节点的矛盾元素与循环结构的关系,将循环结构分为对不可达路径基有影响的循环结构和无影响的循环结构,增加不可达路径基中有影响循环结构的执行次数直到该基路径可达或者达到上限K次。通过实验分析该方法对于简单的Fortran语言程序能够准确的生成可达基本路径集,相比于对所有循环结构进行循环穷举方法大大提高了可达基本路径集的生成效率,对于复杂的Fortran语言程序,该方法在生成可达基本路径集的完整率以及程序的覆盖率方面均优于循环穷举方法。
数据竞争是并行程序中最常见的问题,因为其在程序中存在着随机性和难以重现的问题,所以利用动态方法检测并不可靠.本文介绍了一种针对以OpenMP实现程序并行的数据竞争故障的静态检测方法.首先根据基于OpenMP的Fortran并行程序的语法和语义特性,构建并行程序的抽象语法树,并对控制流图进行扩展引入并行控制流图;然后将数据竞争问题抽象为一种故障模型,利用有限状态机来形式化的描述此类故障模型;最后对并行区域的潜在赋值操作进行并行数据流分析,在程序控制流图节点上进行故障状态机的状态转化来实现数据竞争的检测.该方法已在自研的缺陷检测系统(DTS)中应用,并通过DataRaceBench的实验数据证明本文方法可以有效的检测出数据竞争问题.
Software requirement changes, code changes, software reuse, and testing are important activities in software engineering that involve the traceability links between software requirements and code. Software requirement documents, design documents, code documents, and test case documents are the intermediate products of software development. The lack of interrelationship between these documents can make it extremely difficult to change and maintain the software. Frequent requirements and code changes are inevitable in software development. Software reuse, change impact analysis, and testing also require the relationship between software requirements and code. Using these traceability links can improve the efficiency and quality of related software activities. Existing methods for constructing these links need to be better automated and accurate. To address these problems, we propose to embed software requirements and source code into feature vectors containing their semantic information based on four neural networks (NBOW, RNN, CNN, and self-attention). Accurate traceability links from requirements to code are established by comparing the similarity between these vectors. We develop a prototype tool RCT based on this method. These four networks’ performances in constructing links are explored on 18 open-source projects. The experimental results show that the self-attention network performs best, with an average Recall@50 value of 0.687 on the 18 projects, which is higher than the other three neural network models and much higher than previous approaches using information retrieval and machine learning.
Code clones are duplicated code snippets that significantly threaten software maintenance and the public corpora of code representation learning. Traditionally, code context and its structure information abstract syntax tree (AST), control flow graph (CFG) are typical representations of source code, and context-based models and structure-based models contributed significantly to the development of code clone detection. In this paper, we present a hybrid embedding model for code clone detection (HEM-CCD), a fusion method of token sequential information and graph-based structure information. We insert tokens' global context information encoded by a bi-directional recurrent neural network into the AST-based graph for comprehensive code semantic representation. Then, feeding the graph into a gated graph neural network we generate code semantic vectors for similarity evaluation. We have implemented our model on two public clone datasets (BigCloneBench and GoogleCodeJam), and the results indicate that HEM-CCD outperforms several state-of-the-art approaches.
Context: Cross-version defect prediction (CVDP) is a practical scenario in which defect prediction models are derived from defect data of historical versions to predict potential defects in the current version. Prior research employed defect data of the latest historical version as the training set using the empirical recommended method, ignoring the concept drift between versions, which undermines the accuracy of CVDP.Objective: We customized a Selected Training set and Transfer Learning Framework (ST-TLF) with two objectives: a) to obtain the best training set for the version at hand, proposing an approach to select the training set from the historical data; b) to eliminate the concept drift, designing a transfer strategy for CVDP.Method: To evaluate the performance of ST-TLF, we investigated three research problems, covering the generalization of ST-TLF for multiple classifiers, the accuracy of our training set matching methods, and the performance of ST-TLF in CVDP compared against state-of-the-art approaches.Results: The results reflect that (a) the eight classifiers we examined are all boosted under our ST-TLF, where SVM improves 49.74% considering MCC, as is similar to others; (b) when performing the best training set matching, the accuracy of the method proposed by us is 82.4%, while the experience recommended method is only 41.2%; (c) comparing the 12 control methods, our ST-TLF (with BayesNet), against the best contrast method P15-NB, improves the average MCC by 18.84%.Conclusions: Our framework ST-TLF with various classifiers can work well in CVDP. The training set selection method we proposed can effectively match the best training set for the current version, breaking through the limitation of relying on experience recommendation, which has been ignored in other studies. Also, ST-TLF can efficiently elevate the CVDP performance compared with random forest and 12 control methods.
随着C++语言标准的不断演进,词法语法解析工具如JavaCC等对于很多扩充的新特性以及复杂的语法结构不能做到完全支持,这可能会导致抽象语法树生成错误且不完整;针对这一问题,提出一个针对抽象语法树生成错误的处理框架;首先,通过对JavaCC的扩充,实现一套可以解析C++语言的词法语法分析器,生成抽象语法树并记录报错行;其次,根据报错行寻找所在函数区间即不支持或不匹配的语法片段;最后,通过注释函数区间的方式来跳过不支持或不匹配的语法片段进行错误处理并迭代生成抽象语法树;实验结果表明,对抽象语法树生成进行错误处理后可以更全面的分析代码,抽象语法树完成率上升37.8%,分析行数提高3.9倍.
Code clone refers to two or more identical or similar source code fragments. Research on code clone detection has lasted for decades. Investigation and evaluation of existing clone detection techniques indicate that they are resilient to function-level clone detection. Still, there may be room for further research in block-level clone detection. Particularly, type-3 clones that include large gaps, are ongoing challenges. To solve these problems, we propose a clone detection method based on multiple code features. It aims to improve the recall rate of code block clone detection and overcome large-gap and hard-to-detect type-3 clones. This method first splits the source code files based on the program's structural features and context features to obtain code blocks. The collection of code blocks obtained in this way is complete, and the large gaps in clone pairs will also be removed. In addition, we only need to compute the similarity between code blocks with the same structural features, which can also significantly save time and resources. The similarity is obtained by calculating the proportion of the same tokens between two code blocks. Moreover, since different types of tokens have different weights in similarity calculation, we use supervised learning to obtain a classifier model between token features and code clone. We divide the tokens into 13 types and train the machine learning model with the manually confirmed clone or non-clone pair. Finally, we develop a prototype system and compare our tools with existing tools under the Mutation Framework and in several actual C projects. The experimental results also demonstrate the advancement and practicality of our prototype.
静态分析工具能够一定程度上帮助开发者检测代码中的重要错误;然而,可扩展性和不可判定性的存在会影响这些工具的准确率,导致它们无法被用于更广泛的实践中;最近,研究人员开始利用人工智能的技术来提高这些工具的可使用性,通过将正确和错误的警报自动分类,以节省在软件开发过程中人工确认警报所需要的人力和时间的花费;传统的方法主要通过使用手工提取的特征来表示有缺陷的代码片段,难以抓住它们深层次的语义信息;为了克服传统方法的限制,设计并提出了一种创新的特征提取方法,通过收集并提取缺陷模式状态机实例状态转换过程中相关指令集所包含的细粒度的语法、语义信息,并将有效的深度学习框架与之相结合,从而实现跨工程的警报自动确认;在5个开源工程的警报数据集上实验,分别与基于传统度量元的自动确认方法比较,AUC指标提升幅度在1.83%~31.81%之间,表明该方法能够有效提升跨工程警报自动确认的表现.
Regarding the practicality of the quality evaluation model, the lack of quantitative experimental evaluation affects the effective use of the quality model, and also a lack of effective guidance for choosing the model. Aiming at this problem, based on the sensitivity of the quality evaluation model to code defects, a machine learning-based quality evaluation attribute validity verification method is proposed. This method conducts comparative experiments by controlling variables. First, extract the basic metric elements; then, convert them into quality attributes of the software; finally, to verify the quality evaluation model and the effectiveness of medium quality attributes, this paper compares machine learning methods based on quality attributes with those based on text features, and conducts experimental evaluation in two data sets. The result shows that the effectiveness of quality attributes under control variables is better, and leads by 15% in AdaBoostClassifier; when the text feature extraction method is increased to 50 - 150 dimensions, the performance of the text feature in the four machine learning algorithms overtakes the quality attributes; but when the peak is reached, quality attributes are more stable. This also provides a direction for the optimization of the quality model and the use of quality assessment in different situations.
A seemingly small change in the software can usually have a big impact. Impact analysis is an assessment of multiple risks associated with the changes. Research over the past 20 years has shown that impact analysis can decrease the time and effort needed in the development and regression testing and reduce the negative effects of change on other parts of the software system. These researches used program slicing, control flow analysis, call graph to analyze intraprocedural and interprocedural impact. However, most of them only analyze the methods affected by changes of simple variables or statements, which have coarse granularity and can provide limited help. To solve these problems, we propose an improving approach that can analyze the finer granularity change impact of multiple types of variables. This approach first breaks code changes into a combination of basic operations on variables and adopts corresponding analysis mechanisms for different types of variables. The code is preprocessed before analysis to gather essential information such as global variables table, function summaries, and pointer information map. In the intraprocedural analysis, we first divide the variables into two types: definition point and use point. For the use point, a data flow graph is used to analyze its change impact. For the definition point, we first find the paths where it is and analyze the variables on these paths that are controlled by it. In addition, to deal with the change impact of complex variables in the C programs, we have proposed a corresponding analysis procedure and algorithm. In interprocedural analysis, the impacted methods are searched according to their relationship and the global variable information table. A prototype system is developed based on our approach. In our evaluation, we demonstrate that the prototype system can be used to support various software development and maintenance tasks.
Cross-project defect prediction (CPDP) uses one or more source projects to build a defect prediction model and applies the model to the target project.There is usually a big difference between the data distribution of the source project and the target project,which makes it difficult to construct an effective defect prediction model.In order to alleviate the problem of negative migration between the source project and the target project in CPDP,this paper proposes an integrated transfer adaptive boosting (TrAdaBoost) algorithm based on multi-source data sets(MSITrA).The algorithm uses an existing two-stage data filtering algorithm to obtain source project data related to the target project from multiple source items,and then uses the integrated TrAdaBoost algorithm proposed in the paper to build a CPDP model.The experimental results of Promise's 15 public data sets show that:1) The cross-project software defect prediction model proposed in this paper has better performance in all tested CPDP methods;2) In the within-project software defect prediction (WPDP) experiment,the proposed CPDP method has achieved the better experimental results than the tested WPDP method.
Automated test data generation tools produce test data that can achieve high coverage faster than test data generated manually by a tester. However, the test data generated by automated tools has been shown to not help developers find more bugs. The main reason is that it is difficult for human testers to understand and evaluate the test data. In this paper, an approach is introduced to automatically generate readable test data, which has been implemented in a tool called CTS. CTS can mine constant information from projects under testing and obtain heuristic information by aggregating and rating related constants. CTS adds heuristic information to the automatic test data generation process to generate test data that is quick and easy for a human to comprehend and check. Empirical experiments show that the proposed approach can improve the efficiency of test data generation and generate test data that is more convenient for a human oracle.
A test oracle is a procedure that is used during testing to determine whether software behaves correctly or not. One of most important tasks for a test oracle is to choose oracle data (the set of variables monitored during testing) to observe. However, most literature on test oracles has focused either on formal specification generation or on automated test oracle construction, whereas little work exists for supporting oracle data selection. In this paper, we present a path-sensitive approach, PSODS (path-sensitive oracle data selection), to automatically select oracle data for use by expected value oracles. PSODS ranks paths according to the possibility that potential faults may exist in them, and the ranked paths help testers determine which oracle data should be considered first. To select oracle data for each path, we introduce quantity and quality analysis of oracle data, which use static analysis to estimate oracle data for their substitution capability and fault-detection capability. Quantity analysis can reduce the number of oracle data. Quality analysis can rank oracle data based on their fault-detection capability. By using quantity and quality analysis, PSODS reduces the cost of oracle construction and improves fault-detection efficiency and effectiveness. We have implemented our approach and applied it to a real-world project. The experimental results show that PSODS is efficient in helping testers construct test oracles. Moreover, the oracle datasets produced by our approach are more effective and efficient than output-only oracles at detecting faults.
With the rapid development of information technology, the status and role of software are more and more prominent. At the same time, due to the increasing scale and complexity, software problems are also increasing. Therefore, the importance of software support is also increasing. This paper briefly introduces the concept and classification of software support, puts forward the process of pre-deployment software support and post-deployment software support, and then discusses the principles and agency of software support.
In order to improve the support ability of software, we must consider the supportability of software in every stage of the whole life cycle of software, and software supportability analysis is an important means and the basis for realizing the goal of software support. It is also an important support to ensure and reduce the cost of software. This paper introduces the task, characteristics and influencing factors of software supportability analysis, and analyzes the supportability of each stage of software life cycle.
Web service composition is the process of combining and reusing existing web services to create new business processes to satisfy specific user requirements. Reliability plays an important role in ensuring the quality of web service composition. However, owing to the flexibility and complexity of such architecture, sufficient estimation of reliability is difficult. In this paper, the authors propose a method to estimate the reliability of web service compositions based on Bayes reliability assessment by considering it to be a decision-making problem. This improves the testing efficiency and accuracy of such methods. To this end, the authors focus on fully utilizing prior information of web services to increase the accuracy of prior distributions, and construct a Markov model in terms of the reliabilities of the web composition and each web service to integrate the limited test data. The authors further propose a method of minimum risk (MMR) to calculate the initial values of hyperparameters satisfying the constraint of minimal risk of the wrong decision. Experiments demonstrate that the proposed method is capable of efficiently utilizing prior module-level failure information, comparing with the Bayesian Monte Carlo method (BMCM) and expert scoring method (ESM), when the number of failures increased from 0 to 5, reducing the required number of test cases from 19.8% to 28.9% and 6.1% to 14.1% separately, improving the reliability assessment of web service compositions, and reducing the expenses incurred by system-level reliability testing and demonstration.
Static analysis tools, automatically detecting potential source code defects at an early phase during the software development process, are diffusely applied in safety-critical software fields. However, alarms reported by the tools need to be inspected manually by developers, which is inevitable and costly, whereas a large proportion of them are found to be false positives. Aiming at automatically classifying the reported alarms into true defects and false positives, we propose a defect identification model based on machine learning. We design a set of novel features at variable level, called variable characteristics, for building the classification model, which is more fine-grained than the existing traditional features. We select 13 base classifiers and two ensemble learning methods for model building based on our proposed approach, and the reported alarms classified as unactionable (false positives) are pruned for the purpose of mitigating the effort of manual inspection. In this paper, we firstly evaluate the approach on four open-source C projects, and the classification results show that the proposed model achieves high performance and reliability in practice. Then, we conduct a baseline experiment to evaluate the effectiveness of our proposed model in contrast to traditional features, indicating that features at variable level improve the performance significantly in defect identification. Additionally, we use machine learning techniques to rank the variable characteristics in order to identify the contribution of each feature to our proposed model.