Automatically Identifying Calling-Prone Higher-Order Functions of Scala Programs to Assist Testers  

在线阅读下载全文

作  者:Yi-Sen Xu Xiang-Yang Jia Fan Wu Lingbo Li Ji-Feng Xuan 

机构地区:[1]School of Computer Science,Wuhan University,Wuhan 430072,China [2]Turing Intelligence Technology Limited,London,EC2Y 9ST,U.K.

出  处:《Journal of Computer Science & Technology》2020年第6期1278-1294,共17页计算机科学技术学报(英文版)

基  金:This work is supported by the National Key Research and Development Program of China under Grant No.2018YFB1003901;the National Natural Science Foundation of China under Grant No.61872273;Advanced Research Projects of the 13th Five-Year Plan of Civil Aerospace Technology,Intelligent Distribution Technology of Domestic Satellite Information under Grant No.B0301.

摘  要:For the rapid development of internetware, functional programming languages, such as Haskell and Scala, can be used to implement complex domain-specific applications. In functional programming languages, a higher-order function is a function that takes functions as parameters or returns a function. Using higher-order functions in programs can increase the generality and reduce the redundancy of source code. To test a higher-order function, a tester needs to check the requirements and write another function as the test input. However, due to the complex structure of higher-order functions, testing higher-order functions is a time-consuming and labor-intensive task. Testers have to spend an amount of manual effort in testing all higher-order functions. Such testing is infeasible if the time budget is limited, such as a period before a project release. In practice, not every higher-order function is actually called. We refer to higher-order functions that are about to be called as calling-prone ones. Calling-prone higher-order functions should be tested first. In this paper, we propose an automatic approach, namely PHOF, which predicts whether a higher-order function of Scala programs will be called in the future, i.e., identifying calling-prone higher-order functions. Our approach can assist testers to reduce the number of higher-order functions of Scala programs under test. In PHOF, we extracted 24 features from source code and logs to train a predictive model based on known higher-order function calls. We empirically evaluated our approach on 4832 higher-order functions from 27 real-world Scala projects. Experimental results show that PHOF based on the random forest algorithm and the Synthetic Minority Oversampling Technique Processing strategy (SMOTE) performs well in the prediction of calls of higher-order functions. Our work can be used to support the scheduling of limited test resources.

关 键 词:higher-order function testing tool test management Scala program INTERNETWARE 

分 类 号:TP31[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象