Files
ResearchMethods_Project/validation/spss_all/sast_all_import.sps
T
Joren 303cf016be Drop duplicate label columns from SPSS exports
tier_label, model_label, condition_label, and model_order duplicated the
numeric codes; SPSS value labels already carry the names. model is now a
numeric code (0=Bandit, 1=Semgrep, 2=DeepSeek V4.1 Flash, 3=Argon) with
value labels in the .sav files and .sps syntax. Long file drops from 38 to
34 variables, summary from 30 to 26.
2026-11-21 15:12:39 +01:00

119 lines
3.4 KiB
Scheme

* Import long-format combined SAST + LLM results.
* Set the SPSS working directory to validation/spss_all before running.
GET DATA
/TYPE=TXT
/FILE='sast_all_long.csv'
/ENCODING='UTF8'
/DELIMITERS=","
/QUALIFIER='"'
/ARRANGEMENT=DELIMITED
/FIRSTCASE=2
/VARIABLES=
sample_id A20
tier F1.0
model F1.0
condition F1.0
in_scope F1.0
expected_vuln F1.0
predicted_vuln F1.0
correct_flag F1.0
tp F1.0
fp F1.0
tn F1.0
fn F1.0
expected_category A20
expected_category_code F3.0
predicted_category A20
predicted_category_code F3.0
expected_cwe A10
expected_cwe_num F5.0
predicted_cwe A10
predicted_cwe_num F5.0
category_correct F1.0
cwe_correct F1.0
strict_correct F1.0
wrong_category_tp F1.0
parse_ok F1.0
prompt_tokens F10.0
completion_tokens F10.0
total_tokens F10.0
latency_ms F10.0
calls F5.0
run_id A45
prompt_hash A64
findings F5.0
token_data_available F1.0
.
DATASET NAME sast_all_long WINDOW=FRONT.
VARIABLE LABELS
sample_id 'Benchmark test identifier'
tier 'Capability tier'
model 'Detector'
condition 'Dataset condition'
in_scope 'In prompt target scope'
expected_vuln 'Ground-truth vulnerability'
predicted_vuln 'Predicted vulnerability'
correct_flag 'Prediction correct'
tp 'True positive'
fp 'False positive'
tn 'True negative'
fn 'False negative'
expected_category 'Ground-truth category'
expected_category_code 'Ground-truth category code'
predicted_category 'Predicted category'
predicted_category_code 'Predicted category code'
expected_cwe 'Ground-truth CWE'
expected_cwe_num 'Ground-truth CWE number'
predicted_cwe 'Predicted CWE'
predicted_cwe_num 'Predicted CWE number'
category_correct 'Category correct among TP'
cwe_correct 'CWE correct among TP'
strict_correct 'Flag and CWE both correct'
wrong_category_tp 'Vulnerable but wrong category (TP)'
parse_ok 'Valid JSON response'
prompt_tokens 'Prompt tokens'
completion_tokens 'Completion tokens'
total_tokens 'Total tokens'
latency_ms 'Latency (ms)'
calls 'API calls'
run_id 'Run ID'
prompt_hash 'Prompt SHA-256'
findings 'Target-category SAST findings'
token_data_available 'Token/latency data available'
.
VALUE LABELS
tier 0 'Traditional SAST' 1 'Open-weight' 2 'Frontier'
model 0 'Bandit' 1 'Semgrep' 2 'DeepSeek V4.1 Flash' 3 'Gemini 4 Argon'
condition 0 'Original' 1 'Obfuscated v2' 2 'Comments removed'
in_scope expected_vuln predicted_vuln correct_flag parse_ok
tp fp tn fn category_correct cwe_correct strict_correct
wrong_category_tp token_data_available
0 'No' 1 'Yes'
expected_category_code predicted_category_code
0 'None' 1 'pathtraver' 2 'sqli' 3 'xpathi' 4 'xxe' 5 'cmdi'
6 'deserialization' 7 'xss' 8 'weakrand' 9 'trustbound'
10 'hash' 11 'codeinj' 12 'securecookie' 13 'redirect'
14 'ldapi' 99 'other'
.
EXECUTE.
* Uncomment to restrict all following analyses to in-scope samples.
* SELECT IF (in_scope = 1).
* EXECUTE.
FREQUENCIES VARIABLES=tier model condition expected_vuln predicted_vuln
correct_flag strict_correct wrong_category_tp.
SORT CASES BY model condition.
SPLIT FILE LAYERED BY model condition.
CROSSTABS
/TABLES=predicted_vuln BY expected_vuln
/STATISTICS=CHISQ
/CELLS=COUNT ROW COLUMN.
SPLIT FILE OFF.
MEANS TABLES=total_tokens latency_ms BY model condition
/CELLS=MEAN COUNT STDDEV.