Directed Test Generation to Detect Loop Inefficiencies

被引:17
作者
Dhok, Monika [1 ]
Ramanathan, Murali Krishna [1 ]
机构
[1] Indian Inst Sci, Bangalore, Karnataka, India
来源
FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING | 2016年
关键词
redundant traversal bugs; performance; testing;
D O I
10.1145/2950290.2950360
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Redundant traversal of loops in the context of other loops has been recently identified as a source of performance bugs in many Java libraries. This has resulted in the design of static and dynamic analysis techniques to detect these performance bugs automatically. However, while the effectiveness of dynamic analyses is dependent on the analyzed input tests, static analyses are less effective in automatically validating the presence of these problems, validating the fixes and avoiding regressions in future versions. This necessitates the design of an approach to automatically generate tests for exposing redundant traversal of loops. In this paper, we design a novel, scalable and automatic approach that addresses this goal. Our approach takes a library and an initial set of coverage-driven randomly generated tests as input and generates tests which enable detection of redundant traversal of loops. Our approach is broadly composed of three phases - analysis of the execution of random tests to generate method summaries, identification of methods with potential nested loops along with the appropriate context to expose the problem, and test generation to invoke the identified methods with the appropriate parameters. The generated tests can be analyzed by existing dynamic tools to detect possible performance issues. We have implemented our approach on top of the SOOT bytecode analysis framework and validated it on many open-source Java libraries. Our experiments reveal the effectiveness of our approach in generating 224 tests that reveal 46 bugs across seven libraries, including 34 previously unknown bugs. The tests generated using our approach significantly outperform the randomly generated tests in their ability to expose the inefficiencies, demonstrating the usefulness of our design.
引用
收藏
页码:895 / 907
页数:13
相关论文
共 44 条
[1]  
Agesen O., 2000, P 2 INT S MEM MAN IS
[2]  
[Anonymous], P 34 ANN ACM SIGPLAN
[3]  
[Anonymous], 2006, P 13 ACM C COMPUTER
[4]  
[Anonymous], 1997, Advanced compiler design implementation
[5]   Efficient path profiling [J].
Ball, T ;
Larus, JR .
PROCEEDINGS OF THE 29TH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE - MICRO-29, 1996, :46-57
[6]  
Bessey A., COMMUN ACM, V53
[7]  
Bhattacharya S., 2011, P 25 EUR C OBJ OR PR
[8]  
Blackburn S. M., 2001, P 16 ACM SIGPLAN C O
[9]  
Cadar Cristian, 2008, OSDI'08, P209, DOI 10.5555/1855741.1855756
[10]  
D 'Elia D. C., 2013, P 2013 ACM SIGPLAN I