Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Improving Fault Localization with External Oracle by Using Counterfactual Execution

Published: 24 January 2025 Publication History

Abstract

We present Flex, a new approach to improve fault localization with external oracles. Spectrum-based fault localization techniques estimate suspicious statements based on the execution trace of the test suite. State-of-the-art techniques rely on test oracles that internally exist in the program. However, programs often have external oracles that observe their behavior from outside. This in turn hinders fine-grained and accurate estimation of suspicious statements in practice because the correctness of each execution can only be observed at termination. In this article, we aim to address this problem by observing counterfactual execution traces, which enable fine-grained estimation even without precise internal oracles. We observe two types of counterfactual scenarios related to different types of test cases: When the branch condition is set to a Boolean constant, (1) if most of the passing test cases still pass, we consider the newly executed statements in the branch statement as unrelated to the failure; (2) if failing test case still fails, we also consider the originally executed statements as unrelated to the failure. We evaluated the performance on widely used C and Java programs. Flex improves the accuracy of state-of-the-art SBFL techniques on C and Java programs by 24% and 22% on average, respectively.

References

[1]
Rui Abreu, Peter Zoeteweij, and Arjan J. C. van Gemund. 2006. An evaluation of similarity coefficients for software fault localization. In Proceedings of the 12th IEEE Pacific Rim International Symposium on Dependable Computing (PRDC ’06), 39–46.
[2]
Marcel Böhme and Abhik Roychoudhury. 2014. CoREBench: Studying complexity of regression errors. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA ’14), 105–115.
[3]
Thierry Titcheu Chekam, Mike Papadakis, and Yves Le Traon. 2016. Assessing and comparing mutation-based fault localization techniques. arXiv:1607.05512v1. Retrieved from https://doi.org/10.48550/arXiv.1607.05512
[4]
Ross Gore, Paul F. Reynolds Jr., and David Kamensky. 2011. Statistical debugging with elastic predicates. In Proceedings of the 26th IEEE/ACM International Conference on Automated Software Engineering (ASE ’11), 492–495.
[5]
Claire Le Goues, Neal J. Holtschulte, Edward K. Smith, Yuriy Brun, Premkumar T. Devanbu, Stephanie Forrest, and Westley Weimer. 2015. The ManyBugs and IntroClass benchmarks for automated repair of C programs. IEEE Transactions on Software Engineering (TSE) 41, 12 (2015), 1236–1256.
[6]
Jong-In Jang, Duksan Ryu, and Jongmoon Baik. 2022. HOTFUZ: Cost-effective higher-order mutation-based fault localization. Software Testing, Verification and Reliability 32, 8 (2022), e1802.
[7]
Dennis Jeffrey, Neelam Gupta, and Rajiv Gupta. 2009. Effective and efficient localization of multiple faults using value replacement. In Proceedings of the 25th IEEE International Conference on Software Maintenance (ICSM ’09).
[8]
James A. Jones and Mary Jean Harrold. 2005. Empirical evaluation of the tarantula automatic fault-localization technique. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE ’05).
[9]
James A. Jones, Mary Jean Harrold, and John T. Stasko. 2002. Visualization of test information to assist fault localization. In Proceedings of the International Conference on Software Engineering (ICSE ’02).
[10]
René Just, Darioush Jalali, and Michael D. Ernst. 2014. Defects4J: A database of existing faults to enable controlled testing studies for Java programs. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA ’14), 437–440.
[11]
Yunho Kim, Seokhyeon Mun, Shin Yoo, and Moonzoo Kim. 2019. Precise learn-to-rank fault localization using dynamic and static features of target programs. ACM Transactions on Software Engineering and Methodology (TOSEM) 28, 4 (2019), 23:1–23:34.
[12]
Yigit Küçük, Tim A. D. Henderson, and Andy Podgurski. 2021. Improving fault localization by integrating value and predicate based causal inference techniques. In Proceedings of the 43rd IEEE/ACM International Conference on Software Engineering (ICSE ’21), 649–660.
[13]
Xia Li, Wei Li, Yuqun Zhang, and Lingming Zhang. 2019. DeepFL: Integrating multiple fault diagnosis dimensions for deep fault localization. In Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA ’19).
[14]
Xia Li and Lingming Zhang. 2017. Transforming programs and tests in tandem for fault localization. Proceedings of the ACM on Programming Languages 1, OOPSLA (2017), 1–30.
[15]
Yi Li, Shaohua Wang, and Tien N. Nguyen. 2021. Fault localization with code coverage representation learning. In Proceedings of the 43rd IEEE/ACM International Conference on Software Engineering (ICSE ’21), 661–673.
[16]
Seokhyeon Moon, Yunho Kim, Moonzoo Kim, and Shin Yoo. 2014. Ask the mutants: Mutating faulty programs for fault localization. In Proceedings of the IEEE International Conference on Software Testing, Verification and Validation (ICST ’14), 153–162.
[17]
George C. Necula, Scott McPeak, Shree Prakash Rahul, and Westley Weimer. 2002. CIL: Intermediate language and tools for analysis and transformation of C programs. In Proceedings of the Compiler Construction, 11th International Conference, CC 2002, Held as Part of the Joint European Conferences on Theory and Practice of Software (ETAPS ’02). R. Nigel Horspool (Ed.), Vol. 2304. Springer, 213–228.
[18]
Mike Papadakis and Yves Le Traon. 2015. Metallaxis-FL: Mutation-based fault localization. Software Testing, Verification and Reliability (STVR) 25 (2015), 605–628.
[19]
Renaud Pawlak, Martin Monperrus, Nicolas Petitprez, Carlos Noguera, and Lionel Seinturier. 2016. SPOON: A library for implementing analyses and transformations of java source code. Software: Practice and Experience 46, 9 (2016), 1155–1179.
[20]
Spencer Pearson, José Campos, René Just, Gordon Fraser, Rui Abreu, Michael D. Ernst, Deric Pang, and Benjamin Keller. 2017. Evaluating and improving fault localization. In Proceedings of the 39th International Conference on Software Engineering (ICSE ’17). IEEE / ACM, 609–620.
[21]
Andy Podgurski and Yigit Küçük. 2020. CounterFault: Value-based fault localization by modeling and predicting counterfactual outcomes. In Proceedings of the IEEE International Conference on Software Maintenance and Evolution (ICSME ’20), 382–393.
[22]
Jeongju Sohn and Shin Yoo. 2017. FLUCCS: Using code and change metrics to improve fault localization. In Proceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA ’17).
[23]
Ezekiel O. Soremekun, Lukas Kirschner, Marcel Böhme, and Andreas Zeller. 2021. Locating faults with program slicing: An empirical analysis. Empirical Software Engineering 26, 3 (2021), 51.
[24]
W. Eric Wong, Vidroha Debroy, Ruizhi Gao, and Yihao Li. 2014. The DStar method for effective software fault localization. IEEE Transactions on Reliability (TRel) (2014).
[25]
Tao Xie and David Notkin. 2005. Checking inside the black box: Regression testing by comparing value spectra. IEEE Transactions on Software Engineering (TSE) 31, 10 (2005), 869–883.
[26]
Xiaofeng Xu, Vidroha Debroy, W. Eric Wong, and Donghui Guo. 2011. Ties within fault localization rankings: Exposing and addressing the problem. International Journal of Software Engineering and Knowledge Engineering (IJSEKE) 21, 6 (2011), 803–827.
[27]
Xuezheng Xu, Changwei Zou, and Jingling Xue. 2020. Every mutation should be rewarded: Boosting fault localization with mutated predicates. In Proceedings of the IEEE International Conference on Software Maintenance and Evolution (ICSME ’20), 196–207.
[28]
Jifeng Xuan and Martin Monperrus. 2014. Learning to combine multiple ranking metrics for fault localization. In Proceedings of the 30th IEEE International Conference on Software Maintenance and Evolution (ICSME ’14), 196–207.
[29]
Muhan Zeng, Yiqian Wu, Zhentao Ye, Yingfei Xiong, Xin Zhang, and Lu Zhang. 2022. Fault localization via efficient probabilistic modeling of program semantics. In Proceedings of the 44th International Conference on Software Engineering (ICSE ’22), 958–969.
[30]
Lingming Zhang, Lu Zhang, and Sarfraz Khurshid. 2013. Injecting mechanical faults to localize developer faults for evolving software. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’13), 765–784.
[31]
Mengshi Zhang, Yaoxian Li, Xia Li, Lingchao Chen, Yuqun Zhang, Lingming Zhang, and Sarfraz Khurshid. 2021. An empirical study of boosting spectrum-based fault localization via PageRank. IEEE Transactions on Software Engineering 47, 6 (2021), 1089–1113.
[32]
Xiangyu Zhang, Neelam Gupta, and Rajiv Gupta. 2006. Locating faults through automated predicate switching. In Proceedings of the International Conference on Software Engineering (ICSE ’06), 272–281.
[33]
Daming Zou, Jingjing Liang, Yingfei Xiong, Michael D. Ernst, and Lu Zhang. 2021. An empirical study of fault localization families and their combinations. IEEE Transactions on Software Engineering (TSE) 47, 2 (2021), 332–347.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 34, Issue 2
February 2025
904 pages
EISSN:1557-7392
DOI:10.1145/3703017
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 January 2025
Online AM: 26 September 2024
Accepted: 10 August 2024
Revised: 11 June 2024
Received: 08 February 2024
Published in TOSEM Volume 34, Issue 2

Check for updates

Author Tags

  1. Fault Localization
  2. SBFL
  3. Counterfactual Execution

Qualifiers

  • Research-article

Funding Sources

  • National Research Foundation of Korea (NRF)
  • yungpook National University Research Fund

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 126
    Total Downloads
  • Downloads (Last 12 months)126
  • Downloads (Last 6 weeks)40
Reflects downloads up to 22 Jan 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media