Running an Experiment
When no existing evidence answers the question, a team can produce some. A controlled experiment is the strongest design for a causal claim, and Choosing a method covers the others. Part of Evidence in software engineering.
The experiment process
Empirical software engineering already has a methodology for experiments. This is probably the strongest thing to borrow.
Wohlin et al.’s Experimentation in Software Engineering (PDF), updated in 2024, describes experimentation as a five-stage process: scoping -> planning -> execution -> analysis -> result presentation. The new edition explicitly covers research design, A/B testing, replication, open science, validity threats, surveys, and case studies. (Lund University)
Method-specific standards
Even more useful is the ACM SIGSOFT Empirical Standards for Software Engineering project. It contains different standards for controlled experiments, benchmarking, case studies, longitudinal studies, repository mining, surveys, mixed methods, replication, systematic reviews, and other methods. The authors explicitly argue that evidence standards need to be method-specific because the standard for a controlled experiment is different from the standard for an ethnographic case study. (ACM SIGSOFT)
For controlled experiments, their requirements are close to the needs of an AI-engineering protocol. They require formal hypotheses; defined dependent and independent variables; discussion of confounding variables; justified sample sizes; explicit experimental design and treatment allocation; justified experimental objects; appropriate statistical analysis; effect sizes with confidence intervals; and discussion of construct, internal, external, and conclusion validity. Preregistration and publishing protocols, raw data, and analysis scripts are recommended. (ACM SIGSOFT)
The validity requirement is the subject of Four kinds of validity, and reporting effect sizes with uncertainty is in Stating a claim.
Preregistration
Before running an experiment, record:
hypothesis primary outcome secondary outcomes dataset/task selection procedure exclusion rules statistical analysis stopping rule
Then run it.
This is called preregistration. Registered Reports go further by having the experimental protocol reviewed before the results are known. The Center for Open Science describes this specifically as a mechanism for separating hypothesis-driven analysis from decisions made after observing results. (Center for Open Science)
This is valuable wherever there are many possible metrics, as there usually are for AI tools.
A comparison of agent A with agent B might show:
- A generates code faster.
- B produces fewer lines.
- A gets higher test coverage.
- B requires fewer review comments.
- A gets more PRs merged.
Choosing “merged PRs” after observing that it favors A introduces researcher degrees of freedom.
Preregistering:
“The primary outcome is total engineer minutes from task assignment through accepted merge”
makes the experiment considerably harder to manipulate unconsciously.
Library sources
- Wohlin et al. 2024, Experimentation in Software Engineering – the experiment process and each of its steps; on Experiments (ch. 6, Process 6.3), Scoping (ch. 8), Planning (ch. 9, with Hypothesis Formulation 9.2) and Analysis and Interpretation (ch. 11)
Further reading:
- Marczyk et al. 2005, Essentials of Research Design and Methodology
- Treude and Storey 2025, Generative AI and Empirical Software Engineering: A Paradigm Shift – how LLMs change the phenomena, methods and validity threats of empirical software engineering