Toward Harnessing a Java High-Level Language Virtual Machine for Supporting Software Testing
Total Page:16
File Type:pdf, Size:1020Kb
Toward harnessing a Java high-level language virtual machine for supporting software testing Vinicius Humberto Serapilha Durelli Utilizando uma máquina virtual Java como apoio à atividade de teste de software Vinicius Humberto Serapilha Durelli SERVIÇO DE PÓS-GRADUAÇÃO DO ICMC-USP Data de Depósito: Assinatura:________________________ Toward harnessing a Java high-level language virtual machine for supporting software testing Vinicius Humberto Serapilha Durelli Advisor: Prof. Dr. Marcio Eduardo Delamaro Co-advisor: Prof. Dr. Jeff Offutt Doctoral dissertation submitted to the Instituto de Ciências Matemáticas e de Computação - ICMC-USP, in partial fulfillment of the requirements for the degree of the Doctorate Program in Computer Science and Computational Mathematics. FINAL VERSION. USP – São Carlos November 2013 Ficha catalográfica elaborada pela Biblioteca Prof. Achille Bassi e Seção Técnica de Informática, ICMC/USP, com os dados fornecidos pelo(a) autor(a) Durelli, Vinicius Humberto Serapilha D955t Toward harnessing a Java high-level language virtual machine for supporting software testing / Vinicius Humberto Serapilha Durelli; orientador Marcio Eduardo Delamaro; co-orientador Jeff Offutt. -- São Carlos, 2013. 165 p. Tese (Doutorado - Programa de Pós-Graduação em Ciências de Computação e Matemática Computacional) -- Instituto de Ciências Matemáticas e de Computação, Universidade de São Paulo, 2013. 1. software testing. 2. mutation testing. 3. weak mutation. 4. record-and-playback mechanism. 5. Java virtual machine. I. Delamaro, Marcio Eduardo, orient. II. Offutt, Jeff, co-orient. III. Título. SERVIÇO DE PÓS-GRADUAÇÃO DO ICMC-USP Data de Depósito: Assinatura:________________________ Utilizando uma máquina virtual Java como apoio à atividade de teste de software Vinicius Humberto Serapilha Durelli Orientador: Prof. Dr. Marcio Eduardo Delamaro Co-orientador: Prof. Dr. Jeff Offutt Tese apresentada ao Instituto de Ciências Matemáticas e de Computação - ICMC-USP, como parte dos requisitos para obtenção do título de Doutor em Ciências - Matemática . VERSÃO REVISADA USP – São Carlos Novembro de 2013 Ficha catalográfica elaborada pela Biblioteca Prof. Achille Bassi e Seção Técnica de Informática, ICMC/USP, com os dados fornecidos pelo(a) autor(a) Durelli, Vinicius Humberto Serapilha D955t Toward harnessing a Java high-level language virtual machine for supporting software testing / Vinicius Humberto Serapilha Durelli; orientador Marcio Eduardo Delamaro; co-orientador Jeff Offutt. -- São Carlos, 2013. 165 p. Tese (Doutorado - Programa de Pós-Graduação em Matemática) -- Instituto de Ciências Matemáticas e de Computação, Universidade de São Paulo, 2013. 1. teste de software. 2. teste de mutação. 3. mutação fraca. 4. mecanismo de record-and-playback. 5. máquina virtual Java. I. Delamaro, Marcio Eduardo, orient. II. Offutt, Jeff, co-orient. III. Título. IWantOut From our lives’ beginning on We are pushed in little forms No one asks us how we like to be In school they teach you what to think But everyone says different things But they’re all convinced that They’re the ones to see So they keep talking and they never stop And at a certain point you give it up So the only thing that’s left to think is this I want out – to live my life alone I want out – leave me be I want out – to do things on my own I want out – to live my life and to be free People tell me A and B They tell me how I have to see Things that I have seen already clear So they push me then from side to side They’re pushing me from black to white They’re pushing ’til there’s nothing more to hear But don’t push me to the maximum Shut your mouth and take it home ’Cause I decide the way things gonna be I want out – to live my life alone I want out – leave me be I want out – to do things on my own I want out – to live my life and to be free There’s a million ways to see the things in life A million ways to be the fool In the end of it, none of us is right Sometimes we need to be alone No no no, leave me alone I want out – to live my life alone I want out – leave me be I want out – to do things on my own I want out – to live my life and to be free Helloween, Keeper of the Seven Keys, Pt. 2 (1988) Acknowledgments To quote the Grateful Dead, \What a long strange trip it's been". Looking back on the past few years, I realized that along the way I had tremendous help from friends and colleagues too numerous to name them all in this document (so, any omission here is not intentional). I also received extensive support from my family, international researchers, and funding agencies. So, I would like to acknowledge all the people that have turned my last few years into a great experience. Foremost, I would like to express my deepest gratitude to my friend Simone Borges for placing food in front of me in order to keep me alive while I was trying to meet deadlines. Simone, you did your best to keep me going through the toughest times, and for that I am immensely thankful. Simone should also be thanked for her help with most of the figures in this document, without her they would not be nearly as polished. Simone also kept reminding me that there is more to life than work: we played Zelda, Super Smash Bros. Brawl, and Super Mario Galaxy whenever we had a couple hours of leeway. I had fun playing video games with you, those were great times filled with laughter. And speaking of playing video games, I also would like to thank my brother (Rafael Durelli) for always being there for me, and for playing Super Smash Bros. Brawl with Simone and me (as far as Super Smash Bros. Brawl is concerned, the more players the better). I am thankful to Dr. M´arcio Delamaro for his invaluable feedback and guidance through- out the past few years. It is utterly my fault if his high standards are not reflected in this document. My sincere thanks also goes to Dr. Jeff Offutt. During my period abroad I learned a lot from him. Our chats helped me to figure out how I should go about doing research and writing papers | yet, it is probably safe to say that my writing will never rival the succinctness of his style. I am thankful to all core members of the Maxine VM project at Oracle Laboratories. In particular, Douglas Simon for his always enlightening and accurate answers on the Maxine i VM mailing list. Thanks to the emails exchanged with him, I was able to tease out the chunks of code I had to study and change. Further, whenever I was at a loss as to why my code was acting up, he provided me with helpful troubleshooting suggestions. Grateful thanks are due to Nan Li. I am glad we became friends. I enjoyed spending most Sunday mornings playing soccer with you. Also, it goes without saying that being one of the groomsmen at your wedding meant a lot to me. For the sake of finishing my Ph.D., I took many friends for granted. Still, they have not given up on me. Besides friends, some colleagues and fellow researchers that I met along the way have contributed to make the last few years even more special. The list of friends, colleagues, and fellow researchers is the following (I hope I did not leave anyone off the list): Rodrigo Fraxino, Andr´eEndo, Fabiano Ferrari, Lucas Bueno, Jorge Cutigi, K´atia Felizardo, Bruno Cafeo, Marco Silva, Aretha Alencar, Wesley Renan, Upsorn Praphamontripong, Rafael Oliveira, Sunitha Thummala, Paulo Nardi, Rosana Braga, Ros^angela Penteado, Matheus Viana, Marcos Laia, Marcelo Eler, Ricardo Rios, and Tatiane Rios. I am immensely grateful to my mother (L´ucia Serapilha) and grandmother (Glinauria Serapilha). I know that they will never want to read this document but they contributed to it being written. Thank you both for your unconditional support and love. This research was made possible by the financial support provided by FAPESP (grant number 2009/00632-1) and CAPES (grant number 0340-11-1). ii Abstract igh-level language virtual machines (HLL VMs) have been H playing a key role as a mechanism for implementing program- ming languages. Languages that run on these execution environments have many advantages over languages that are compiled to native code. These advantages have led HLL VMs to gain broad acceptance in both academy and industry. However, much of the research in this area has been devoted to boosting the performance of these execution environments. Few efforts have attempted to introduce features that automate or facilitate some software engineering activities, including software testing. This research argues that HLL VMs provide a rea- sonable basis for building an integrated software testing environment. To this end, two software testing features that build on the charac- teristics of a Java virtual machine (JVM) were devised. The purpose of the first feature is to automate weak mutation. Augmented with mutation support, the chosen JVM achieved speedups of as much as 95% in comparison to a strong mutation tool. To support the testing of concurrent programs, the second feature is concerned with enabling the deterministic re-execution of Java programs and exploration of new scheduling sequences. Keywords | software testing; mutation testing; weak mutation; record-and-playback mechanism; Maxine VM; Java virtual machine. iii iv Resumo aquinas´ virtuais de linguagens de programa¸c~ao t^emdesem- M penhado um papel importante como mecanismo para a imple- menta¸c~ao de linguagens de programa¸c~ao. Linguagens voltadas para esses ambientes de execu¸c~ao possuem v´arias vantagens em rela¸c~ao`as linguagens compiladas.