On the effects of program slicing for vulnerability detection during code inspection

Slicing is a fault localization technique that has been proposed to support debugging and program comprehension. Yet, its empirical effectiveness during code inspection by humans has received limited attention. The goal of our study is two-fold. First, we aim to define what it means for a code reviewer to identify the vulnerable lines correctly. Second, we investigate whether reducing the number of to-be-inspected lines by method-level slicing supports code reviewers in detecting security vulnerabilities. We propose a novel approach based on the notion of a <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>δ</mml:mi></mml:math> -neighborhood (intuitively based on the idea of the context size of the command git diff) to define correctly identified lines. Then, we conducted a multi-year controlled experiment (2017-2023) in which MSc students attending security courses ( <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>n</mml:mi> <mml:mo>=</mml:mo> <mml:mn>236</mml:mn></mml:mrow> </mml:math> ) were tasked with identifying vulnerable lines in original or sliced Java files from Apache Tomcat. We provide perfect seed lines for a slicing algorithm to control for confounding factors. Each treatment differs in the pair (Vulnerability, Original/Sliced) with a balanced design with vulnerabilities from the OWASP Top 10 2017: A1 (Injection), A5 (Broken Access Control), A6 (Security Misconfiguration), and A7 (Cross-Site Scripting). To generate smaller slices for human consumption, we used a variant of intra-procedural thin slicing. We report the results for <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>0</mml:mn></mml:mrow> </mml:math> which corresponds to exactly matching the vulnerable ground truth lines, and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>3</mml:mn></mml:mrow> </mml:math> which represents the scenario of identifying the vulnerable area. For both cases, we found that slicing helps in 'finding something' (the participant has found at least some vulnerable lines) as opposed to 'finding nothing'. For the case of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>0</mml:mn></mml:mrow> </mml:math> analyzing a slice and analyzing the original file are statistically equivalent from the perspective of lines found by those who found something. With <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>3</mml:mn></mml:mrow> </mml:math> slicing helps to find more vulnerabilities compared to analyzing an original file, as we would normally expect. Given the type of population, additional experiments are necessary to be generalized to experienced developers.

Authors

Institutions

Publication Details

Journal
Empirical Software Engineering
Published
2025-04-05
DOI
https://doi.org/10.1007/s10664-025-10636-y
Citations
1
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
2.31

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

On the effects of program slicing for vulnerability detection during code inspection

Katja Tuma, Aurora Papotti, Fabio Massacci
1 citations
Empirical Software Engineering
Software Testing and Debugging Techniques
2.31
article

On the effects of program slicing for vulnerability detection during code inspection

Katja Tuma, Aurora Papotti, Fabio Massacci
article en
1 citations

Abstract

Slicing is a fault localization technique that has been proposed to support debugging and program comprehension. Yet, its empirical effectiveness during code inspection by humans has received limited attention. The goal of our study is two-fold. First, we aim to define what it means for a code reviewer to identify the vulnerable lines correctly. Second, we investigate whether reducing the number of to-be-inspected lines by method-level slicing supports code reviewers in detecting security vulnerabilities. We propose a novel approach based on the notion of a <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>δ</mml:mi></mml:math> -neighborhood (intuitively based on the idea of the context size of the command git diff) to define correctly identified lines. Then, we conducted a multi-year controlled experiment (2017-2023) in which MSc students attending security courses ( <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>n</mml:mi> <mml:mo>=</mml:mo> <mml:mn>236</mml:mn></mml:mrow> </mml:math> ) were tasked with identifying vulnerable lines in original or sliced Java files from Apache Tomcat. We provide perfect seed lines for a slicing algorithm to control for confounding factors. Each treatment differs in the pair (Vulnerability, Original/Sliced) with a balanced design with vulnerabilities from the OWASP Top 10 2017: A1 (Injection), A5 (Broken Access Control), A6 (Security Misconfiguration), and A7 (Cross-Site Scripting). To generate smaller slices for human consumption, we used a variant of intra-procedural thin slicing. We report the results for <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>0</mml:mn></mml:mrow> </mml:math> which corresponds to exactly matching the vulnerable ground truth lines, and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>3</mml:mn></mml:mrow> </mml:math> which represents the scenario of identifying the vulnerable area. For both cases, we found that slicing helps in 'finding something' (the participant has found at least some vulnerable lines) as opposed to 'finding nothing'. For the case of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>0</mml:mn></mml:mrow> </mml:math> analyzing a slice and analyzing the original file are statistically equivalent from the perspective of lines found by those who found something. With <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>δ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>3</mml:mn></mml:mrow> </mml:math> slicing helps to find more vulnerabilities compared to analyzing an original file, as we would normally expect. Given the type of population, additional experiments are necessary to be generalized to experienced developers.

Empirical Software EngineeringVol. 30(4)
University of Trento (IT), Vrije Universiteit Amsterdam (NL)
European Commission, Nederlandse Organisatie voor Wetenschappelijk Onderzoek, Nederlandse Oogonderzoek Stichting, Horizon 2020 Framework Programme, HORIZON EUROPE Framework Programme, H2020 European Research Council, HORIZON EUROPE European Research Council
Openalex Percentile: Top 15%
Software Testing and Debugging Techniques
2.31
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.