a 739 acta - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · acta univ. oul....

86
UNIVERSITATIS OULUENSIS ACTA A SCIENTIAE RERUM NATURALIUM OULU 2020 A 739 Alireza Haghighatkhah TEST CASE PRIORITIZATION USING BUILD HISTORY AND TEST DISTANCES AN APPROACH FOR IMPROVING AUTOMOTIVE REGRESSION TESTING IN CONTINUOUS INTEGRATION ENVIRONMENTS UNIVERSITY OF OULU GRADUATE SCHOOL; UNIVERSITY OF OULU, FACULTY OF INFORMATION TECHNOLOGY AND ELECTRICAL ENGINEERING A 739 ACTA Alireza Haghighatkhah

Upload: others

Post on 30-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

UNIVERSITY OF OULU P .O. Box 8000 F I -90014 UNIVERSITY OF OULU FINLAND

A C T A U N I V E R S I T A T I S O U L U E N S I S

University Lecturer Tuomo Glumoff

University Lecturer Santeri Palviainen

Senior research fellow Jari Juuti

Professor Olli Vuolteenaho

University Lecturer Veli-Matti Ulvinen

Planning Director Pertti Tikkanen

Professor Jari Juga

University Lecturer Anu Soikkeli

Professor Olli Vuolteenaho

Publications Editor Kirsti Nurkkala

ISBN 978-952-62-2476-3 (Paperback)ISBN 978-952-62-2477-0 (PDF)ISSN 0355-3191 (Print)ISSN 1796-220X (Online)

U N I V E R S I TAT I S O U L U E N S I SACTAA

SCIENTIAE RERUM NATURALIUM

U N I V E R S I TAT I S O U L U E N S I SACTAA

SCIENTIAE RERUM NATURALIUM

OULU 2020

A 739

Alireza Haghighatkhah

TEST CASE PRIORITIZATION USING BUILD HISTORY AND TEST DISTANCESAN APPROACH FOR IMPROVING AUTOMOTIVE REGRESSION TESTING IN CONTINUOUS INTEGRATION ENVIRONMENTS

UNIVERSITY OF OULU GRADUATE SCHOOL;UNIVERSITY OF OULU,FACULTY OF INFORMATION TECHNOLOGY AND ELECTRICAL ENGINEERING

A 739

AC

TAA

lireza Haghighatkhah

Page 2: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä
Page 3: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

ACTA UNIVERS ITAT I S OULUENS I SA S c i e n t i a e R e r u m N a t u r a l i u m 7 3 9

ALIREZA HAGHIGHATKHAH

TEST CASE PRIORITIZATION USING BUILD HISTORY AND TEST DISTANCESAn approach for improving automotive regression testing in continuous integration environments

Academic dissertation to be presented, with the assent ofthe Doctoral Training Committee of InformationTechnology and Electrical Engineering of the University ofOulu, for public defence in the Wetteri auditorium(IT115), Linnanmaa, on 31 January 2020, at 12 noon

UNIVERSITY OF OULU, OULU 2020

Page 4: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Copyright © 2020Acta Univ. Oul. A 739, 2020

Supervised byProfessor Markku OivoProfessor Pasi Kuvaja

Reviewed byAssociate Professor Bram AdamsProfessor Ville Leppänen

ISBN 978-952-62-2476-3 (Paperback)ISBN 978-952-62-2477-0 (PDF)

ISSN 0355-3191 (Printed)ISSN 1796-220X (Online)

Cover DesignRaimo Ahonen

JUVENES PRINTTAMPERE 2020

OpponentProfessor Per Runeson

Page 5: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Haghighatkhah, Alireza, Test case prioritization using build history and testdistances. An approach for improving automotive regression testing in continuousintegration environmentsUniversity of Oulu Graduate School; University of Oulu, Faculty of Information Technologyand Electrical EngineeringActa Univ. Oul. A 739, 2020University of Oulu, P.O. Box 8000, FI-90014 University of Oulu, Finland

Abstract

Agile software development has become a source of competitive advantage in many industrialsectors, including the automotive domain. Continuous integration (CI) is an agile practice andinvolves integrating software changes as often and as early as possible. CI in combination withregression testing is considered a good software development practice, because it ensures thatrecent changes have not negatively impacted the software’s functionality. The execution of a largetest suite at each integration (also known as the build) cycle is not realistic. To detect regressionfaults earlier, one alternative is to permute the test cases within the regression test suite. This isknown as test case prioritization (TCP).

This dissertation aims to shorten the build cycle in CI environments by detecting regressionfaults earlier, allowing software developers to integrate and verify their changes more frequentlyand continuously. The research was performed in three phases. In the 1st phase, the relevantliterature was systematically surveyed to analyze the existing body of knowledge and identifyresearch opportunities. In the 2nd phase, the TCP technique of history-based diversity wasdeveloped and subjected to several rounds of improvements and evaluations. In the 3rd phase,results from the previous two phases were synthesized in order to draw conclusions and outlineimplications.

Our results bring to mind the well-known adage “don't put all your eggs in one basket”. For theinitial stages, when no information about the system under test is available, one should spread thelimited testing budget evenly across different parts of the system by running the most dissimilartest cases early in the process (i.e., maximizing diversity as early as possible). For the later stages,when historical build data are available, one should give higher priority to the test cases that havehigher historical value (i.e., those that revealed the most failure in the most recent revisions) andthat are most distant from those previously prioritized (i.e., cover different areas of the system).

One of the major contributions of this dissertation is the design, implementation, andexperimental evaluation of a TCP technique using 12 open-source Java programs. Findings fromthe experiments provide empirical evidence in support of two previously proposed TCP heuristics– failure recurrence and test diversity – and their combination in CI development environments.Furthermore, results from the systematic mapping studies contribute to the literature by providinga synthesized and structured body of knowledge and a basis for future studies. We conclude thatTCP can be performed in CI environments with negligible investment using build history and testdistances.

Keywords: agile software development, continuous deployment, continuous integration,regression testing, software engineering, software-intensive systems, test caseprioritization

Page 6: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä
Page 7: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Haghighatkhah, Alireza, Testitapausten priorisointi käyttäen ohjelmiston koonninhistoriaa ja testietäisyyttä. Menetelmä regressiotestauksen parantamiseenjatkuvan integroinnin ohjelmistokehitysympäristössä autoteollisuudessaOulun yliopiston tutkijakoulu; Oulun yliopisto, Tieto- ja sähkötekniikan tiedekuntaActa Univ. Oul. A 739, 2020Oulun yliopisto, PL 8000, 90014 Oulun yliopisto

Tiivistelmä

Ketterä ohjelmistokehitys tarjoaa kilpailuetua monella teollisen tuotannon alalla mukaan lukienautoteollisuus. Jatkuva integrointi on ketterän ohjelmistokehityksen käytäntö, jossa muutoksiaintegroidaan mahdollisimman varhain ja tiheään. Jatkuvan integroinnin ja regressiotestauksenyhdistäminen on hyväksi havaittu käytäntö, koska näin voidaan varmistaa, että viimeisimmätmuutokset eivät vaikuta ohjelmiston toiminnallisuuteen haitallisesti. Suuren testisarjan suoritta-minen jokaisen integraation (eli koonnin) jälkeen ei ole realistista. Jotta virheitä havaittaisiinaiemmin, testisarjan testitapaukset voidaan permutoida. Tätä kutsutaan testitapausten priorisoin-niksi.

Tämä väitöstutkimus pyrkii lyhentämään jatkuvan integroinnin koontisykliä nopeamman vir-heiden löytämisen avulla, jotta muutokset voidaan integroida ja varmistaa entistä tiheämmin jajatkuvasti. Tutkimus tehtiin kolmessa vaiheessa. Ensimmäisessä vaiheessa kartoitettiin olemas-sa oleva tutkimus ja tunnistettiin tarve uudelle tutkimukselle systemaattisella kirjallisuuskatsauk-sella. Toisessa vaiheessa historia- ja etäisyysperustaista testitapausten priorisointitekniikkaakehitettiin useamman parannus- ja evaluointi-iteraation kautta. Kolmannessa vaiheessa synteti-soitiin kahden edellisen vaiheen tulokset ja hahmoteltiin johtopäätökset.

Tulokset osoittavat, että ei kannata ”laittaa kaikkia munia samaan koriin”. Testaamisen alku-vaiheessa, kun tieota on vain vähän, tulisi testauksen rajallinen budjetti jakaa mahdollisimmanerilaisten testitapausten kesken siten, että testaus kohdistuu järjestelmän eri osa-alueisiin (ts.maksimoidaan testauksen monimuotoisuus mahdollisimman aikaisin). Myöhemmissä vaiheissa,kun koontihistoriaa on saatavilla, tulisi priorisoida niitä testitapauksia, joilla on suurempi arvohistoriassa (eli ne testitapaukset, joilla löydettiin eniten virheitä viimeisimmässä versiossa) jajotka ovat mahdollisimman etäisiä verrattuna niihin testitapauksiin, joita priorisoitiin viimeksi(ts. kattaa ohjelmiston eri osa-alueita).

Tämän väitöksen yksi keskeisimmistä kontribuutioista on testitapauspriorisointitekniikansuunnittelu, toteutus ja kokeellinen evaluointi käyttäen kahdentoista avoimen lähdekoodin Java-ohjelman viallisia koonteja. Kokeellisen tutkimuksen tulokset tukevat kahta aiemmin ehdotettuatestitapauspriorisointiheuristiikkaa – virheiden toistuminen ja testien monimuotoisuus – sekänäiden yhdistämistä jatkuvan integroinnin ohjelmistokehityksessä. Lisäksi, systemaattisen kirjal-lisuuskatsauksen tulos tarjoaa ajantasaisen tietämyksen esitys strukturoidusti ja perustan tuleval-le tutkimukselle. Tulimme siihen johtopäätökseen, että testitapausten priorisointi voidaan tehdäpienillä investoinneilla jatkuvan integroinnin ympäristössä hyödyntäen testihistoriaa ja testietäi-syyttä.

Asiasanat: jatkuva integrointi, jatkuva ohjelmistokehitys, ketterä ohjelmistokehitys,ohjelmistotuotanto, ohjelmistovaltaiset järjestelmät, regressiotestaus, testitapaustenpriorisointi

Page 8: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä
Page 9: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Acknowledgements

Undertaking a PhD abroad has been quite a journey for me, as well as a character-building experience. Along the way, there were many ups and downs, many rejections,and much desperation and uncertainty. Fortunately, I came across the art of SISU –a very Finnish quality one needs to develop to complete a PhD in Oulu (65.0121◦

N latitude, to be precise). I can now say with all honestly that it was a wonderfulexperience. This journey gave me the chance to grow both intellectually and personally.

I am grateful for my supervisors – Prof. Markku Oivo as principal supervisor andProf. Pasi Kuvaja as cosupervisor – who offered me the position and guided me throughthe journey. I am deeply thankful for their encouraging attitudes and all their advice,for their reviews of my boring manuscripts, for their patience when I spammed theirinboxes, and most importantly because they gave me the freedom to explore and learnon my own.

My deep appreciation for the pre-examination of this dissertation goes to Prof. BramAdams (Polytechnique Montréal, Canada) and Prof. Ville Leppänen (University ofTurku, Finland). Their suggestions brought more clarity to this study and helped meimprove its quality. I am also very grateful to Prof. Per Runeson (Lund University,Sweden) for his kind willingness to serve as an opponent during my doctoral defense.

I would also like to thank my follow-up group members – Adjunct Prof. JouniMarkkula and Prof. Burak Turhan – whose feedback steered my research in the rightdirection. I wish to express my gratitude to my coworkers and coauthors, who haveworked with me closely over the past five years. I am particularly thankful to Prof. MikaMäntylä, who guided me in designing the experiments and gave me the confidence topublish our results.

Thanks to all of my wonderful colleagues in the M3S research group. This groupprovided a first-class environment that enabled me to learn and grow as a PhD student.It has been a privilege to undertake my doctoral studies in such an environment. I wouldalso like to acknowledge the financial support I received from M3S, Tauno Tönningin,and the Nokia Foundation.

I have had the good fortune to meet several people who became close friends overthe course of my journey. There are so many that it is impossible to name all of themhere, but I truly cherish our friendship and every moment we have spent together.

7

Page 10: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Lastly, my warmest appreciation goes to my father (the most gentleman I know)and my mother (the most generous person I know). Despite the immense distance thatseparates us, they have offered loving encouragement and support throughout my journey.

Oulu, October 2019Alireza Haghighatkhah

8

Page 11: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

List of abbreviations

ASD Agile Software Development

RT Regression Testing

CD Continuous Deployment

CI Continuous Integration

TCP Test Case Prioritization

TCS Test Case Selection

TSM Test Suite Minimization

TSA Test Suite Augmentation

SUT System Under Test

HBTP History-based Test Prioritization

SBTP Similarity-based Test Prioritization

HBD History-based Diversity

APFD Average Percentage of Faults Detected

AMET Average Method Execution Time

VDA Vargha–Delaney A Measure

NCD Normalized Compression Distance

LSH Locality-sensitive Hashing

SMS Systematic Mapping Study

SLR Systematic Literature Review

ASE Automotive Software Engineering

MiL Model-in-the-Loop

SiL Software-in-the-Loop

PiL Processor-in-the-Loop

HiL Hardware-in-the-Loop

SYSiL System-in-the-Loop

ECU Electronic Control Unit

9

Page 12: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

10

Page 13: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

List of original publications

This dissertation is based on the following articles, which are referred to in the text bytheir Roman numerals (I–V):

I Rodríguez, P., Haghighatkhah, A., Lwakatare, L. E., Teppola, S., Suomalainen, T., Eskeli,J., Karvonen, T., Kuvaja, P., Verner, J., & Oivo, M. (2017). Continuous Deploymentof Software-Intensive Products and Services: A Systematic Mapping Study. Journal ofSystems and Software, 123, 263-291.

II Haghighatkhah, A., Banijamali, A., Pakanen, O. P., Oivo, M., & Kuvaja, P. (2017).Automotive Software Engineering: A Systematic Mapping Study. Journal of Systems andSoftware, 128, 25-55.

III Haghighatkhah, A., Oivo, M., Banijamali, A., & Kuvaja, P. (2017). Improving the State ofAutomotive Software Engineering. IEEE Software, 34(5), 82-86.

IV Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018). Test Prioritization inContinuous Integration Environments. Journal of Systems and Software, 146, 80-98.

V Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018). Test Case PrioritizationUsing Test Similarities. In International Conference on Product-Focused Software ProcessImprovement (pp. 243-259). Lecture Notes in Computer Science, vol. 11271. Springer,Cham.

11

Page 14: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

12

Page 15: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Contents

AbstractTiivistelmäAcknowledgements 7List of abbreviations 9List of original publications 11Contents 131 Introduction 15

1.1 Objectives and research questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

1.2 Overview of the research design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1.3 Key findings and implications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

1.4 Dissertation structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2 Background 252.1 Regression testing techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.2 Regression testing and continuous integration . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.3 Continuous test case prioritization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.4 Testing automotive software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

2.5 Research gap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3 Research design 353.1 Research design decisions and rationale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2 Research implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3.2.1 Systematic mapping study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

3.2.2 Technology-oriented experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

4 Original research papers 434.1 Paper I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

4.2 Paper II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4.3 Paper III . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.4 Paper IV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

4.5 Paper V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5 Discussion 535.1 Summary of the results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

13

Page 16: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

5.2 Threats to validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .565.2.1 Construct validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565.2.2 Internal validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.2.3 External validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .585.2.4 Reliability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

5.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595.4 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

6 Conclusions 63References 65Appendices 75Original publications 81

14

Page 17: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

1 Introduction

Software is developed in rapidly changing markets, and software-intensive organizationscontinuously strive to develop approaches for delivering higher-quality software inshorter time-to-market and at lower costs. The manifesto for agile software development(ASD) emerged in 2001, as a response to such needs (Beck et al., 2001). ASD has sincebecome increasingly mainstream in the industry, and research in the area is now wellestablished (Dingsøyr, Nerur, Balijepally, & Moe, 2012). Few leading organizationshave managed to implement ASD to the extent that software is released continuously(Claps, Svensson, & Aurum, 2015). For instance, by May 2011, Amazon was releasinga new version every 11.6 seconds on average, affecting 10,000 hosts simultaneously 1.This number reached 50 million annual deployments by November 2014, an average ofmore than one deployment every second 2.

This phenomenon is commonly known as continuous deployment (CD) (Farley& Humble, 2010). CD is “the ability to bring valuable product features to customers

on demand and at will (deployment) in series or patterns, with the aim of achieving

continuous flow (continuity) and in significantly shorter cycles than traditional lead

times, from a couple of weeks to days or even hours (speed)” (Rodríguez et al., 2017).CD is neither a novel phenomenon nor a buzz, but realizes early and continuous deliveryof valuable software, which is the very first principle of the 12 principles underlyingthe agile manifesto (Beck et al., 2001). The claimed benefits of CD include shortertime-to-market, increased customer satisfaction, rapid and continuous feedback, rapidinnovation, narrower test focus, improved release reliability and quality, and improveddeveloper productivity (Rodríguez et al., 2017).

From the industrial perspective, CD is perceived as a competitive advantage. This isprimarily due to the increasing importance and share of software engineering in manyindustrial sectors. The automotive industry is one such sector; over 80% of its innovationis realized by software-intensive systems (Pretschner, Broy, Kruger, & Stauner, 2007).CD can be implemented to the extent that it brings value to its stakeholders. This caninvolve automatic deployment of software or simply a set of practices that ensure every

1Velocity Culture (the unmet challenge in ops): Presentation at O’Reilly Velocity Conference. Santa Clara,CA, June 16, 2011.2Vogels, W. (2014, November 12). The Story of Apollo - Amazon’s Deployment Engine. Retrieved July 15,2019, from https://www.allthingsdistributed.com/2014/11/apollo-amazon-deployment-engine.html

15

Page 18: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

change can be deployed, on demand and at will. Once CD is in place, the deployment ofsoftware is rather a choice, depending on the underlying business requirements. CD canalso be implemented across organizations and among different development partiesthat aim to improve their inter- and intradevelopment processes. This has particularrelevance for the automotive software development process, because it is organized ina highly vertical manner and involves a large chain of suppliers providing differentcomponents of the vehicle (Pretschner et al., 2007).

Realizing CD in practice requires investment and development in several areas(Adams & McIntosh, 2016; Claps et al., 2015; Mäntylä, Adams, Khomh, Engström, &Petersen, 2015; Rodríguez et al., 2017). Continuous integration (CI) is an agile practiceand arguably the core infrastructure of CD. CI aims to prevent the integration problemknown as “integration hell” and automate the build process and verification of changes(Duvall, Matyas, & Glover, 2007). Each integration cycle is also known as a build cycle.The build comprises a set of automated activities and is followed by regression testing(RT). RT involves running a dedicated test suite after each revision to verify that recentchanges have not negatively impacted the software’s functionality. RT is widely used inthe software industry; it is common to have a dedicated regression test suite that is oftenrun in its entirety (Engström & Runeson, 2010).

Industrial software-intensive systems often comprise many test cases. Each testcase includes “a set of test inputs, execution conditions, and expected results developed

for a particular objective, such as to exercise a particular program path or to verify

compliance with a specific requirement” (IEEE-Std-1012, 2012). The execution oflarge regression test suites requires several hours or even days. For example, theJOnAS Java EE middleware requires running 43,024 test cases to verify all of its 16configurations (Kessis, Ledru, & Vandome, 2005). The software engineering literaturehas proposed many solutions to improving RT processes (Yoo & Harman, 2012). Testcase prioritization (TCP) is one such solution; it involves the ideal ordering of test casesto maximize desirable properties (i.e., early fault detection) (Rothermel, Untch, Chu, &Harrold, 2001). From the fault-detection viewpoint, TCP seems to be a safe approachbecause it does not eliminate test cases and simply permutes them within the test suite.

A large number of TCP techniques has been proposed (Yoo & Harman, 2012).However, many of them cannot be easily applied in CI development environments,because RT in CI is invoked more frequently and in shorter intervals. Thus, approachesthat require exhaustive analysis are overly expensive and inefficient due to the highfrequency of changes, which makes the data gathered (e.g., code coverage) by such

16

Page 19: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

approaches imprecise and obsolete (Elbaum, Rothermel, & Penix, 2014). Furthermore,specific requirements in the automotive software industry have resulted in additionalchallenges for the deployment of TCP techniques. The testing of automotive softwareoccurs in different environments, and the system under test (SUT) varies acrossthese environments (Garousi, Felderer, Karapıçak, & Yılmaz, 2018). Furthermore,implementation details (e.g., source code) may not always be available for the integrationand system testing (Caliebe, Herpel, & German, 2012; Lachmann & Schaefer, 2014).This lack of availability can be due to the contractual agreements between the suppliersand customers (i.e., the original equipment manufacturer or another supplier).

Overall, these challenges have left many practitioners with a single alternative:performing RT only occasionally to save resources. This approach gives rise to severalconcerns, particularly in ASD, in which changes are rapidly introduced and integratedwith the system. This development paradigm calls for more frequent and continuousintegration of changes, consequently increasing the demand for optimized RT. For thesereasons, the automotive software industry is likely to benefit from a TCP technique,

which supports developers to detect regression faults earlier and allows frequent

integration and verification of the changes in CI development environments. Thisdissertation addresses this research gap by proposing an alternative approach basedon prioritizing test cases within the test suite. Employing the candidate solution inpractice, one can expect to detect regression faults earlier and ultimately shorten the RTfeedback cycle (i.e., reduce the time required to provide feedback on RT results) for CIof software-intensive systems.

1.1 Objectives and research questions

In view of the research gap identified above, the objective of this dissertation isto shorten the build cycle in CI environments by detecting regression faults earlier,

allowing software developers to integrate and verify their changes more frequently and

continuously. This objective can be further divided into two parts:

1. Aggregating and analyzing the existing body of knowledge related to the CD ofsoftware-intensive systems and automotive software engineering.

2. Designing and evaluating a TCP technique which improves automotive RT byshortening the build feedback cycle in CI environments.

Accordingly, four research questions (RQs) drive the study:

17

Page 20: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

– RQ1. What do we know about the CD of software-intensive systems?– RQ2. What do we know about software engineering in the automotive industry?– RQ3. How can we shorten the build feedback cycle in CI environments by prioritizing

test cases for the execution?– RQ4. What is the utility of the proposed solution in terms of effectiveness (i.e.,

average percentage of faults detected) and performance (i.e., method execution time)?

RQ1 and RQ2 address the 1st research objective by aggregating and analyzingthe existing knowledge in the literature. RQ3 and RQ4 address the 2nd objective bydesigning and evaluating a TCP technique which addresses the research problem.

1.2 Overview of the research design

This section introduces the research design, which will be further developed in Chapter 3.The research outcome presented in this dissertation is to be considered applied research(Collis & Hussey, 2013; Nunamaker, Chen, & Purdin, 1990), which “provides a solution

to a specific problem by applying knowledge with an aim of improving existing practice

or application” (Wohlin & Aurum, 2015). The research was conducted in the followingthree phases:

– Phase 1. Exploration: The objective of this phase was to explore the literaturerelevant to the subject area and identify research opportunities. During the 1st researchphase, the relevant literature was systematically surveyed to analyze the existingknowledge and identify potential research opportunities.

– Phase 2. Design and Evaluation: The objective of this phase was to develop andevaluate an approach that addresses the research problem. During the 2nd phase, aTCP technique was developed and evaluated accordingly. The research methodologyapplied in this phase was experimentation, and the solution underwent several roundsof improvements and evaluations.

– Phase 3. Research Synthesis: In this phase, the results from the previous two phaseswere synthesized in order to draw conclusions and outline implications.

This dissertation consists of the author’s contributions to the research in the 1st

and 2nd phases and of five original, peer-reviewed publications (referred to as PapersI–V). Figure 1 presents an overview of the research process, including the research gap,research objectives, research phases, research questions, and publications.

18

Page 21: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

The work presented in this dissertation was conducted in the context of two researchprograms, that is, DIMECC Need for Speed 3 and ITEA 3 APPSTACLE 4. Thescope of the DIMECC Need for Speed research program was to provide the Finnishsoftware-intensive industry with the capability for continuous value delivery. The ITEA3 APPSTACLE research program aimed to develop open means and interfaces forcontinuous improvement and deployment of innovative automotive applications andservices.

Fig. 1. Phases of the research process underlying the dissertation.

1.3 Key findings and implications

The key results and implications of the dissertation are briefly presented in this section,and a detailed summary of the original publications is presented in Chapter 4.

Paper I presents a systematic mapping study that classifies the CD literature. Itanalyzes the quality of existing research in terms of scientific rigor and industrial3DIMECC Need for Speed research program: http://n4s.dimecc.com/en/4ITEA 3 APPSTACLE research program: https://itea3.org/project/appstacle.html

19

Page 22: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

relevance. The study describes 10 recurrent themes that characterize CD, and itaggregates the benefits and challenges reported in the previous studies.

Paper II presents a systematic mapping study that classifies and analyzes theliterature related to automotive software engineering in order to provide a structuredbody of knowledge and to identify well-established topics and potential researchgaps. This study provides a panoramic overview and a comprehensive summary of theliterature on automotive software engineering.

On the basis of the results, a published article (Paper III) targets automotive softwarepractitioners and provides a set of recommendations on the basis of existing literature.The recommendations are related to various subjects associated with contemporarysoftware engineering in the automotive industry.

Paper IV presents an experiment in which a TCP technique was developed andevaluated. The experiment was conducted on six open-source Java projects, each ofwhich included several CI builds over a long time period (between 2013 and 2016).Overall, from a pool of 12,995 analyzed builds, 1,330 faulty builds were identified andinvestigated.

The developed technique combines two previously proposed heuristics and is calledhistory-based diversity (HBD). Test diversity, the first heuristic, is a classical heuristicin software testing (e.g., Chen, Leung, and Mak (2004); Jiang, Zhang, Chan, and Tse(2009); Ledru, Petrenko, and Boroday (2009); Leon and Podgurski (2003); Thomas,Hemmati, Hassan, and Blostein (2014)). The core idea is that test cases that capture

the same faults tend to be more similar to each other, and test cases that capture

different faults tend to be more dissimilar. Failure recurrence, the second heuristic,has a particular relevance in CI development environments (e.g., Elbaum et al. (2014);Hemmati, Fang, Mäntylä, and Adams (2017); Kim and Porter (2002); Marijan, Gotlieb,and Sen (2013); Srikanth, Cashman, and Cohen (2016)). This heuristic implies that test

cases that failed in previous builds have a much higher probability of failing again in

the current build.HBD automatically analyzes archived CI build logs and collects information about

the regression test suite (i.e., the list of executed test cases and their verdicts) for eachrevision. Using a simple function, HBD aggregates test cases into several clusters onthe basis of their historical value (i.e., revealed most failure in most recent revisions).Thereafter, HBD iteratively reprioritizes the intracluster tests on the basis of theirdistance (dissimilarity) to the set of already prioritized tests. When archived CI buildlogs are not yet available, HBD aims to maximize diversity as early as possible by

20

Page 23: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

giving higher priority to a test that has maximum distance (is most dissimilar) to the setof already prioritized tests.

Paper IV shows that TCP in CI environments can be performed with negligibleinvestment using build history and that its effectiveness can be further improvedby considering distances among the test cases. From this study, we learned thatsimilarity-based TCP (SBTP) has great potential and can be applied in different contexts,particularly during initial testing, when no information about the SUT is available.SBTP can also be applied in a complementary fashion and combined with other TCPtechniques, as demonstrated previously.

Paper V investigates SBTP more closely. This paper implements five differenttechniques previously proposed in the literature and presents an experiment conductedwith the Defects4j dataset (Just, Jalali, & Ernst, 2014), which contains 395 faults fromsix open-source Java programs (between 2006 and 2015). The findings show thatrunning the most dissimilar test cases early in the testing process largely improvesthe test suite’s fault-detection capability. Of the five implementations investigated,no technique was found to be superior with respect to effectiveness. SBTP usinglocality-sensitive hashing (LSH) was slightly less effective than other investigatedtechniques, but it seems to be more practical when performance becomes critical.

Implications: Taken together, the results of the original publications have importantacademic and practical implications. From the academic perspective, Papers I-III provideresearchers with a synthesized and structured body of knowledge and a basis for futurestudies. Papers IV and V elaborate on the design, implementation, and evaluation of theTCP technique of HBD. These studies provide further empirical evidence in support oftwo previously proposed TCP heuristics–failure recurrence and test diversity–and theircombination in CI development environments.

From a practitioner’s perspective, Papers I-III provide a synthesized database andstructured repository that may facilitate access to and comprehension of state-of-the-artknowledge. Papers IV and V suggest that TCP can be performed in CI environmentswith negligible investment using build history and test distances. For the initial stages,when historical data are scarce or not yet available, one should spread the limited testingbudget evenly across different parts of the system by running the most dissimilar testcases early in the process (i.e., maximizing diversity as early as possible). For the laterstages, when archived build logs are available, one should give higher priority to the testcases that have higher historical value (i.e., those that revealed the most failure in the

21

Page 24: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

most recent revisions) and are most distant from those previously prioritized (i.e., coverdifferent areas of the system).

1.4 Dissertation structure

Figure 2 illustrates the overall structure of the dissertation, which is organized into sixchapters. Following this introductory chapter, Chapter 2 reviews the relevant literatureand positions the dissertation within the broader research arena. Chapter 3 presentsthe research design, including the research phases and detailed information abouttheir implementation. Chapter 4 summarizes the original publications included inthis dissertation. Chapter 5 discusses the results and their implications, including adiscussion of the threats to validity and the limitations of the dissertation, and it identifiesfuture research opportunities. Finally, Chapter 6 offers concluding remarks. Appendix 1provides further technical information about the TCP techniques applied in Papers IVand V.

22

Page 25: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Fig. 2. Dissertation outline.

23

Page 26: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

24

Page 27: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

2 Background

The work presented in this dissertation is positioned in the areas of software-intensivesystems, software development processes, CI, and RT. Section 2.1 presents a generalmodel and definition of RT improvement techniques. Section 2.2 discusses challengesthat arise as the result of the intersection between CI and RT. Section 2.3 summarizes theexisting studies relevant to TCP in CI development environments. Section 2.4 describesthe automotive software testing process and the characteristics of that process thatmake the deployment of RT improvement techniques challenging. Finally, Section 2.5summarizes the research gaps that motivated the dissertation.

2.1 Regression testing techniques

Figure 3 depicts a general model of RT techniques. Let P be a program, P′ be a modifiedversion of the program, and T be a test suite developed for P. In the transition from P

to P′, a previously verified behavior of P may have become faulty in P′. RT seeks tovalidate P′ to ensure that recent changes to the system have not negatively affected anypreviously verified functionalities.

During RT, one can employ several techniques in practice. Test suite minimization(TSM) seeks to identify and permanently eliminate obsolete or redundant test casesfrom the test suite. Test case selection (TCS) aims to select only the subset of testcases affected by the recent changes. TCP involves the ideal ordering of test cases tomaximize desirable properties (i.e., early fault detection). Test suite augmentation (TSA)aims to identify newly added source code and to generate new test cases accordingly.

There is a large body of research on RT, with a great deal of pioneering workpublished in the 1990s (Harrold, Gupta, & Soffa, 1993; Rothermel & Harrold, 1996;Rothermel, Harrold, Ostrin, & Hong, 1998; Rothermel, Untch, Chu, & Harrold, 1999).Several secondary studies of the RT literature were previously identified by a tertiarystudy conducted by Garousi and Mäntylä (2016). The most seminal survey of thesubject area was conducted by Yoo and Harman (2012), who summarized a detailedanalysis of 159 papers and discussed several open problems for future work. Despite thelarge body of knowledge about RT and the many academic advancements in the field,there is relatively little evidence regarding the practical application of RT techniquesin industrial settings (Orso & Rothermel, 2014; Yoo & Harman, 2012). The industry

25

Page 28: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Fig. 3. General model of RT techniques (adapted from Do (2016)).

practice seems to be based mainly on experience rather than on any systematic approachto RT (Engström & Runeson, 2010). To ensure that RT techniques are useful and easilyadopted, contextual factors related to enterprise testing environments must be considered(Do, 2016).

2.2 Regression testing and continuous integration

CI is an agile practice in which software developers integrate their work frequently,often multiple times per day. Each integration cycle (also known as the build cycle)includes a set of automated activities for detecting integration errors as early as possible.During each build cycle, the CI server automatically retrieves recent changes fromthe version control system and invokes a set of preconfigured automated activities,such as compiling, packaging, and RT. Thereafter, the CI server notifies the interestedstakeholders of the relevant information (e.g., build status).

Once CI is in place, a reliable build is always available with minimal manualoverhead (Duvall et al., 2007). Considered a good practice in software development, RTin combination with CI ensures that recent changes do not introduce any regression

26

Page 29: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

into the system. However, this combination presents the software industry with majorchallenges. These challenges have been addressed in the literature, often in isolation 5.

One prevalent challenge in this context is the long build cycle, which is due tothe exhaustive retesting of the system at each revision. To deal with this challenge,researchers have proposed several TCS and TCP techniques, which are designed to beparticularly applicable in CI development environments (Ekelund & Engstrom, 2015;Elbaum et al., 2014; Hemmati et al., 2017; Knauss et al., 2015; Marijan et al., 2013;Memon et al., 2017; Spieker, Gotlieb, Marijan, & Mossige, 2017; Srikanth et al., 2016;Strandberg, Sundmark, Afzal, Ostrand, & Weyuker, 2016; Yoo, Nilsson, & Harman,2011). These techniques aim to select and prioritize test cases for the execution andultimately shorten the build feedback cycle (i.e., reduce the time required to providefeedback on RT results).

Test parallelization & virtualization is another alternative for rapidly executing alarge regression test suite (Bell & Kaiser, 2014; Bell, Melski, Dattatreya, & Kaiser,2015; Gambi, Gorla, & Zeller, 2017; Parsa, Ashraf, Truscan, & Porres, 2016). Testparallelization aims to identify the dependencies among test cases and build a test planto execute them in parallel environments in a cost-efficient manner. Test virtualization,on the other hand, aims to minimize the overhead of isolating each test using a containersharing common resources.

Research has demonstrated that the long build cycle can also be due to the exhaustiverebuilding of the system at each revision (Celik, Knaust, Milicevic, & Gligoric, 2016;Jendele, Schwenk, Cremarenco, Janicijevic, & Rybalkin, 2019; Shi, Thummalapenta,Lahiri, Bjorner, & Czerwonka, 2017; Vakilian, Sauciuc, Morgenthaler, & Mirrokni,2015). The unnecessary dependencies that arise during the build process reduce softwaremodularity and increase the load on the CI server by triggering extra builds and testexecutions. These studies have proposed approaches to reducing the build time throughtechniques such as optimal test placement, decomposing build targets into smaller units,and lazy and partial retrieval of the dependent software libraries that are needed duringthe execution of a build target.

Another challenge is to continuously keep the regression test suite updated as thesystem evolves and new changes are integrated. Several TSA techniques have beenproposed in the literature (e.g., Campos, Arcuri, Fraser, and Abreu (2014); Campos,Fraser, Arcuri, and Abreu (2015); Mirzaaghaei, Pastore, and Pezzè (2014); Robinson,

5The information provided in this section is not exhaustive, but rather indicative of RT challenges in CIdevelopment environments.

27

Page 30: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Ernst, Perkins, Augustine, and Li (2011)). These techniques aim to automatically updatethe regression test suite. Fault localization is another challenge in CI developmentenvironments (Jiang, Zhang, Chan, Tse, & Chen, 2012; Laghari, Murgia, & Demeyer,2016; Ziftci & Reardon, 2017). These studies have proposed approaches to automaticallyidentifying the locations of regression faults in a program while minimizing manualhuman intervention.

2.3 Continuous test case prioritization

TCP has been widely investigated in the literature, and a large number of techniques havebeen proposed. There are several secondary studies of the TCP literature (e.g., Catal andMishra (2013); Rosero, Gómez, and Rodríguez (2016); Singh, Kaur, Suri, and Singhal(2012); Yoo and Harman (2012)). The most recent systematic literature review on TCPtechniques was conducted by Khatibsyarbini, Isa, Jawawi, and Tumeng (2018). Theauthors identified 80 papers and classified existing TCP approaches into nine categories.They concluded that TCP approaches are still generally open for improvement; eachapproach has specific potential values, advantages, and limitations.

TCP can be achieved using a variety of techniques. These techniques rely ondifferent heuristics (e.g., maximizing coverage) and require different input resources.For instance, TCP can be performed using coverage information. This technique isbased on the hypothesis that maximizing coverage of the system as early as possiblecould lead to earlier detection of regression faults. The coverage information can be ondifferent levels (e.g., statement, branch, or method coverage) and can be obtained usingdynamic analysis of the program execution or static analysis of the test and source code.

TCP can also be model based and achieved using specification models of the SUT.These approaches require extra information that may not be commonly available in alldevelopment environments. For instance, Korel, Koutsogiannakis, and Tahat (2007)proposed various model-based TCP techniques, in which different information about thesystem model (i.e., the original and modified system models together with informationcollected during execution of the modified model on the test suite) and its behavior isused to perform TCP. Overall, the deployment of a TCP technique is context dependentand influenced by the availability of input resources.

Several TCP techniques have been proposed for CI development environments.The study by Kim and Porter (2002) was one of the first to apply history-based testprioritization (HBTP). A seminal work in the area is the study conducted by Elbaum

28

Page 31: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

et al. (2014). They performed an empirical study on a large dataset obtained fromGoogle and presented novel TCS and TCP techniques. The proposed approaches arebased on the use of time windows to track how recently test suites were executed andrevealed failures. This information was utilized to select test suites to be executed duringpresubmit testing and to prioritize test suites that must be performed during postsubmittesting.

Several other TCP techniques that rely on historical data have been proposed. Forinstance, Marijan et al. (2013) proposed a TCP technique that relies on previous failureknowledge, test execution time, and domain-specific heuristics to compute the testpriority using a weighted function. Strandberg et al. (2016) presented an experiencereport and proposed an automated tool that aimed to combine priorities of multiplefactors associated with test cases. Spieker et al. (2017) applied reinforcement learningto select and prioritize test cases according to their duration, previous last execution,and failure history. Findings from Srikanth et al. (2016) suggest that ordering buildacceptance tests can significantly impact the efficiency of testing and that the use ofhistorical data is a good heuristic for test prioritization.

A recent experiment conducted by Hemmati et al. (2017) investigated the effec-tiveness of three blackbox TCP techniques on Firefox before and after the transitionto rapid releases. Their results suggest that HBTP is far more effective than othercomparable techniques in rapid releases, although the same conclusion does not hold intraditional development environments. They argued that this superiority may be due tothe recency of historical knowledge, which is a better explanation for its effectiveness ina rapid-release environment than other changes in the development process.

The existing HBTP techniques exhibit minor differences. All the proposed techniquesshare a common heuristic and rely on previous failure knowledge. Failure recurrence isthe name of the heuristic applied. The underlying idea is that test cases that failed in

previous builds have a much higher probability of failing again in the current build.HBTP is easy to implement, but it has inherent limitations. For instance, not allregression faults can be captured effectively if there has been no previous failure, aswith newly added test cases or those that have not previously revealed any failure. Toeffectively detect regression faults, HBTP should be applied in combination with otherTCP techniques.

Coverage-based TCP has been extensively studied (see the latest systematic literaturereview on TCP by Khatibsyarbini et al. (2018)). A common heuristic is maximizingcoverage as early as possible. This can be achieved by assigning a higher rank to the test

29

Page 32: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

cases that cover a part of the system that has not been examined earlier by other testcases (Rothermel et al., 2001). To increase the likelihood of detecting faults, particularlywhen coverage information is unavailable, one can aim to maximize diversity as early aspossible. The core idea is to spread the testing budget evenly across different parts of thesystem by performing a diverse set of test cases.

To maximize diversity as early as possible, one needs to measure similarities amongthe test cases. The concept of similarity measurement is of interest for many applications(e.g., comparative genomics, music classification, plagiarism detection). The degree towhich two objects share characteristics is called similarity, and the degree to which theydiffer is termed distance.

As a classical heuristic, test diversity has been widely applied in the literature. Forinstance, in adaptive random testing, diversity has been applied to distribute the testcases evenly over the input domain (Chen et al., 2004; Jiang et al., 2009). This heuristichas also been applied to perform TCP (Hemmati et al., 2017; Ledru et al., 2009; Leon &Podgurski, 2003; Thomas et al., 2014) and TCS (Cartaxo, Machado, & Neto, 2011;Feldt, Poulding, Clark, & Yoo, 2016; Hemmati, Arcuri, & Briand, 2010, 2013; Hemmati& Briand, 2010). Test diversity has been applied in several other areas, that is, TSM(Cruciani, Miranda, Verdecchia, & Bertolino, 2019), TSA (Ma, Wu, & Chen, 2018;Shahbazi & Miller, 2016), and mutation testing (Shin, Yoo, & Bae, 2017), and has beenused to improve the test case automation process by maximizing reuse (Flemström,Pasqualina, Daniel, Wasif, & Bohlin, 2018).

The underlying idea is that test cases that capture the same faults tend to be more

similar to each other, and test cases that capture different faults tend to be more

dissimilar. The implication for TCP is that a higher priority must be assigned to testcases that are most distant from those already prioritized. To realize this in practice, oneneeds to measure distances among test cases using a specific method and then leveragethis information to perform TCP. This can be realized using a variety of techniques,including metrics that measure the similarity between test cases and algorithms thatmaximize diversity within the test suite as early as possible. This procedure can beautomated and realized by using different properties associated with test cases, such asthe source code (Ledru, Petrenko, Boroday, & Mandran, 2012), test input and output(Henard, Papadakis, Harman, Jia, & Le Traon, 2016), topic models extracted fromtest scripts (Thomas et al., 2014), and even English documents of manual test cases(Hemmati et al., 2017).

30

Page 33: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

2.4 Testing automotive software

Over 80% of innovations in the automotive industry are now realized by software-intensive systems (Pretschner et al., 2007). This is evidenced by premium vehicles,which contain onboard software that is about 100 MLOC (million lines of code) inmagnitude and that is deployed in 50 to 120 embedded microcontrollers (Ebert & Favaro,2017). Software in automotive systems is spread across various application areas, and itranges from low-level control software to advanced driver-assistance and infotainmentsystems. Due to the increasing presence of software in automotive systems, it is criticalto identify and fix faults as early in the development process as possible.

Figure 4 presents the V development process, including X-in-the-loop testing, whichis widely applied in embedded software and the automotive industry (Garousi et al.,2018). The testing of automotive software occurs in various stages and environments,that is, model-in-the-loop (MiL), software-in-the-loop (SiL), processor-in-the-loop(PiL), hardware-in-the-loop (HiL), and system-in-the-loop (SYSiL). These environmentshave different characteristics, and the SUT varies across them.

Fig. 4. The V development process, including X-in-the-loop testing (adapted from Garousi etal. (2018)).

During the initial stages and at the MiL level, the control function and the environ-ment model are developed and tested using a system modeling notation. The SUT atthe MiL level is a system model that is often developed using Matlab Simulink andStateflow. Once the model is developed and verified using MiL, the next stage is SiL,in which the control function is converted to actual source code (partly manually and

31

Page 34: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

partly using automatic approaches). Testing at the SiL level occurs on the source code(i.e., C or C++), which can be deployed and executed on the target platform simulatedusing the environment model. The next stage is PiL, which goes beyond the simulatedenvironment and involves the deployment and testing of binary code deployed on a target(external) processor. Thereafter, at the HiL level, the control software is fully integratedwith the control system, that is, the electronic control unit (ECU). The objective ofHiL testing is to verify the integration of hardware and software in a more realisticenvironment. The final step is SYSiL, in which testing occurs on the physical embeddedsystem.

RT can occur at all stages and can be performed either automatically or manually.This can be a resource-intensive process, because test suites in the automotive industryare often automatically generated and include a large number of test cases (Caliebeet al., 2012; Lachmann & Schaefer, 2014). This can be a challenge, particularly inagile development environments, where changes are rapidly introduced and integratedinto the system. As the automotive industry moves towards the agile developmentparadigm, there will be more frequent and continuous integration of changes. Theadoption of ASD in the automotive industry is evidenced by the many case studies andexperience reports in the literature (Ebert & Favaro, 2017; Hohl, Münch, Schneider, &Stupperich, 2016; Katumba & Knauss, 2014; Manhart & Schneider, 2004; McCaffery,Pikkarainen, & Richardson, 2008). The adoption of ASD consequently increases thedemand for optimized RT. However, deploying existing RT improvement techniques inthe automotive industry is challenging for several reasons.

The testing of automotive software occurs in different environments, that is, MiL,SiL, PiL, HiL, and SYSiL, and the SUT varies across them. Furthermore, automotivedevelopment performs in a distributed environment and involves a large chain ofsuppliers (Pretschner et al., 2007). Software components are often developed by thesuppliers and delivered to the original equipment manufacturer or another supplier forthe integration process. Due to contractual agreements, implementation details (e.g.,source code) are often unavailable for the integration and system testing (Caliebe et al.,2012; Lachmann & Schaefer, 2014). Thus, a candidate RT improvement techniqueshould be independent of the SUT and its implementation details.

A number of studies have investigated RT improvement in the automotive industry.Caliebe et al. (2012) argued that automatically generated test suites are typically largeand have to be reduced by applying TCS and TCP techniques. The authors proposeda TCS and TCP technique that relies on the dependencies between the components

32

Page 35: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

of embedded systems that are derived from the system architecture and requirementspecification. Vöst and Wagner (2016) proposed a TCS technique in order to support CIin the automotive industry. The approach does not require access to the source code andrelies on the signal traces during test execution within the network of ECUs. Arrietaet al. (2018) proposed a TCS technique for the Simulink models that relies on threedifferent antipatterns based on output signals and two similarity metrics (input- andoutput-based similarities). Using test coverage and test diversity, Matinnejad, Nejati,Briand, and Bruckmann (2019) proposed an approach to automatically generating andprioritizing test cases for the Simulink models.

2.5 Research gap

On the basis of the previous sections, three observations can be made:

1. The intersection of CI and RT creates major challenges for software development. InCI development environments, RT is invoked more frequently and in shorter intervals.To maintain the development momentum, (semi)automated techniques are requiredto make the RT both efficient (i.e., reduced execution time) and effective (i.e., earlierdetection of regression faults).

2. A large number of RT improvement techniques have been proposed. However, manyof them cannot be easily applied in CI development environments. Traditional RTimprovement techniques often rely on code-coverage criteria and require exhaustiveanalysis. These approaches are inefficient and overly expensive due to the highfrequency of changes in CI environments, which makes the data gathered (e.g., codecoverage) by such approaches imprecise and obsolete (Elbaum et al., 2014).

3. The deployment of an RT improvement technique is context dependent and influencedby the availability of input resources. The specific characteristics of the automotivesoftware industry should be considered when deploying an RT improvement techniquein an automotive project. The testing of automotive software occurs in differentenvironments, that is, MiL, SiL, PiL, HiL, and SYSiL, and the SUT varies acrossthem. Furthermore, depending on the contractual agreement, implementation details(e.g., source code) are not always available for the integration and system testingprocesses.

Given these observations, a candidate TCP technique must fulfill three requirements:

33

Page 36: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

1. Blackbox: The technique does not require access to the actual source code of theSUT or any representation of it (e.g., specification models). This makes the candidatesolution applicable during integration and system testing, when implementationdetails are not always available due to contractual agreements.

2. Static: The technique does not require the analysis of the SUT’s execution behavior.Thus, a blackbox, static TCP technique requires neither access to the implementationdetails of the SUT nor an analysis of its execution behavior. The only required inputis information about the test cases, which is already encoded in the regression testsuite. This makes such techniques widely applicable and represents an improvementover other TCP techniques, which often require access to the runtime behavior,specification models, or the source code of the SUT.

3. Minimal: The technique can be applied with negligible investment in terms of inputdata. This makes the candidate solution applicable even during the early stages of thedevelopment process, when no information about the SUT is available at hand.

Taking these requirements into account, this dissertation develops and evaluates aTCP technique that aims to improve automotive RT in CI environments. Employingthe candidate solution in practice, one can expect to detect regression faults earlierand ultimately shorten the RT feedback cycle (i.e., reduce the time required to providefeedback on RT results) for CI of software-intensive systems.

34

Page 37: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

3 Research design

The work presented in this dissertation was carried out in three phases: exploration,design and evaluation, and synthesis. Figure 5 illustrates the overall research designprocess. The 1st phase (exploration) included two systematic mapping studies, in whichwe surveyed the literature relevant to the subject area. The objective was to analyze theexisting knowledge and identify research opportunities. During the 2nd phase (designand evaluation), a TCP technique was implemented and underwent several rounds ofimprovement and evaluation. This phase included two experimental studies, and its goalwas to design a solution that meets the requirements identified above and addressesthe research problem. During the 3rd phase (research synthesis), the results from theprevious phases were synthesized in order to draw conclusions and outline implications.

Fig. 5. Research design process.

3.1 Research design decisions and rationale

The research design process involves several phases and decision points. To guidesoftware engineering researchers during the research design, Wohlin and Aurum (2015)

35

Page 38: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

proposed a conceptual framework that includes three design phases and eight decisionpoints. The strategy phase involves a plan that guides the researcher’s execution ofsubsequent research phases, that is, the tactical and operational phases. The strategyphase includes decision-making regarding the outcome, logic, purpose, and approach ofthe research. The next phase is tactical; it involves decision-making regarding how tooperationalize the research activities with respect to research process and methodology.Finally, the operational phase involves decision-making regarding actions that willbe taken during implementation, including data collection methods and data analysistechniques. Figure 6 shows the research phases and design decisions made during theresearch design process.

Fig. 6. Decision points in research design (adapted from Wohlin and Aurum (2015)).

The research outcome (decision point 1) of this dissertation is to be consideredapplied research (Collis & Hussey, 2013; Nunamaker et al., 1990), which “provides

a solution to a specific problem by applying knowledge with an aim of improving

existing practice or application” (Wohlin & Aurum, 2015). This is in contrast withbasic research, which emphasizes understanding the problem and has knowledge as itssole outcome. The research logic (decision point 2) of this dissertation is inductive.Inductive research is based on a bottom-up approach that induces generalizationsfrom specific observations, whereas deductive research takes a top-down approach,working from general conclusions to specific observations. This dissertation is based oninductive arguments built upon results from the literature analysis and experiments on12 open-source Java projects.

36

Page 39: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

The purpose of research can be classified as exploratory, descriptive, explanatory andevaluative research (Collis & Hussey, 2013). The research (decision point 3) presentedin this dissertation is exploratory and evaluative. The research problem was identifiedusing exploratory research by surveying the literature, whereas the utility of the proposedsolution was investigated using evaluative research.

The research approach (decision point 4) taken in this dissertation was pragmatism,which “adopts an engineering approach to research; it values practical knowledge

over abstract knowledge, and uses whatever methods are appropriate to obtain it”(Easterbrook, Singer, Storey, & Damian, 2008). The pragmatic perspective contrasts withthe underlying views of other research approaches, such as positivism, interpretivism,and critical analysis. The research process (decision point 5) combined qualitativeand quantitative research (known as the mixed approach). Qualitative research wasapplied during the exploration phase, whereas quantitative research was applied duringthe design and evaluation phase. Two research methodologies (decision point 6), asystematic mapping study and a technology-oriented experiment, were employed in thisdissertation.

The data collection method (decision point 7) was archival research, which involvesthe systematic collection, analysis, and interpretation of archived data. During theexploration phase, published articles were extracted from bibliographic databases.During the design and evaluation phase, the data were extracted by analyzing softwarerepositories (i.e., build logs from the CI server, change list and source code fromversion control systems) from several open-source projects. The data analysis method(decision point 8) combined qualitative and quantitative analysis. For the systematicmapping studies, qualitative thematic analysis was performed to analyze the dataextracted from the research articles. For the experimental studies, descriptive analysisand nonparametric statistical analysis were performed to investigate the TCP techniqueswith respect to two variables: effectiveness and performance.

3.2 Research implementation

This section describes the research methodologies applied during the 1st phase (explo-ration) and 2nd phase (design and evaluation) of the research.

37

Page 40: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

3.2.1 Systematic mapping study

Following the evidence-based software engineering paradigm (Kitchenham, Dyba, &Jorgensen, 2004), many literature reviews have been published. The main differencebetween a systematic literature review (SLR) and a systematic mapping study (SMS)is that the former aims to “identify best practice with respect to specific procedures,

technologies, methods, or tools by aggregating information from comparative studies”,whereas the latter targets broad research areas and focuses on “classification and

thematic analysis of literature” (Kitchenham, Budgen, & Brereton, 2011).To analyze the existing literature and identify potential research opportunities, we

applied an SMS during the exploration phase. We followed the guidelines for performingSLRs proposed by Kitchenham and Charters (2007) and adapted these guidelines toan SMS, as recommended by Petersen, Vakkalanka, and Kuzniarz (2015). Figure 7illustrates the research process used to conduct the research for Papers I and II.

Fig. 7. Systematic mapping study: Research procedure.

During the planning stage (steps 1–4), a review protocol was developed and usedas a guideline for the rest of the research process. The review protocol included theresearch objective and research questions, search strategy, selection criteria, selectionprocess, data extraction properties, and the procedure for the data extraction, analysis,and interpretation of the results. To identify relevant research (step 5), we conductedsearches on several bibliographic databases, which were selected based on their coverageof the software engineering literature. Paper II also included a domain-specific digital

38

Page 41: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

library, that is, the Society of Automotive Engineers (also known as SAE), whichindexes a wide range of articles related to automotive engineering.

The primary study selection (step 6) was performed using the selection criteriathat were explicitly defined in the review protocol. To minimize the subjectivity of theselection process, each step was conducted by a pair of researchers, and disagreementswere resolved by joint discussion between the coauthors involved in the review. Thedata extraction phase (step 7) was performed individually using the data extractionform previously defined in the review protocol. Thereafter, data extraction forms wereintegrated and conflicts were identified by cross-checking the results. To resolve thesedisagreements, a third reviewer joined the original two reviewers, and the rationale forresolution was discussed with the remaining reviewers in meetings.

During the data analysis and synthesis phase (step 8), we performed a qualitativeanalysis of the primary studies. Paper I had a narrow scope and included an in-depthanalysis of 50 primary studies using both inductive and deductive coding. The analysisprocedure followed the thematic synthesis guideline proposed by Cruzes and Dybå(2011). Paper II had a broader scope and included a qualitative analysis of 679 articles.Both Papers I and II included analysis and classification of the primary studies withrespect to the investigated research subjects, research methodological properties, andpotential research gaps. Paper I further analyzed the quality of existing studies withrespect to scientific rigor and industrial relevance using the framework proposed byIvarsson and Gorschek (2011).

3.2.2 Technology-oriented experiment

The need for experimental software engineering was emphasized in the mid-1980s byBasili, Selby, and Hutchens (1986). Experimentation is a form of empirical enquiry inwhich a researcher manipulates one or more variables, controls all other variables, andinvestigates the effect of the manipulation (Wohlin et al., 2012). In human-orientedexperiments, humans apply different treatments to objects, whereas in technology-oriented experiments, different technical treatments are applied to different objects(Wohlin et al., 2012).

During the design and evaluation phase, we conducted experiments in which weapplied various TCP techniques to different versions of several open-source Javaprograms. Figure 8 illustrates the research process that was applied in Papers IV and V.

39

Page 42: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Figures 8 and 7 share a common research procedure and are different only with respectto the operation phase.

The research design and evaluation phase started with the replication of experimentsconducted by Ledru et al. (2012) and Hemmati et al. (2017). The purpose of thereplication study was to understand what has been proposed previously and how it can beapplied in other contexts as well as to identify potential opportunities for improvement.Thereafter, a research goal was identified, an initial pilot study was conducted, and aresearch protocol was developed (steps 1–4). The research protocol included researchobjectives, initial research questions, and the operation plan for the implementation ofthe experiments.

Fig. 8. Technology-oriented experiment: Research procedure.

The data extraction and preparation was performed in step 5. The data for PaperIV were extracted using the TravisTorrent database (Beller, Gousios, & Zaidman,2017). From a pool of 12,995 analyzed builds, 1,330 faulty builds were identified andinvestigated. For each faulty build, we analyzed archived CI build logs in order toextract information about previous execution of the regression test suite (i.e., the list ofexecuted test cases and their verdicts). Furthermore, we automatically extracted thechanges list and source code behind each revision from the Github repository.

The extracted data were then imported to a database management system for furtherprocessing. A similar procedure was applied in Paper V. However, the latter procedurewas easier, because the data for Paper V were extracted from a dataset called Defects4j

40

Page 43: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

(Just et al., 2014), which contains 395 real faults from six open-source Java programs.The data used in both Papers IV and V are publicly available.

The experiment was implemented in step 6 using Apache Groovy, a modernprogramming language based on Java virtual machine 6. The implementation underwentseveral iterations and validations before the actual experiment was conducted. For eachfaulty build, we performed TCP using different techniques. To compare the investigatedTCP techniques, we measured both effectiveness and performance.

To assess effectiveness, we used an average percentage of faults detected (APFD)metric that was originally introduced by Rothermel et al. (2001) and is widely applied inthe literature (Khatibsyarbini et al., 2018). Let T be an ordered test suite containing n

test cases and F be a set of m faults detected by T ; then T Fi indicates the number of testcases executed in T before capturing fault i. APFD is defined as follows:

APFD = 100∗ (1− T F1 +T F2 + ...+T Fm

nm+

12n

).

The performance was measured using average method execution time (AMET) inseconds and included both the preparation time (e.g., similarity measurement) and theTCP algorithm itself. The experiment was performed in step 7, and the measurementsfor each observation (i.e., each analyzed version of program) were recorded for the nextstep.

During the analysis and interpretation phase (step 8), we retrieved the recordedinformation and conducted a statistical analysis following the guideline proposed byArcuri and Briand (2011). The objective of our analysis was to identify potentialdifferences between the TCP techniques under investigation and to determine theirmagnitude. A Mann–Whitney U-test, which is a nonparametric significance test, wasused to determine whether the difference between two techniques was statisticallysignificant, using p < 0.05 as the significance threshold. The null hypothesis of thistest indicated that there was no significant difference between the effectiveness of thetechniques under evaluation. This test was selected because the studied data may notfollow a normal distribution.

The Mann–Whitney U-test identifies differences between techniques but not themagnitude of such differences. Thus, we used a Vargha–Delaney A (VDA) measure,which is a nonparametric effect size. A VDA measure is a number between 0 and 1.When V DA(x,y) = 0.5, it indicates that the two techniques are equal. When V DA(x,

6Apache Groovy: http://groovy-lang.org/

41

Page 44: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

y)> 0.5, it means x outperformed y, and vice versa. Furthermore, when comparing TCPtechniques, we visualized the distribution of APFDs using violin plots.

42

Page 45: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

4 Original research papers

This section describes the publications included in the dissertation. The publications areall ranked in the JUFO system 7, which is a classification of publication channels createdby the Finnish scientific community to support the quality assessment of academicresearch. Papers I, II, and IV were published in the Journal of Systems and Software

(JUFO 3). Paper III was published in IEEE Software (JUFO 2) and Paper V in theInternational Conference on Product-Focused Software Process Improvement (JUFO 1).

The author of this dissertation had a major involvement and the lead role in everyphase of the research performed in Papers II-V. The author of this dissertation ledthe writing of Papers II-V, and the coauthors provided feedback by reviewing themanuscripts. The 2nd and 3rd coauthors of Paper II contributed to the data collectionand analysis phase and were involved in writing Appendix B of the manuscript. InPaper I, the author of this dissertation was involved in all research phases (i.e., studydesign, writing the review protocol, data collection and analysis, and interpretation ofthe results) and made a major contribution to the manuscript writing (i.e., Sections 2,5.2, 5.7, 5.8, 6, and 8).

A brief summary of original publications is presented in Table 1. The followingsubsections provide an in-depth description of each publication, including its rationale,key results, contributions, and role in the dissertation.

7The Finnish Publication Forum is also known as JUFO, which is derived from the Finnish term “Julkaisufoo-rumi”. The JUFO classification has four levels: 0 = publication channels that do not meet minimum standards;1 = basic; 2 = leading; 3 = top.

43

Page 46: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Table 1. High-level summary of original publications.

Publications Purpose Key Results

Paper I. Rodríguez, P.,Haghighatkhah, A.,Lwakatare, L. E., Tep-pola, S., Suomalainen,T., Eskeli, J., Karvonen,T., Kuvaja, P., Verner,J., & Oivo, M. (2017).Continuous Deployment ofSoftware-Intensive Productsand Services: A SystematicMapping Study. Journal ofSystems and Software, 123,263-291.

Identification andanalysis of the ex-isting literature onCD.

Definition of 10 recurrentthemes that characterize CD,along with its benefits andchallenges. Quality assess-ment of existing studies con-cerning industrial relevanceand scientific rigor. Identi-fication of areas suitable forfurther research.

Paper II. Haghighatkhah, A.,Banijamali, A., Pakanen, O.P., Oivo, M., & Kuvaja, P.(2017). Automotive Soft-ware Engineering: A System-atic Mapping Study. Jour-nal of Systems and Software,128, 25-55.

Identification andanalysis of the ex-isting literature onautomotive soft-ware engineering.

Comprehensive analysis ofliterature related to theresearch focus, researchmethodological properties,and potential research gaps.

Paper III. Haghighatkhah, A.,Oivo, M., Banijamali, A., &Kuvaja, P. (2017). Improv-ing the State of AutomotiveSoftware Engineering. IEEESoftware, 34(5), 82-86.

Aggregationand synthesisof informationfrom academicand practitioner-oriented literature,and develop-ment of a setof practitioner-oriented recom-mendations.

Development of a set ofpractitioner-oriented recom-mendations on the basis ofexisting literature.

44

Page 47: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Table 1. High-level summary of original publications.

Publications Purpose Key Results

Paper IV. Haghighatkhah, A.,Mäntylä, M., Oivo, M., &Kuvaja, P. (2018). Test Prior-itization in Continuous Inte-gration Environments. Jour-nal of Systems and Software,146, 80-98.

Detecting regres-sion faults earlierto allow softwaredevelopers to in-tegrate and ver-ify their changesmore frequentlyand continuously.

For the initial stages, whenhistorical data are not yetavailable or scarce, oneshould spread the limitedtesting budget evenly acrossdifferent parts of the sys-tem by running the most dis-similar test cases early inthe process. For the laterstages, when archived buildlogs are available, one shouldgive higher priority to thetest cases that have higherhistorical value (i.e., thosethat revealed the most fail-ure in the most recent revi-sions) and are most distantfrom those previously exe-cuted (i.e., cover different ar-eas of the system).

45

Page 48: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Table 1. High-level summary of original publications.

Publications Purpose Key Results

Paper V. Haghighatkhah, A.,Mäntylä, M., Oivo, M., &Kuvaja, P. (2018). TestCase Prioritization UsingTest Similarities. In In-ternational Conference onProduct-Focused SoftwareProcess Improvement (pp.243-259). Lecture Notesin Computer Science, vol.11271. Springer, Cham.

Investigation ofwhether SBTP ismore effective atfinding defectsthan randompermutation, andidentification ofthe implementa-tions that lead tobetter results.

To effectively consume alimited testing budget, oneshould spread it evenlyacross different parts of thesystem by running the mostdissimilar test cases earlyin the process. Of the fiveSBTP implementations in-vestigated, no technique wasfound to be superior with re-spect to effectiveness. LSHseems to be more practicalwhen performance becomescritical.

4.1 Paper I

Rationale: Paper I presents a systematic mapping study in which we aggregated,analyzed, and classified the literature on CD. The objective was to provide an overviewof the state of the art on CD, characterize the phenomenon, aggregate reported benefitsand challenges, investigate the scientific evidence in the existing studies, and identifyareas suitable for further research.

Results: An in-depth analysis of the primary studies revealed 10 recurring themesthat characterize CD. These themes were (1) fast and frequent release, (2) flexible productdesign and architecture, (3) continuous testing and quality assurance, (4) automation ofthe entire deployment pipeline, (5) configuration management, (6) customer involvement,(7) continuous and rapid experimentation, (8) postdeployment activities, (9) agileand lean software development, and (10) organizational factors, including integratedcorporate functions, transparency, and an innovative and experimental organizationalculture. The benefits of applying CD include shorter time-to-market, increased customersatisfaction, rapid and continuous feedback, rapid innovation, narrower test focus,improved release reliability and quality, and improved developer productivity.

46

Page 49: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

The challenges were related to the organization-level changes resulting from themove towards CD, customers’ unwillingness to receive continuous releases, increasedquality assurance efforts, and difficulties in applying CD in the embedded domain.The evaluation of the primary studies’ scientific rigor and industry relevance identifiedrelevant limitations to the scientific quality of the existing literature. We concludedthat the research area is still in its infancy and that an increase in the number andimprovement of the rigor of empirical studies is required.

Contribution: The study presents a logical classification of the CD literature inorder to provide researchers with a structured body of knowledge on which to basefuture studies. The study also informs practitioners about the main factors (i.e., recurringthemes) they should consider when deciding whether to migrate to CD, reflecting on thepotential benefits of CD, and anticipating the CD-related challenges they might face.

Thesis Relevance: In the context of this dissertation, the contribution of Paper I is abody of knowledge related to CD, in which “continuous testing and quality assurance”are recognized as essential elements of CD. To realize CD in practice, one needs tominimize manual overhead by automating the entire deployment process. This requiresan automated regression test suite that can be invoked continuously (i.e., frequentlyand in short intervals, as advocated by CD). The execution of a large test suite at eachrevision is not realistic. This is simply because the testing budget is often limited inindustry, and RT needs to make the most of limited resources. Thus, one must effectivelyminimize, select, and prioritize test cases for the execution.

4.2 Paper II

Rationale: Paper II presents a systematic mapping study in which we aggregated,analyzed, and classified the literature on automotive software engineering (ASE). Thereview includes 679 articles from multiple research subareas, published between 1990and 2015. The primary studies were analyzed and classified with respect to five differentdimensions. Furthermore, potential research gaps and recommendations for futureresearch are presented.

Results: Fourteen recurring subjects in the literature were identified. These subjectsare diverse, which indicates the complexity and breadth of ASE research. Three subjects,namely system/software architecture and design, system/software testing, and softwarereuse, were identified as the most frequently addressed areas. Evaluation researchand solution proposals were prevalent in the literature (43% and 22% of the primary

47

Page 50: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

studies, respectively). However, rigorous validation and comparative studies, whichguide industry in the selection of existing solutions in practice, were less common.Surprisingly, a large number of primary studies were not grounded in any researchmethodology (51% of primary studies). Furthermore, many of the case studies in ourreview did not report appropriate details as recommended by previous guidelines. Thesemethodological limitations hinder the future replication, generalization, and aggregationof evidence in the context of ASE.

The majority of existing contributions (50% overall) took the form of technicalconstructs, that is, frameworks, methods, or techniques. However, practitioner-orientedguidelines and concrete tools were less common (4.5% and 11% of the contributions,respectively). From the practical point of view, these figures raise questions regardingthe applicability of the existing solutions (i.e., which approach is more appropriatein what context, and why). Thus, rigorous scientific studies that conduct systematicexploration, validation, and evaluation of the existing knowledge are required to provideguidelines for the selection of existing solutions, technologies, and practices.

Contribution: From the academic point of view, this systematic mapping studyprovides researchers with a structured body of knowledge and a basis for future studies.From the perspective of practitioners, the synthesized and structured body of knowledgemay facilitate access to and comprehension of state-of-the-art knowledge of ASE.

Thesis Relevance: In the context of this dissertation, the contribution of Paper IIwas a panoramic overview and comprehensive summary of the ASE literature. Weobserved that, despite progress in the research area, research themes indicated by theASE roadmap (Pretschner et al., 2007) seem to be both valid and relevant, representingopportunities for future research. Two of these research themes were “improvingdevelopment processes” and “improving quality and reliability”. These themes have aspecial relevance to the problem area investigated in this dissertation.

4.3 Paper III

Rationale: Paper III presents a study in which we aggregated and synthesized infor-mation from academic and practitioner-oriented literature, analyzed the material, anddeveloped a set of practitioner-oriented recommendations. Papers II and III share acommon set of primary studies but differ in terms of scope and target audience. Paper IImainly targets the ASE research community and communicates through an academic

48

Page 51: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

channel. However, Paper III presents results in a more accessible and shorter format,targeting ASE practitioners.

Results: The results include a set of recommendations concerning six differentareas: software architecture, software quality assurance and testing, requirementengineering, agile practices, variability management, and software reuse. Apart fromthese recommendations, we provided public access to the full list of analyzed studiesand data extraction results.

Contribution: The main contribution is a thorough characterization and analysis ofthe state of knowledge and a set of practitioner-oriented recommendations.

Thesis Relevance: An important challenge in automotive system integration isthe effective synthesis and deployment of software functions. The syntactical andtechnological integration-related challenges are often addressed during the designphase by using a standardized architecture (Giese, Neumann, Niggemann, & Schätz,2007). However, more demanding integration problems, such as semantic integrationand system dependability, are handled late in the integration process (Giese et al.,2007). ASD advocates frequent and continuous integration of the changes. To performintegration as often and as early as possible, practitioners should automate the integrationprocedure and invest in virtualized integration platforms. This makes CI possible duringthe development process and minimizes dependency on other parts of the system thatmay be unavailable at the time. CI systems enable more frequent and continuousintegration of changes. Consequently, there is an increased need for optimized RT in theautomotive industry.

4.4 Paper IV

Rationale: Paper IV reports an experiment in which we examined TCP in CI envi-ronments. The objective of this study was to catch regression faults earlier, allowingsoftware developers to integrate and verify their changes more frequently and continu-ously. To achieve this, we investigated six open-source projects, each of which includedseveral CI builds over a long time period (a total of 1,330 faulty builds between 2013and 2016).

Results: Only a small proportion of tests failed with our subjects (less than 11% infour projects, and 3–52% overall). This indeed underlines the importance of TCP in CIenvironments, in which RT is performed more frequently and continuously. Furthermore,the majority of regression faults (57–97%) among all investigated projects can be

49

Page 52: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

captured using only previous failure knowledge. This implies that previous failureknowledge has strong predictive power in CI environments and can be used to effectivelyprioritize tests. HBTP does not necessarily require a large amount of historical data, andits effectiveness improves to a certain degree with a larger history interval. Even withthe last verdict (current−1), improvement (VDA: 0.53–0.82) in terms of APFD wasobserved in all investigated projects in comparison to random ordering.

In our experiments, we performed diversity-based TCP using three different similaritymetrics, that is, Manhattan, normalized compression distance (NCD), and NCD multisets.Appendix 1 provides further technical information about the similarity metrics andTCP techniques applied. Our results suggest that diversity-based TCP can be usedeffectively during the early stages, in which no historical data are available (VDA:0.68–0.91, improvement observed using NCD multisets) or can be combined withHBTP to improve its effectiveness (VDA: 0.51–0.73, using NCD multisets). Amongthe investigated TCP techniques, we found that HBD using NCD multisets is superiorin terms of effectiveness but introduces relatively high overhead in terms of methodexecution time.

Contribution: Taken together, the results imply that HBTP can be employed inpractice with negligible investment and that its effectiveness can be further improved byconsidering distances (dissimilarities) among the tests. The main contribution of thisstudy is the design, implementation, and evaluation of a TCP technique, that is, HBD.The study further contributes to the literature by providing empirical evidence in supportof two previously proposed TCP heuristics (i.e., failure recurrence and test diversity)and their combination in CI development environments.

Thesis Relevance: In the context of this dissertation, the contribution of Paper IV isthe design and evaluation of a TCP technique that can be applied in CI developmentenvironments. HBD is a blackbox and static TCP technique. HBD relies only on theinformation already encoded in the test suite, which makes it a minimal technique thatcan be applied without any precollected input data. HBD can also automatically analyzearchived CI build logs (when they are available) and incorporate historical data whileperforming TCP.

50

Page 53: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

4.5 Paper V

Rationale: Paper V reports an experiment in which we investigated various SBTPtechniques 8. The objective was to determine whether SBTP is more effective at findingdefects than random permutation and to identify the SBTP implementations that lead tobetter results. To achieve our objective, we implemented five different techniques fromthe literature and conducted an experiment using the Defects4j dataset.

Results: Test suites ordered by SBTP were largely more effective at finding defectsthan random permutation (VDA: 0.76–0.99, observed using NCD across all subjects).This indicates that running the most dissimilar test cases early in the testing process(maximizing the diversity) improves the test suite’s fault-detection capability. This wasalso verified by our sanity check, in which the reverse approach was applied (VDA:0.03–0.34). Of the five SBTP implementations investigated, no technique was found tobe superior with respect to effectiveness. SBTP using LSH was slightly less effectivethan other SBTP techniques (VDA: 0.38 observed in comparison to NCD), but it seemsto be more practical when performance becomes critical.

Contribution: Taken together, these results bring to mind the well-known adage“don’t put all your eggs in one basket”. To effectively consume a limited testing budget,one should spread it evenly across different parts of the system by running the mostdissimilar test cases early in the process. This study contributes to the literature byproviding empirical evidence in support of test diversity and its impact on TCP.

Thesis Relevance: From the previous study (Paper IV), we learned that SBTPrequires minimal information and has a broad range of potential applications, particularlyduring initial testing, when no information about the SUT is available. SBTP is aninteresting approach when code instrumentation is impossible or too costly. SBTP canalso be applied in a complementary fashion and combined with other TCP techniques, asdemonstrated in Paper IV. Paper V investigates SBTP more closely. In the context of thisdissertation, the contribution of Paper V is its empirical evaluation of the effectivenessand performance of various SBTP techniques.

8In the context of Paper V, we intentionally used the term "SBTP" rather than "diversity-based TCP". As notedin Section 5.4 (future work), SBTP has a broader application area and can be applied to realize differentexploitation strategies, that is, intensification and diversification.

51

Page 54: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

52

Page 55: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

5 Discussion

This chapter presents a synthesis of the dissertation’s main findings. The summary ofresults, along with their implications, is presented in Section 5.1. Section 5.2 discussesthreats to the validity of the results and the countermeasures taken during the researchprocess. The limitations of the dissertation are discussed in Section 5.3. Finally, Section5.4 identifies and discusses potential areas of investigation for future research.

5.1 Summary of the results

The objective of this dissertation was to shorten the build cycle in CI environments by

detecting regression faults earlier, allowing software developers to integrate and verify

their changes more frequently and continuously. Accordingly, four research questionswere posed, and they were addressed in three research phases.

The research started with the exploration phase, in which we investigated the litera-ture using two systematic mapping studies to identify potential research opportunities.The need for these reviews emerged in the context of the DIMECC Need for Speed andITEA 3 APPSTACLE research programs. Findings from this research phase suggest thatCD of software-intensive systems requires development and investment in several areas.CD calls for more frequent and continuous integration of changes, which consequentlyincreases the demand for optimized RT.

The execution of a large test suite at each revision is not realistic. This is simply dueto the fact that the testing budget is often limited in industry, and RT needs to make themost of limited resources. Thus, one must effectively minimize, select, and prioritizetest cases for the execution. From the fault-detection viewpoint, TCP seems to be a safeapproach, because it does not eliminate test cases and simply permutes them within thetest suite. The goal of permutation is to detect defects as early as possible. In this way,any partial execution of the regression test suite detects the maximum number of defectsfor the given budget.

During the design and evaluation research phase, we reviewed all existing secondarystudies on RT, which were identified by a tertiary study conducted by Garousi andMäntylä (2016). Thereafter, we conducted several searches on bibliographic databasesto identify studies that focused on RT improvement in CI development environments.

53

Page 56: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

On the basis of our analysis and results from the exploration phase, we identified a set ofchallenges and requirements (see the discussion of research gaps in Section 2.5).

We observe that the previously proposed techniques exhibit minor differences.(Elbaum et al., 2014; Hemmati et al., 2017; Kim & Porter, 2002; Marijan et al., 2013;Spieker et al., 2017; Srikanth et al., 2016; Strandberg et al., 2016). These techniquesoften share a common heuristic. Failure recurrence is the name of the heuristic applied,and it indicates that test cases that failed in previous builds have a much higher

probability of failing again in the current build. Existing studies have suggestedthat HBTP can be effectively applied in CI environments. However, it has inherentlimitations. For instance, not all regression faults can be captured effectively if there hasbeen no previous failure, as with newly added test cases or those that have not previouslyrevealed any failure. Thus, HBTP needs to be applied in combination with other TCPtechniques.

A well-known heuristic in software testing is to maximize coverage as early aspossible (Rothermel et al., 2001). To increase the likelihood of detecting faults,particularly when coverage information is unavailable, one can aim to maximizediversity as early as possible. The core idea is to spread the testing budget evenly acrossdifferent parts of the system by performing a diverse set of test cases. This heuristicimplies that test cases that capture the same faults tend to be more similar to each other,

and test cases that capture different faults tend to be more dissimilar.By taking both heuristics into account, one can perhaps detect regression faults more

effectively than by applying them individually. HBD realizes this idea and combinesthe heuristics simultaneously. HBD is a blackbox, static, and minimal TCP technique.One might argue that whitebox TCP techniques are more effective than blackboxtechniques, because the former have access to information about the SUT (e.g., codecoverage). However, results from an experiment conducted by Henard et al. (2016)show a negligible difference between the effectiveness of whitebox and blackbox TCPtechniques, that is, at most a 4% fault-detection-rate difference. This suggests thatblackbox TCP techniques can be applied effectively where they are appropriate withouta substantial compromise in the effectiveness of fault detection.

HBD is by definition a static technique, but it does not perform any exhaustive staticanalysis on the test cases, such as symbolic execution. The similarity measurementapplied in HBD is based on lexicographic information associated with the test cases.Theoretically, it can be applied to all objects independent of their underlying structure.The other side of the coin is that this approach does not necessarily capture the semantics

54

Page 57: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

behind the test cases. For instance, two test cases might be considered similar eventhough they are distant and correspond to different execution paths. This limitation wasdiscussed by Ledru et al. (2012).

Given this limitation of HBD, one might argue that the coverage of “maximizingdiversity as early as possible” cannot be as perfect as “maximizing coverage as earlyas possible”. This holds true. Yet, according to the study conducted by Henard et al.(2016), from the fault-detection perspective, the difference between these two strategiesis minor. Furthermore, results from an experiment by Feldt et al. (2016) show that testsets with higher diversity (measured using NCD multisets) have higher structural andfault coverage in comparison to random selection. Thus, maximizing diversity as earlyas possible is a plausible strategy when coverage information is unavailable. In this way,we cast a wide net to detect a higher number of unique faults in the system.

HBD is a minimal TCP technique in the sense that the only information required isalready encoded in the regression test suite, that is, information about individual testcases. Using such information, HBD can maximize diversity within the test suite asearly as possible. During the later stages, when archived build logs are available, it canautomatically analyze failure history and incorporate this knowledge during TCP. Theraw build log, which is one of the outputs of CI builds, can be automatically collectedfrom any CI server with the help of a simple script. One might assume that a largeamount of historical data is required. However, our results suggest that HBD does notnecessarily require a large amount of historical data and that its effectiveness improvesto a certain degree with a larger history interval.

Implications: Taken together, the results from previous research phases haveimportant academic and practical implications. From the academic perspective, resultsfrom the systematic mapping studies provide researchers with a synthesized andstructured body of knowledge and a basis for future studies. The results from experimentsprovide empirical evidence in support of two previously proposed TCP heuristics–failurerecurrence and test diversity–and their combination in CI development environments.

From the practitioner’s perspective, results from the systematic mapping studiesprovide a synthesized database and structured repository that may facilitate access to andcomprehension of state-of-the-art knowledge. In addition, results from our experimentssuggest that TCP in CI environments can be performed with negligible investment usingbuild history and test distances. For the initial stages, when historical data are scarce ornot yet available, one should spread the limited testing budget evenly across differentparts of the system by running the most dissimilar test cases early in the process (i.e.,

55

Page 58: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

maximizing diversity as early as possible). For the later stages, when archived build logsare available, one should give higher priority to the test cases that have higher historicalvalue (i.e., those that revealed the most failure in the most recent revisions) and are mostdistant from those previously executed (i.e., cover different areas of the system).

5.2 Threats to validity

In the context of this dissertation, validity threats are classified into four distinctcategories: construct validity, internal validity, external validity, and reliability (Wohlinet al., 2000). This section discusses the threats to the validity of the research along withthe countermeasures taken during the research process.

5.2.1 Construct validity

Construct validity concerns the representativeness of the measures used to represent theconcepts under investigation. The most important threat to the construct validity ofsystematic reviews relates to the identification of primary studies, that is, the searchstrategy and how well the data represent the phenomenon of interest. To mitigate theseissues and reduce the risk of missing relevant studies, we followed an iterative approachand employed a search strategy that allowed us to identify as many primary studies aspossible.

In Paper I, several known studies of CD were collected manually and closelyinvestigated in order to better understand the phenomenon. Due to the undefined natureof the phenomenon under investigation, we developed a comprehensive search stringwith the aim of minimizing the risk of missing relevant studies. Our search string wasbased on three main attributes: deployment, continuity, and speed (and terms closelyrelated to them). In Paper II, we performed several experimental searches and calculatedthe noise (the proportion of irrelevant studies to all retrieved records) and accuracy rate(the proportion of relevant studies to all retrieved records). This was possible using acandidate set of papers (87 studies of ASE) that were previously identified by conductinga search on Google Scholar. Given the broad scope of our subject, we performed severalcomplementary searches with the aim of increasing the coverage of published studies.

Even though the objective of systematic reviews is to identify all relevant researchon the subject of interest, it is more likely that such reviews capture only a sample of therelevant articles (Wohlin et al., 2013). One reason for this problem is that various groups

56

Page 59: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

and research communities within the software engineering discipline use differentterms to refer to the same phenomenon. Thus, achieving 100% coverage of existingpublications is challenging. The objective of our search strategy was to retrieve as manyprimary studies as possible within the scope of the research. Our search strategy hadan iterative design and was revised based on the several design decisions that werethoroughly discussed in the original publications.

The selection of primary studies is another threat to the construct validity of literaturereviews. For instance, primary studies may be excluded as a result of the researcher’sbias, subjective evaluation, or misjudgment of the study under evaluation. To mitigatethis threat, a thorough research protocol and a set of explicit inclusion and exclusioncriteria were established. To minimize the subjectivity of the selection process, eachstep was conducted by a pair of researchers, and disagreements were resolved with thehelp of a third reviewer. Publication bias is another threat to the construct validity ofliterature reviews. This bias arises from “the problem that positive research outcomes

are more likely to be published than negative ones”. This problem particularly concernsSLRs that aim to aggregate existing evidence and to evaluate and compare specificmethods or techniques. However, in SMSs, the effect of this threat is trivial, becausesuch analyses are usually not performed.

In the context of experiments (Papers IV and V), threats to construct validity concernthe use of proper measures and whether researchers are in fact measuring what theyintend to measure. To assess the effectiveness of TCP techniques, we applied the APFDmetric, which was originally introduced by Rothermel et al. (2001) and is the mostfrequently used metric in the TCP literature (Khatibsyarbini et al., 2018). Apart fromeffectiveness, we measured AMET in order to assess the performance of the techniquesunder investigation.

5.2.2 Internal validity

Threats to internal validity concern the relationship between constructs and proposedexplanations. In the context of SMSs, internal validity is related to the researcher’s biasin the extraction, analysis, and interpretation of data. To minimize the effect of thisthreat, a data extraction form was developed. This form was piloted using a small set ofprimary studies in order to establish a common understanding between the researchers.The data extraction, analysis, and interpretation of primary studies were performed bypairs of researchers at all stages, and disagreements were further resolved with the help

57

Page 60: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

of a third researcher and collective discussion. This enabled triangulation in all researchphases and minimized the possibility of researcher bias.

In the context of experimental studies, threats to internal validity are associated withpotential faults in implementation (e.g., TCP algorithms or the experiment itself). Tominimize the likelihood of errors in our implementation, we took several countermea-sures into consideration. For instance, to validate the data gathered from build logs,we randomly selected several build logs from each project and manually verified theextracted data. Our implementation was piloted on a small sample before running theactual experiment. Furthermore, the implementation and results were discussed andreviewed by the coauthors in regular meetings. Overall, our implementation underwentseveral iterations and validations before the actual experiment was conducted.

5.2.3 External validity

This validity threat concerns the potential generalizability of the results outside thesubject area in which they were originally investigated. In Papers I and II, externalvalidity is closely related to our search strategy and the question of whether the datarepresent the investigated phenomenon. Paper I had a narrow scope and included allexisting studies on the subject area published between 2001 and 2014. Paper II had abroad scope but included a large and representative sample of relevant studies. Thisreview included 679 studies from multiple research subareas, published between 1990and 2015. These studies were published in over 289 unique publication venues andinclude author affiliations with 398 unique institutions in 35 countries. These figuresmay indicate that our primary studies are not limited to or biased towards a specific timeperiod, publication venue, research institute, or geographical area.

In the context of experimental studies (Papers IV and V), threats to external validityconcern whether the subjects of our studies are representative of real programs. InPaper IV, we investigated six open-source software projects, each of which includedseveral builds over a long period of time (a total of 1,330 faulty builds between 2013and 2016). In Paper V, we investigated another six open-source software projects thatwere extracted from the Defect4j dataset (a total of 395 faulty builds between 2006and 2015). Thus, the subjects of our experiments are real-world software projects andinclude real-world CI builds, test suites, and regression faults.

58

Page 61: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

5.2.4 Reliability

Threats to reliability concern the repeatability of the research and the possibility ofcoming to the same conclusion reached by the original study. In context of SMSs,the search process and retrieval of the studies are part of an objective process thatmust be repeatable by strictly implementing the same research protocol. However, theprimary study selection and the data extraction, interpretation, and classification of theliterature were subjective and belong to the categories of research creativity and researchcontribution.

In the context of experimental studies, repeatability required access to the data thatwere used and a thorough report on the research process that was applied. The studydesign, along with a careful explanation of our implementation, was reported in theoriginal publications. Furthermore, the data we used in both of our experiments, that is,TravisTorrent (Beller et al., 2017) and Defect4j (Just et al., 2014), are publicly available.

5.3 Limitations

The problem formulation and solution development in this dissertation were based on theliterature analysis and on the author’s limited experience in the software industry. Thedata collection method was archival research, and the experiments were conducted in alaboratory setting rather than in an industrial context. Consequently, our conclusions arebased on the literature analysis and the ex post analysis of software artifacts. Therefore,limited connection with industry is the 1st and main limitation of the dissertation.Needless to say, design decisions during the research process (see Section 3.1) weremade on the basis of the research problem, and the author faced several constraints.

The 2nd limitation of this dissertation is related to the metrics used in our experiments.The APFD metric used in our experiments was concerned with the number of test casesexecuted rather than the actual RT time. To perform a comprehensive assessment, oneneeds to measure the end-to-end time, that is, the TCP execution time, in addition to theactual test suite execution time. Such measurement requires downloading, compiling,and running the test suite for all the revisions examined. This procedure involves manualeffort and was not possible due to the large number of faulty revisions analyzed inour experiments (1,330 in Paper IV and 395 in Paper V). The automation of the entireprocedure was technically possible, but it was infeasible given the scope and constraintsof our studies.

59

Page 62: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

The 3rd limitation–closely related to the 1st–is the lack of a research framework withwhich to guide the design and evaluation of the solution in a systematic and iterativemanner. To address this limitation, design science research (Hevner, March, Jinsoo,& Ram, 2004) could have been applied. The design science research methodology(Hevner et al., 2004; Peffers, Tuunanen, Rothenberger, & Chatterjee, 2007) includesseveral research cycles and concrete procedures that guide researchers in the effectivedevelopment and evaluation of industry-oriented solutions. Design science researchrequires close collaboration with industry and planning during the early stages of theresearch process.

The 4th limitation is related to the design of the HBD technique. Failure recurrence,which is one of the heuristics we applied, assumes that test cases have deterministicoutcomes. However, this assumption does not always hold. There are test cases knownas “flaky tests” that, for one reason or another, have nondeterministic outcomes. Thepractice commonly used to deal with a flaky test is the rerun technique, that is, runningthe failing test multiple times to determine its verdict (Luo, Hariri, Eloussi, & Marinov,2014). The rerun technique is supported by several testing frameworks and is enabledby the use of annotations in Java. For instance, Android has @FlakyTest 9, Springhas @Repeat 10, and JUnit has an extension 11 for labeling a test that requires rerunsupon failure. To minimize its impact, one needs to distinguish whether a failure isdue to a flaky test or a recently introduced regression. This can be done by processingannotations or applying an automated approach such as DeFlaker, which was recentlyproposed by Bell et al. (2018). Once flaky tests have been identified, one needs to devisestrategies for minimizing their impact when performing TCS and TCP using historicaldata. To the best of our knowledge, these issues have not been widely investigated,particularly in the context of RT improvement techniques.

5.4 Future work

From an academic perspective, the results of this dissertation indicate several opportuni-ties for further research. One such opportunity is the implementation of HBD in thesoftware industry and its evaluation with respect to several variables. The utility ofHBD in our experiments was evaluated using two variables: effectiveness (i.e., average

9https://developer.android.com/reference/android/test/FlakyTest10https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/annotation/Repeat.html11https://github.com/artsok/rerunner-jupiter/

60

Page 63: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

percentage of faults detected) and performance (i.e., method execution time). However,other variables, such as efficiency (i.e., the extent to which the technique reduces theoverall RT time), scalability (i.e., the ability to work with large regression test suites),and generality (i.e., the ability to operate in a wide range of situations), should beconsidered. Once HBD is integrated with the CI server, measurements with respect toseveral variables can be automatically recorded. Furthermore, qualitative data can begathered from practitioners to investigate the generality of HBD and identify potentialareas for its improvement.

Using qualitative data from practitioners, one can also identify and incorporatethe domain expert knowledge and other heuristics into TCP. HBD has a two-stageprioritization mechanism, that is, scoring and clustering test cases on the basis of theirhistorical value (i.e., those that revealed the most failure in the most recent revisions)and then iteratively reprioritizing the intracluster tests on the basis of their distance tothe set of already prioritized tests. The 1st stage can be easily expanded to incorporateother heuristics, e.g., newly added test cases should have a higher priority, because theymay correspond to the recent changes in the system. In this way, one can calculatepriorities for the test cases from several perspectives, combine them into a single value,and cluster test cases accordingly. The 2nd stage aims to maximize diversity as early aspossible and can be performed regardless of what was done in the previous stage.

To maximize diversity as early as possible, one needs to measure the similaritiesamong the test cases and then leverage this information to prioritize them. The similaritymeasurement in our experiments was performed using lexicographic informationassociated with the test cases. However, this approach does not necessarily capture thesemantics behind the test cases, which may lower the precision of measurement. Futurestudies are required to investigate approaches that can capture more information abouttest cases (e.g., the syntactic structure or semantics of a program) and perform similaritymeasurement with higher precision. This improvement in precision should not comewith a high overhead; otherwise, its application will remain merely theoretical.

Once similarity measurement has been performed, this information should beexploited to perform prioritization. One could argue that diversification is the beststrategy when no strong clues about fault-revealing test cases are available. The oppositeviewpoint favors the intensification strategy, according to which the testing budget isconsumed by and around the most probable fault-revealing test cases. Theoretically,both strategies can be applied simultaneously (i.e., intensification where necessaryand diversification of the remaining budget). However, making decisions about when

61

Page 64: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

and how to apply these strategies, either individually or in combination, remains achallenge. To the best of our knowledge, neither the application of these strategiesnor their relevance and impact have been widely investigated by researchers. Theonly exception we are aware of is the recent study by Patrick and Jia (2017), whichinvestigated the trade-off between the two exploitation strategies in adaptive randomtesting.

Regardless of which exploitation strategy is chosen, a TCP algorithm needs toiteratively find the item that is most (dis)similar to the set of already prioritized testcases. This can be realized using a pairwise algorithm. However, it comes with thecost of pairwise comparison, and its performance becomes inefficient as the test suitebecomes larger. The underlying issue can be defined as a similarity search problem,which involves searching within a large set of objects for a subset of objects that closelyresemble a given query object. In this dissertation, we have investigated LSH, which wasoriginally introduced by Indyk and Motwani (1998) and recently proposed by Miranda,Cruciani, Verdecchia, and Bertolino (2018) to be applied in TCP. However, severalother approaches have been proposed for the similarity search problem. To effectivelyapply them to software engineering problems, the existing body of knowledge must beexplored systematically and potential approaches need to be investigated and adapted.

To achieve continuous RT, one needs to implement several RT techniques. Thesetechniques can be applied in combination and in a complementary fashion, usingcommon input resources available in any CI development environment. TCS can beapplied during the presubmission phase, when changes have not yet been integrated withthe repository and immediate feedback is required. TCS can be effectively performedusing build history (e.g., Ekelund and Engstrom (2015); Elbaum et al. (2014); Knauss etal. (2015); Spieker et al. (2017)). TCP should be performed independently and duringpostsubmission testing. TCP can also be applied in combination with TCS and duringpresubmission testing. In this way, we not only run the subset of test cases affected bythe recent changes but do so in an order that enables the earlier detection of regressionfaults. TSM should also be applied frequently. This can be achieved even withoutcode-coverage criteria and by using the distances among the test cases (Cruciani et al.,2019; Feldt et al., 2016). Future studies are required to integrate these techniques into acomprehensive solution that can be easily adopted in the software industry.

62

Page 65: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

6 Conclusions

RT in combination with CI is considered a good software development practice, becauseit ensures that recent changes do not introduce any regression into the system. However,the combination creates several challenges for the software industry. The execution of alarge test suite at each build cycle is not realistic. This is simply because the testingbudget is often limited in industry, and RT needs to make the most of limited resources.To detect regression faults earlier, one alternative is to permute the test cases within thetest suite.

This dissertation aims to shorten the build cycle in CI environments by detectingregression faults earlier, allowing software developers to integrate and verify theirchanges more frequently and continuously. The research was performed in three phases.In the 1st phase, the relevant literature was systematically surveyed to analyze theexisting body of knowledge and identify the potential research opportunities. In the 2nd

phase, the TCP technique of HBD was developed and underwent several rounds ofimprovements and evaluations. The technique has a two-stage prioritization mechanism,that is, scoring and clustering test cases on the basis of their historical value and theniteratively reprioritizing the intracluster tests on the basis of their distance to the set ofalready prioritized tests. In the 3rd phase, results from the previous two phases weresynthesized in order to draw conclusions and outline implications.

Our results bring to mind the well-known adage “don’t put all your eggs in onebasket”. For the initial stages, when no information about the SUT is available, oneshould spread the limited testing budget evenly across different parts of the system byrunning the most dissimilar test cases early in the process (i.e., maximizing diversity asearly as possible). For the later stages, when historical build data are available, oneshould give higher priority to the test cases that have higher historical value (i.e., thosethat revealed the most failure in the most recent revisions) and are most distant fromthose previously prioritized (i.e., cover different areas of the system).

A major contribution of this dissertation is the design, implementation, and ex-perimental evaluation of a TCP technique that can be applied in CI environments.Our experiments provide empirical evidence in support of two previously proposedTCP heuristics (i.e., failure recurrence and test diversity) and their combination inCI development environments. Furthermore, results from the systematic mapping

63

Page 66: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

studies contribute to the literature by providing a synthesized and structured body ofknowledge and a basis for future studies. We conclude that TCP can be performed in CIenvironments with negligible investment using build history and test distances.

64

Page 67: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

References

Adams, B., & McIntosh, S. (2016). Modern release engineering in a nutshell–whyresearchers should care. In 2016 ieee 23rd international conference on software

analysis, evolution, and reengineering (saner) (Vol. 5, pp. 78–90).Arcuri, A., & Briand, L. (2011). A practical guide for using statistical tests to assess

randomized algorithms in software engineering. In Software engineering (icse),

2011 33rd international conference on (pp. 1–10).Arrieta, A., Wang, S., Arruabarrena, A., Markiegi, U., Sagardui, G., & Etxeberria, L.

(2018). Multi-objective black-box test case selection for cost-effectively testingsimulation models. In Proceedings of the genetic and evolutionary computation

conference (pp. 1411–1418).Basili, V. R., Selby, R. W., & Hutchens, D. H. (1986). Experimentation in software

engineering. IEEE Transactions on software engineering(7), 733–743.Beck, K., Beedle, M., van Bennekum, A., Cockburn, A., Cunningham, W., Fowler, M.,

. . . Sutherland, J. (2001). Manifesto for agile software development (Tech. Rep.).The Agile Alliance.

Bell, J., & Kaiser, G. (2014). Unit test virtualization with vmvm. In Proceedings of the

36th international conference on software engineering (pp. 550–561).Bell, J., Legunsen, O., Hilton, M., Eloussi, L., Yung, T., & Marinov, D. (2018).

Deflaker: Automatically detecting flaky tests. In Proceedings of the 40th

international conference on software engineering (pp. 433–444). ACM. doi:10.1145/3180155.3180164

Bell, J., Melski, E., Dattatreya, M., & Kaiser, G. E. (2015). Vroom: Faster buildprocesses for java. IEEE Software, 32(2), 97–104.

Beller, M., Gousios, G., & Zaidman, A. (2017). Travistorrent: Synthesizing travis ciand github for full-stack research on continuous integration. In Proceedings of the

14th international conference on mining software repositories (pp. 447–450).Caliebe, P., Herpel, T., & German, R. (2012). Dependency-based test case selection

and prioritization in embedded systems. In Software testing, verification and

validation (icst), 2012 ieee fifth international conference on (pp. 731–735).Campos, J., Arcuri, A., Fraser, G., & Abreu, R. (2014). Continuous test generation:

enhancing continuous integration with automated test generation. In Proceedings

65

Page 68: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

of the 29th acm/ieee international conference on automated software engineering

(pp. 55–66).Campos, J., Fraser, G., Arcuri, A., & Abreu, R. (2015). Continuous test generation on

guava. In International symposium on search based software engineering (pp.228–234).

Cartaxo, E. G., Machado, P. D., & Neto, F. G. O. (2011). On the use of a similarityfunction for test case selection in the context of model-based testing. Software

Testing, Verification and Reliability, 21(2), 75–100.Catal, C., & Mishra, D. (2013). Test case prioritization: a systematic mapping study.

Software Quality Journal, 21(3), 445–478.Celik, A., Knaust, A., Milicevic, A., & Gligoric, M. (2016). Build system with

lazy retrieval for java projects. In Proceedings of the 2016 24th acm sigsoft

international symposium on foundations of software engineering (pp. 643–654).Chen, T. Y., Leung, H., & Mak, I. (2004). Adaptive random testing. In Annual asian

computing science conference (pp. 320–329).Cilibrasi, R., & Vitányi, P. M. (2005). Clustering by compression. IEEE Transactions

on Information theory, 51(4), 1523–1545.Claps, G. G., Svensson, R. B., & Aurum, A. (2015). On the journey to continuous

deployment: Technical and social challenges along the way. Information and

Software Technology, 57, 21 - 31. doi: https://doi.org/10.1016/j.infsof.2014.07.009

Cohen, A. R., & Vitányi, P. M. (2015). Normalized compression distance of multisetswith applications. IEEE transactions on pattern analysis and machine intelligence,37(8), 1602–1614.

Collis, J., & Hussey, R. (2013). Business research: A practical guide for undergraduate

and postgraduate students. Macmillan International Higher Education.Cruciani, E., Miranda, B., Verdecchia, R., & Bertolino, A. (2019). Scalable approaches

for test suite reduction. In Proceedings of the 41st international conference on

software engineering (pp. 419–429). IEEE Press. Retrieved from https://

doi.org/10.1109/ICSE.2019.00055 doi: 10.1109/ICSE.2019.00055Cruzes, D. S., & Dybå, T. (2011). Recommended steps for thematic synthesis in

software engineering. In 2011 international symposium on empirical software

engineering and measurement (pp. 275–284).Dingsøyr, T., Nerur, S., Balijepally, V., & Moe, N. B. (2012). A decade of agile

methodologies: Towards explaining agile software development. Journal of

66

Page 69: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Systems and Software, 85(6), 1213 - 1221. (Special Issue: Agile Development)doi: https://doi.org/10.1016/j.jss.2012.02.033

Do, H. (2016). Recent advances in regression testing techniques. In Advances in

computers (Vol. 103, pp. 53–77). Elsevier.Duvall, P. M., Matyas, S., & Glover, A. (2007). Continuous integration: improving

software quality and reducing risk. Pearson Education.Easterbrook, S., Singer, J., Storey, M.-A., & Damian, D. (2008). Selecting empirical

methods for software engineering research. In Guide to advanced empirical

software engineering (pp. 285–311). Springer.Ebert, C., & Favaro, J. (2017). Automotive software. IEEE Software, 34(3), 33-39. doi:

10.1109/MS.2017.82Ekelund, E. D., & Engstrom, E. (2015). Efficient regression testing based on test history:

An industrial evaluation. In 2015 ieee international conference on software

maintenance and evolution (icsme) (pp. 449–457).Elbaum, S., Rothermel, G., & Penix, J. (2014). Techniques for improving regression

testing in continuous integration development environments. In Proceedings

of the 22nd acm sigsoft international symposium on foundations of software

engineering (pp. 235–245).Engström, E., & Runeson, P. (2010). A qualitative survey of regression testing practices.

In International conference on product focused software process improvement (pp.3–16).

Farley, D., & Humble, J. (2010). Continuous delivery: Reliable software releases

through build, test, and deployment automation. Addison-Wesley Professional.Feldt, R., Poulding, S., Clark, D., & Yoo, S. (2016). Test set diameter: Quantifying the

diversity of sets of test cases. In Software testing, verification and validation

(icst), 2016 ieee international conference on (pp. 223–233).Feldt, R., Torkar, R., Gorschek, T., & Afzal, W. (2008). Searching for cognitively diverse

tests: Towards universal test diversity metrics. In Software testing verification

and validation workshop, 2008. icstw’08. ieee international conference on (pp.178–186).

Flemström, D., Pasqualina, P., Daniel, S., Wasif, A., & Bohlin, M. (2018). Similarity-based prioritization of test case automation. Software Quality Journal, 26(4),1421–1449. doi: 10.1007/s11219-017-9401-7

Gambi, A., Gorla, A., & Zeller, A. (2017). O! snap: Cost-efficient testing in the cloud.In Software testing, verification and validation (icst), 2017 ieee international

67

Page 70: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

conference on (pp. 454–459).Garousi, V., Felderer, M., Karapıçak, Ç. M., & Yılmaz, U. (2018). Testing embedded

software: A survey of the literature. Information and Software Technology, 104,14–45.

Garousi, V., & Mäntylä, M. V. (2016). A systematic literature review of literaturereviews in software testing. Information and Software Technology, 80, 195–216.

Giese, H., Neumann, S., Niggemann, O., & Schätz, B. (2007). Model-based integration.In Dagstuhl workshop on model-based engineering of embedded real-time systems

(pp. 17–54).Haghighatkhah, A., Banijamali, A., Pakanen, O.-P., Oivo, M., & Kuvaja, P. (2017).

Automotive software engineering: A systematic mapping study. Journal of

Systems and Software, 128, 25–55.Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018a). Test case prioritization

using test similarities. In International conference on product-focused software

process improvement (pp. 243–259).Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018b). Test prioritization

in continuous integration environments. Journal of Systems and Software, 146,80–98.

Haghighatkhah, A., Oivo, M., Banijamali, A., & Kuvaja, P. (2017). Improving the stateof automotive software engineering. IEEE Software, 34(5), 82–86.

Harrold, M. J., Gupta, R., & Soffa, M. L. (1993). A methodology for controlling thesize of a test suite. ACM Transactions on Software Engineering and Methodology

(TOSEM), 2(3), 270–285.Hemmati, H., Arcuri, A., & Briand, L. (2010). Reducing the cost of model-based testing

through test case diversity. In Ifip international conference on testing software

and systems (pp. 63–78).Hemmati, H., Arcuri, A., & Briand, L. (2013). Achieving scalable model-based testing

through test case diversity. ACM Transactions on Software Engineering and

Methodology (TOSEM), 22(1), 6.Hemmati, H., & Briand, L. (2010). An industrial investigation of similarity measures

for model-based test case selection. In Ieee 21st international symposium on

software reliability engineering (issre) (pp. 141–150).Hemmati, H., Fang, Z., Mäntylä, M. V., & Adams, B. (2017). Prioritizing manual test

cases in rapid release environments. Software Testing, Verification and Reliability,27(6), e1609.

68

Page 71: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Henard, C., Papadakis, M., Harman, M., Jia, Y., & Le Traon, Y. (2016). Comparingwhite-box and black-box test prioritization. In 2016 ieee/acm 38th international

conference on software engineering (icse) (pp. 523–534).Hevner, A. R., March, S. T., Jinsoo, P., & Ram, S. (2004). Design science in information

systems research. MIS quarterly, 28(1), 75–105.Hohl, P., Münch, J., Schneider, K., & Stupperich, M. (2016). Forces that prevent agile

adoption in the automotive domain. In International conference on product-

focused software process improvement (pp. 468–476).IEEE-Std-1012. (2012). Ieee standard for system and software verification and validation.

IEEE Std 1012-2012 (Revision of IEEE Std 1012-2004).Indyk, P., & Motwani, R. (1998). Approximate nearest neighbors: towards removing the

curse of dimensionality. In Proceedings of the thirtieth annual acm symposium on

theory of computing (pp. 604–613).Ivarsson, M., & Gorschek, T. (2011). A method for evaluating rigor and industrial

relevance of technology evaluations. Empirical Software Engineering, 16(3),365–395.

Jendele, L., Schwenk, M., Cremarenco, D., Janicijevic, I., & Rybalkin, M. (2019).Efficient automated decomposition of build targets at large-scale. In 2019 12th ieee

conference on software testing, validation and verification (icst) (pp. 457–464).Jiang, B., Zhang, Z., Chan, W. K., & Tse, T. (2009). Adaptive random test case

prioritization. In Proceedings of the 2009 ieee/acm international conference on

automated software engineering (pp. 233–244).Jiang, B., Zhang, Z., Chan, W. K., Tse, T., & Chen, T. Y. (2012). How well does test

case prioritization integrate with statistical fault localization? Information and

Software Technology, 54(7), 739–758.Just, R., Jalali, D., & Ernst, M. D. (2014). Defects4j: A database of existing faults to

enable controlled testing studies for java programs. In Proceedings of the 2014

international symposium on software testing and analysis (pp. 437–440).Katumba, B., & Knauss, E. (2014). Agile development in automotive software

development: Challenges and opportunities. In International conference on

product-focused software process improvement (pp. 33–47).Kessis, M., Ledru, Y., & Vandome, G. (2005). Experiences in coverage testing of a

java middleware. In Proceedings of the 5th international workshop on software

engineering and middleware (pp. 39–45).Khatibsyarbini, M., Isa, M. A., Jawawi, D. N., & Tumeng, R. (2018). Test case

69

Page 72: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

prioritization approaches in regression testing: A systematic literature review.Information and Software Technology, 93, 74–93.

Kim, J.-M., & Porter, A. (2002). A history-based test prioritization technique forregression testing in resource constrained environments. In Proceedings of the

24th international conference on software engineering (pp. 119–129).Kitchenham, B., Budgen, D., & Brereton, O. P. (2011). Using mapping studies as the

basis for further research – a participant-observer case study. Information and

Software Technology, 53(6), 638 - 651. (Special Section: Best papers from theAPSEC) doi: https://doi.org/10.1016/j.infsof.2010.12.011

Kitchenham, B., & Charters, S. (2007). Guidelines for performing systematic literature

reviews in software engineering (Tech. Rep. No. EBSE 2007-001). KeeleUniversity and Durham University Joint Report.

Kitchenham, B., Dyba, T., & Jorgensen, M. (2004). Evidence-based software engineer-ing. In Proceedings of the 26th international conference on software engineering

(pp. 273–281).Knauss, E., Staron, M., Meding, W., Söder, O., Nilsson, A., & Castell, M. (2015). Sup-

porting continuous integration by code-churn based test selection. In Proceedings

of the second international workshop on rapid continuous software engineering

(pp. 19–25).Korel, B., Koutsogiannakis, G., & Tahat, L. H. (2007). Model-based test prioritization

heuristic methods and their evaluation. In Proceedings of the 3rd international

workshop on advances in model-based testing (pp. 34–43).Lachmann, R., & Schaefer, I. (2014). Towards efficient and effective testing in

automotive software development. Informatik 2014.Laghari, G., Murgia, A., & Demeyer, S. (2016). Fine-tuning spectrum based fault

localisation with frequent method item sets. In Proceedings of the 31st ieee/acm

international conference on automated software engineering (pp. 274–285).Ledru, Y., Petrenko, A., & Boroday, S. (2009). Using string distances for test case

prioritisation. In Proceedings of the 2009 ieee/acm international conference on

automated software engineering (pp. 510–514).Ledru, Y., Petrenko, A., Boroday, S., & Mandran, N. (2012). Prioritizing test cases with

string distances. Automated Software Engineering, 19(1), 65–95.Leon, D., & Podgurski, A. (2003). A comparison of coverage-based and distribution-

based techniques for filtering and prioritizing test cases. In Ieee 14th international

symposium on software reliability engineering (issre) (pp. 442–453).

70

Page 73: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Leskovec, J., Rajaraman, A., & Ullman, J. D. (2014). Mining of massive datasets.Cambridge university press.

Li, M., Chen, X., Li, X., Ma, B., & Vitányi, P. M. (2004). The similarity metric. IEEE

transactions on Information Theory, 50(12), 3250–3264.Luo, Q., Hariri, F., Eloussi, L., & Marinov, D. (2014). An empirical analysis of

flaky tests. In Proceedings of the 22nd acm sigsoft international symposium on

foundations of software engineering (pp. 643–653).Ma, L., Wu, P., & Chen, T. Y. (2018). Diversity driven adaptive test generation for

concurrent data structures. Information and Software Technology, 103, 162–173.Manhart, P., & Schneider, K. (2004). Breaking the ice for agile development of

embedded software: An industry experience report. In Proceedings of the 26th

international conference on software engineering (pp. 378–386).Mäntylä, M. V., Adams, B., Khomh, F., Engström, E., & Petersen, K. (2015). On rapid

releases and software testing: a case study and a semi-systematic literature review.Empirical Software Engineering, 20(5), 1384–1425.

Marijan, D., Gotlieb, A., & Sen, S. (2013). Test case prioritization for continuousregression testing: An industrial case study. In Software maintenance (icsm),

2013 29th ieee international conference on (pp. 540–543).Matinnejad, R., Nejati, S., Briand, L., & Bruckmann, T. (2019). Test generation and test

prioritization for simulink models with dynamic behavior. IEEE Transactions on

Software Engineering, 45(9), 919-944. doi: 10.1109/TSE.2018.2811489McCaffery, F., Pikkarainen, M., & Richardson, I. (2008). Ahaa–agile, hybrid assess-

ment method for automotive, safety critical smes. In Proceedings of the 30th

international conference on software engineering (pp. 551–560).Memon, A., Gao, Z., Nguyen, B., Dhanda, S., Nickell, E., Siemborski, R., & Micco,

J. (2017). Taming google-scale continuous testing. In Proceedings of the

39th international conference on software engineering: Software engineering in

practice track (pp. 233–242).Miranda, B., Cruciani, E., Verdecchia, R., & Bertolino, A. (2018). Fast approaches

to scalable similarity-based test case prioritization. In Proceedings of the 40th

international conference on software engineering (pp. 222–232).Mirzaaghaei, M., Pastore, F., & Pezzè, M. (2014). Automatic test case evolution.

Software Testing, Verification and Reliability, 24(5), 386–411.Nunamaker, J. F., Chen, M., & Purdin, T. D. (1990). Systems development in information

systems research. Journal of management information systems, 7(3), 89–106.

71

Page 74: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Orso, A., & Rothermel, G. (2014). Software testing: a research travelogue (2000–2014).In Proceedings of the on future of software engineering (pp. 117–132).

Parsa, M., Ashraf, A., Truscan, D., & Porres, I. (2016). On optimization of testparallelization with constraints. In Software engineering (workshops) (pp. 164–171).

Patrick, M., & Jia, Y. (2017). Kd-art: Should we intensify or diversify tests to killmutants? Information and Software Technology, 81, 36–51.

Peffers, K., Tuunanen, T., Rothenberger, M. A., & Chatterjee, S. (2007). A designscience research methodology for information systems research. Journal of

management information systems, 24(3), 45–77.Petersen, K., Vakkalanka, S., & Kuzniarz, L. (2015). Guidelines for conducting

systematic mapping studies in software engineering: An update. Information and

Software Technology, 64, 1–18.Pretschner, A., Broy, M., Kruger, I. H., & Stauner, T. (2007). Software engineering for

automotive systems: A roadmap. In 2007 future of software engineering (pp.55–71).

Robinson, B., Ernst, M. D., Perkins, J. H., Augustine, V., & Li, N. (2011). Scaling upautomated test generation: Automatically generating maintainable regression unittests for programs. In Automated software engineering (ase), 2011 26th ieee/acm

international conference on (pp. 23–32).Rodríguez, P., Haghighatkhah, A., Lwakatare, L. E., Teppola, S., Suomalainen, T.,

Eskeli, J., . . . Oivo, M. (2017). Continuous deployment of software intensiveproducts and services: A systematic mapping study. Journal of Systems and

Software, 123, 263 - 291. doi: https://doi.org/10.1016/j.jss.2015.12.015Rosero, R. H., Gómez, O. S., & Rodríguez, G. (2016). 15 years of software regression

testing techniques—a survey. International Journal of Software Engineering and

Knowledge Engineering, 26(05), 675–689.Rothermel, G., & Harrold, M. J. (1996). Analyzing regression test selection techniques.

IEEE Transactions on software engineering, 22(8), 529–551.Rothermel, G., Harrold, M. J., Ostrin, J., & Hong, C. (1998). An empirical study

of the effects of minimization on the fault detection capabilities of test suites.In Software maintenance, 1998. proceedings., international conference on (pp.34–43).

Rothermel, G., Untch, R. H., Chu, C., & Harrold, M. J. (1999). Test case prioritization:An empirical study. In Software maintenance, 1999.(icsm’99) proceedings. ieee

72

Page 75: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

international conference on (pp. 179–188).Rothermel, G., Untch, R. H., Chu, C., & Harrold, M. J. (2001). Prioritizing test cases for

regression testing. IEEE Transactions on software engineering, 27(10), 929–948.Shahbazi, A., & Miller, J. (2016). Black-box string test case generation through a

multi-objective optimization. IEEE Transactions on Software Engineering, 42(4),361–378.

Shi, A., Thummalapenta, S., Lahiri, S. K., Bjorner, N., & Czerwonka, J. (2017).Optimizing test placement for module-level regression testing. In Proceedings of

the 39th international conference on software engineering (pp. 689–699).Shin, D., Yoo, S., & Bae, D.-H. (2017). A theoretical and empirical study of diversity-

aware mutation adequacy criterion. IEEE Transactions on Software Engineering,44(10), 914–931.

Singh, Y., Kaur, A., Suri, B., & Singhal, S. (2012). Systematic literature review onregression test prioritization techniques. Informatica, 36(4).

Spieker, H., Gotlieb, A., Marijan, D., & Mossige, M. (2017). Reinforcement learningfor automatic test case prioritization and selection in continuous integration. InProceedings of the 26th acm sigsoft international symposium on software testing

and analysis (pp. 12–22).Srikanth, H., Cashman, M., & Cohen, M. B. (2016). Test case prioritization of build

acceptance tests for an enterprise cloud application: An industrial case study.Journal of Systems and Software, 119, 122–135.

Strandberg, P. E., Sundmark, D., Afzal, W., Ostrand, T. J., & Weyuker, E. J. (2016).Experience report: automated system level regression test prioritization usingmultiple factors. In Ieee 27th international symposium on software reliability

engineering (issre) (pp. 12–23).Thomas, S. W., Hemmati, H., Hassan, A. E., & Blostein, D. (2014). Static test

case prioritization using topic models. Empirical Software Engineering, 19(1),182–212.

Vakilian, M., Sauciuc, R., Morgenthaler, J. D., & Mirrokni, V. (2015). Automateddecomposition of build targets. In Proceedings of the 37th international conference

on software engineering-volume 1 (pp. 123–133).Vöst, S., & Wagner, S. (2016). Trace-based test selection to support continuous

integration in the automotive industry. In Proceedings of the international

workshop on continuous software evolution and delivery (pp. 34–40).Wohlin, C., & Aurum, A. (2015). Towards a decision-making structure for select-

73

Page 76: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

ing a research design in empirical software engineering. Empirical Software

Engineering, 20(6), 1427–1455.Wohlin, C., Runeson, P., Host, M., Ohlsson, C., Regnell, B., & Wesslén, A. (2000).

Experimentation in software engineering: An introduction. Norwell, MA, USA:Kluwer Academic Publishers.

Wohlin, C., Runeson, P., Höst, M., Ohlsson, M. C., Regnell, B., & Wesslén, A. (2012).Experimentation in software engineering. Springer Science & Business Media.

Wohlin, C., Runeson, P., Neto, P. A. d. M. S., Engström, E., do Carmo Machado, I.,& De Almeida, E. S. (2013). On the reliability of mapping studies in softwareengineering. Journal of Systems and Software, 86(10), 2594–2610.

Yoo, S., & Harman, M. (2012). Regression testing minimization, selection andprioritization: a survey. Software Testing, Verification and Reliability, 22(2),67–120.

Yoo, S., Nilsson, R., & Harman, M. (2011). Faster fault finding at Google using multiobjective regression test optimisation. In 8th european software engineering

conference and the ACM SIGSOFT symposium on the foundations of software

engineering (ESEC/FSE ’11).

Ziftci, C., & Reardon, J. (2017). Who broke the build?: automatically identifying changesthat induce test failures in continuous integration at google scale. In Proceedings of

the 39th international conference on software engineering: Software engineering

in practice track (pp. 113–122).

74

Page 77: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Appendix 1 Technical details

1.1 Similarity measurement

Several similarity metrics have been proposed in the literature, and they have been usedin many areas, such as comparative genomics, music classification, and plagiarismdetection. In our experiments, we applied five different approaches, which were selectedfrom the literature based on the results of experimental studies (Feldt et al., 2016; Feldt,Torkar, Gorschek, & Afzal, 2008; Hemmati & Briand, 2010; Ledru et al., 2012; Mirandaet al., 2018).

The 1st metric applied is the Manhattan distance. The Manhattan distance betweentwo objects is the sum of the differences of their corresponding components. In ourimplementation, similar to Ledru et al. (2012), we converted source code to a vector ofnumbers. A string of size n can be seen as a vector of characters in an n-dimensionalspace, and characters can be associated with their ASCII code (or any other numericalcoding system). The Manhattan distance is presented as ∑

ni=1 |xi− yi|, where x and y are

the strings to be compared.The 2nd metric applied is the Jaccard distance. The Jaccard similarity between

two sets x and y is defined as JS(x,y) = |x∩ y|/|x∪ y|, and their distance is defined asJD(x,y) = 1− JS(x,y). To calculate the Jaccard distance, the source code is convertedto a set of k-shingles, that is, any substring of length k found within the text. In ourexperiments, we used 5-shingles, which is commonly used in the analysis of relativelyshort documents (Leskovec, Rajaraman, & Ullman, 2014).

The 3rd metric applied is called normalized compression distance (NCD) (Cilibrasi& Vitányi, 2005; Li, Chen, Li, Ma, & Vitányi, 2004). Two objects are deemed similar ifwe can significantly compress one given the information in the other. NCD is given asfollows: NCD(x,y) = C(xy)−min{C(x),C(y)}

max{C(x),C(y)} , where x and y are the strings to be compared.NCD relies on a compressor function C that calculates the approximate Kolmogorovcomplexity and returns the length of the input string after its compression, using achosen compression program. In our experiments, we used LZ4, which is a high-speedlossless data compression algorithm 12.

12The LZ4 compression algorithm and its implementation is available at http://lz4.github.io/lz4/

75

Page 78: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

The 4th metric applied is NCD multisets, which was recently proposed by Cohenand Vitányi (2015). The difference between NCD and NCD multisets is that the latterperform similarity measurements at the level of entire sets of elements rather thanbetween pairs.

The 5th approach applied is locality-sensitive hashing (LSH), which was originallyproposed by Indyk and Motwani (1998). LSH is not a metric per se but a popularsolution to the similarity search problem. LSH hashes input items so that similar itemsmap to the same buckets with high probability.

In our experiments, we implemented LSH using the MinHash technique to rapidlyestimate the Jaccard similarity. In our implementation, we followed the instructionsprovided by Leskovec et al. (2014), which are also described here. To estimate theJaccard similarity, we converted the source code to a set of 5-shingles. However, theirsize is often large, and it is impractical to use them directly.

Using the MinHash technique, we replaced these sets with a much smaller represen-tation (e.g., a signature) while preserving the Jaccard similarity between them. Given ahash function h and an input set S, we hashed all elements in the set using the hashfunction and picked the minimum resulting value as MinHash of S. This process wasrepeated P times (i.e., the number of permutations) using different hash functions tocalculate the signature of a set (e.g., a sequence of MinHashes). Thereafter, the Jaccardsimilarity of two sets can be estimated using the fraction of common MinHashes intheir signature. However, similarity searches among large numbers of pairs are stillinefficient.

LSH works with a signature matrix (e.g., MinHash signatures as column) anddivides it into b bands consisting of r rows each. For each band, LSH takes vectorsof numbers (e.g., the portion of one column within that band) and hashes them to thebuckets using a hash function. The more similar two columns are, the greater theirlikelihood of colliding into some bands. When two items fall into the same bucket, itmeans a portion of their signature agrees, and they will be added to the candidate set.The candidate set returned by an LSH query contains only a subset of items that have agreater likelihood of being similar (e.g., that have a Jaccard similarity over a certainthreshold). An approximation of this threshold is defined as ST = (1/b)(1/r).

76

Page 79: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

1.2 TCP algorithms

To maximize diversity as early as possible, one needs to measure the distances amongthe test cases and then leverage this information to perform TCP. To calculate thedistance between a test case t and set of test cases T ′ using the metric d, Ledru et al.(2012) proposed the following generic distance function:

distance(t,T ′,d) = min{d(t, ti)|ti ∈ T ′ and ti 6= t}.

The min operation was used in the above function, because an empirical study byJiang et al. (2009) showed that maximize-minimum is more efficient than maximize-average and maximize-maximum. Ledru et al. (2012) also proposed a pairwise algorithm(Algorithm 1) that iteratively picks the most dissimilar test case, that is, the one with thegreatest distance from a set of already prioritized test cases. In our experiments, weimplemented the pairwise algorithm using different similarity metrics, that is, Manhattan,Jaccard, and NCD.

Algorithm 1: Maximize diversity using pairwise algorithm.Data: Test Suite T S and Distance Metric d

Result: Prioritized Suite PS

1 Find t ∈ T S with the maximum distance(t,T S,d);2 Append t to PS and remove from T S;3 while T S is not empty do4 Find t ∈ T S with the maximum distance(t,PS,d);5 Append t to PS and remove from T S;

6 end

For the NCD multisets, we adapted the pairwise algorithm (Algorithm 2) so thatat each iteration, we pick a test t ∈ T S that has maximum Kolmogorov complexitywhen compressed with the entire set of the already prioritized suite PS. This means thatthe candidate test has less mutual information with PS and is more different than anyother t ∈ T S. Note that C is a function that calculates the approximate Kolmogorovcomplexity and returns the length of the input string after its compression, using achosen compression program.

To employ LSH for the purpose of TCP, we implemented an algorithm (Algorithm3) proposed by Miranda et al. (2018). LSH is often configured with a high similarity

77

Page 80: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Algorithm 2: Maximize diversity using NCD multisets.Data: Test Suite T S

Result: Prioritized Suite PS

1 while T S is not empty do2 Find t ∈ T S with the maximum C(PS, t);3 Append t to PS and remove from T S ;

4 end

threshold so that the candidate set contains only highly similar items. However, in ourcontext, we are interested in items with a maximum distance from the LSH query. Thus,similar to Miranda et al. (2018), we configured LSH in order to achieve an approximately0.1 similarity threshold 13. In this way, the candidate set CS would contain almost alltest cases, and the distant set DS would include a small number of remaining items withhigh Jaccard distance.

Algorithm 3: Maximize diversity using locality-sensitive hashing.Data: Test Suite T S

Result: Prioritized Suite PS

1 signatures←MinHashSignature(T S);2 LSH.Index (signatures);3 query←MinHashSignature( /0);4 while signatures is not empty do5 CS← LSH.Search(query);6 DS← signatures−CS−PS;7 Find i ∈ DS with the maximum distance to PS;8 Append i to PS and remove from signatures;9 query← Update cumulative MinHash signature of PS;

10 end

The last algorithm applied in our experiments is HBD (Algorithm 4). This algorithmhas a two-stage prioritization mechanism. During the 1st stage, we calculated thecumulative priority for each test using its previous failures over the last N builds(depending on the interval size). The highest weight corresponds to the failure exposed

13LSH parameters: permutations: 10; bands: 10; rows: 1

78

Page 81: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

in a previous build (current−1), and the failure in every preceding build is weightedlower than the failure in its successive build. Specifically, failures are weighted by theirdistance Wn, which reflects the impact of the failure that occurred in the past and is n

builds distant from the current build session. For each Wn, a value between 0.9 (n = 1)and 0.1 (n≥ 9) was assigned. Thereafter, we aggregated tests into clusters based ontheir historical value and sorted these clusters in descending order. During the 2nd stage,we iteratively reprioritized the intracluster tests on the basis of their distance to the set ofalready prioritized tests. This can be realized using the similarity-based TCP algorithmspresented above.

Algorithm 4: TCP using history-based diversity.Data: Test Suite T S and Build History buildHistoryDatabase

Result: Prioritized Suite PS

/* First stage prioritization */

1 clusters← new AssociativeArray;2 foreach test ti ∈ T S do3 verdicts← buildHistoryDatabase. f ind(ti);4 score← calculateHistoricalValue(verdicts);5 if clusters.conatins(score) then6 clusters.get(score).add(ti);7 else8 items← new List;9 items.add(ti);

10 clusters.put(score, items);

11 end12 end13 clusters.sortDescendingByKey();

/* Second stage prioritization */

14 foreach cluster ci ∈ clusters do15 intraClusterTests← ci.values;16 ordered← maximizeDiversity(intraClusterTests,PS);17 PS.addAll(ordered);

18 end

79

Page 82: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

80

Page 83: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

Original publications

I Rodríguez, P., Haghighatkhah, A., Lwakatare, L. E., Teppola, S., Suomalainen, T., Eskeli,J., Karvonen, T., Kuvaja, P., Verner, J., & Oivo, M. (2017). Continuous Deploymentof Software-Intensive Products and Services: A Systematic Mapping Study. Journal ofSystems and Software, 123, 263-291.

II Haghighatkhah, A., Banijamali, A., Pakanen, O. P., Oivo, M., & Kuvaja, P. (2017).Automotive Software Engineering: A Systematic Mapping Study. Journal of Systems andSoftware, 128, 25-55.

III Haghighatkhah, A., Oivo, M., Banijamali, A., & Kuvaja, P. (2017). Improving the State ofAutomotive Software Engineering. IEEE Software, 34(5), 82-86.

IV Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018). Test Prioritization inContinuous Integration Environments. Journal of Systems and Software, 146, 80-98.

V Haghighatkhah, A., Mäntylä, M., Oivo, M., & Kuvaja, P. (2018). Test Case PrioritizationUsing Test Similarities. In International Conference on Product-Focused Software ProcessImprovement (pp. 243-259). Lecture Notes in Computer Science, vol. 11271. Springer,Cham.

Reprinted with permission from Elsevier (I, II, and IV), The Institute of Electricaland Electronics Engineers, IEEE (III) and Springer Nature (V).

Original publications are not included in the electronic version of the dissertation.

81

Page 84: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä
Page 85: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

A C T A U N I V E R S I T A T I S O U L U E N S I S

Book orders:Virtual book store

http://verkkokauppa.juvenesprint.fi

S E R I E S A S C I E N T I A E R E R U M N A T U R A L I U M

723. Hopkins, Juhani (2018) The costs and consequences of female sexual signals

724. Nurmesniemi, Emma-Tuulia (2018) Experimental and computational studies onsulphate removal from mine water by improved lime precipitation

725. Tyni, Teemu (2018) Direct and inverse scattering problems for perturbations ofthe biharmonic operator

726. Kuismin, Markku (2018) On regularized estimation methods for precision andcovariance matrix and statistical network inference

727. Hurskainen, Sonja (2018) The roles of individual demographic history andenvironmental conditions in the performance and conservation of northernorchids

728. Haapalahti, Reijo (2019) Yksilön toimien vaikutukset aluekehitykseen :ammatilliseen perustutkintokoulutukseen liittyvät odotukset ja tulokset Pohjois-Pohjanmaalla

729. Tokkonen, Helena (2019) Say, Do, Make? : user involvement in informationsystems design

730. Suutarinen, Johanna (2019) Ecology of lawbreaking : effects of poaching on legallyharvested wolf populations in human-dominated landscapes

731. Mylonopoulou, Vasiliki (2019) MAD : designing social comparison features inhealth behaviour change technological interventions

732. Shevchuk, Nataliya (2019) Application of persuasive systems design for adoptinggreen information systems and technologies

733. Tripathi, Nirnaya (2019) Initial minimum viable product development in softwarestartups : A startup ecosystem perspective

734. Mohanani, Rahul Prem (2019) Requirements fixation: The effect of specificationformality on design creativity

735. Salman, Iflaah (2019) The effects of confirmation bias and time pressure insoftware testing

736. Hosseini, Seyedrebvar (2019) Data selection for cross-project defect prediction

737. Karvonen, Juhani (2019) Demography and dynamics of a partial migrant close tothe northern range margin

738. Rohunen, Anna (2019) Advancing information privacy concerns evaluation inpersonal data intensive services

Page 86: A 739 ACTA - jultika.oulu.fijultika.oulu.fi › files › isbn9789526224770.pdf · Acta Univ. Oul. A 739, 2020 Oulun yliopisto, PL 8000, 90014 Oulun yliopisto Tiivistelmä Ketterä

UNIVERSITY OF OULU P .O. Box 8000 F I -90014 UNIVERSITY OF OULU FINLAND

A C T A U N I V E R S I T A T I S O U L U E N S I S

University Lecturer Tuomo Glumoff

University Lecturer Santeri Palviainen

Senior research fellow Jari Juuti

Professor Olli Vuolteenaho

University Lecturer Veli-Matti Ulvinen

Planning Director Pertti Tikkanen

Professor Jari Juga

University Lecturer Anu Soikkeli

Professor Olli Vuolteenaho

Publications Editor Kirsti Nurkkala

ISBN 978-952-62-2476-3 (Paperback)ISBN 978-952-62-2477-0 (PDF)ISSN 0355-3191 (Print)ISSN 1796-220X (Online)

U N I V E R S I TAT I S O U L U E N S I SACTAA

SCIENTIAE RERUM NATURALIUM

U N I V E R S I TAT I S O U L U E N S I SACTAA

SCIENTIAE RERUM NATURALIUM

OULU 2020

A 739

Alireza Haghighatkhah

TEST CASE PRIORITIZATION USING BUILD HISTORY AND TEST DISTANCESAN APPROACH FOR IMPROVING AUTOMOTIVE REGRESSION TESTING IN CONTINUOUS INTEGRATION ENVIRONMENTS

UNIVERSITY OF OULU GRADUATE SCHOOL;UNIVERSITY OF OULU,FACULTY OF INFORMATION TECHNOLOGY AND ELECTRICAL ENGINEERING

A 739

AC

TAA

lireza Haghighatkhah