Testing and evaluation
UAT 491 Unmanned Aircraft Systems and Automation Technology Capstone Project
Lesson
By the end of this module you will be able to
- Design a 2 × 2 factorial experiment and compute main effects and the interaction
- Compare two options with a Welch t-test and report the effect size with Cohen's d
- Work out the number of test flights needed before testing starts
- Log tests so that they can be traced back to the code version, parameters and log files
Why this matters
The test readiness review in week 11 opens the way to collecting evidence in the air, but flight time is limited: batteries can only be charged a few times a day and the weather changes daily. Good testing extracts the most information from the fewest flights and answers the requirements written in module 2 directly. This lesson continues the rain-gutter inspection drone from module 3. All figures are hypothetical.
Design experiments instead of changing one factor at a time
The team wants to know how stand-off distance and flight speed affect recall (the fraction of real blockages that are detected). The usual approach is to change one factor at a time while holding the others fixed, but Box, Hunter and Hunter show in Statistics for Experimenters that a factorial design, which runs every combination of factor levels, uses the same number of runs yet yields more information, and also reveals interaction: when the effect of one factor depends on the level of another.
- Factors: stand-off distance at 6 m and 10 m, and speed at 1 m/s and 2 m/s
- Response: recall on 40 blockages placed in a real gutter
- Randomise the flight order so that wind that changes during the day or batteries that warm up do not get mixed into the factor effects
The main effect of a factor is the average at its high level minus the average at its low level.
Example 1 A 2 × 2 factorial of distance and speed
TARGETS = 40 # blockages placed per test run
found = {("6 m", "1 m/s"): 37, ("10 m", "1 m/s"): 34, # number detected
("6 m", "2 m/s"): 33, ("10 m", "2 m/s"): 24}
r = {k: v / TARGETS * 100 for k, v in found.items()}
for (d, s), v in r.items():
print(f"distance {d:>4}, speed {s}: recall {v:5.1f}%")
near1, far1, near2, far2 = r[("6 m", "1 m/s")], r[("10 m", "1 m/s")], r[("6 m", "2 m/s")], r[("10 m", "2 m/s")]
print(f"effect of distance 6->10 m : {(far1 + far2 - near1 - near2) / 2:+.1f} points")
print(f"effect of speed 1->2 m/s : {(near2 + far2 - near1 - far1) / 2:+.1f} points")
print(f"interaction : {(near1 + far2 - far1 - near2) / 2:+.1f} points")
distance 6 m, speed 1 m/s: recall 92.5%
distance 10 m, speed 1 m/s: recall 85.0%
distance 6 m, speed 2 m/s: recall 82.5%
distance 10 m, speed 2 m/s: recall 60.0%
effect of distance 6->10 m : -15.0 points
effect of speed 1->2 m/s : -17.5 points
interaction : -7.5 points
Both factors reduce recall, and the interaction is negative: the faster the flight, the more it hurts to stand further back. At 10 m and 2 m/s, motion blur and a smaller object combine and recall falls to 60%. Only 6 m at 1 m/s clearly meets the 85% criterion. The 10 m, 1 m/s combination sits exactly on 85.0%, which a single flight cannot settle.
These results must go back to the budgets in module 2. Flying at 1 m/s doubles the capture time, and moving in to 6 m makes each photo cover a shorter length of gutter, so more photos and more flights are needed. The next worthwhile step is to replicate the 10 m, 1 m/s run and try a centre point at 8 m and 1.5 m/s before deciding.
Comparing two options with a t-test
Another question is whether a new propeller really gives longer flights. The two-sample t-test, described in the NIST/SEMATECH e-Handbook of Statistical Methods, compares the means of two groups; if you are not sure the two variances are equal, use Welch’s version. The p-value only says the difference is unlikely to be chance, not how large it is, so also report the effect size. Cohen (1988) suggested rough benchmarks for : 0.2 small, 0.5 medium and 0.8 large.
Before flying, work out how many flights you need. Montgomery and Runger give the sample size per group for detecting a difference at significance level and power :
Example 2 Propeller A versus propeller B
The team flew six flights with each propeller on the same mission, measuring flight time until the battery reached 20%.
import math
from statistics import mean, stdev
from scipy import stats
prop_a = [18.6, 19.1, 18.9, 19.4, 18.7, 19.0] # flight time (min), propeller A
prop_b = [19.8, 20.1, 19.5, 20.4, 19.9, 20.2] # propeller B
t, p = stats.ttest_ind(prop_b, prop_a, equal_var=False) # Welch
s_pooled = math.sqrt((stdev(prop_a) ** 2 + stdev(prop_b) ** 2) / 2)
d = (mean(prop_b) - mean(prop_a)) / s_pooled
print(f"means {mean(prop_a):.2f} vs {mean(prop_b):.2f} min, difference {mean(prop_b) - mean(prop_a):.2f} min")
print(f"Welch t = {t:.2f}, p = {p:.5f}, Cohen d = {d:.1f}")
sigma, delta = 0.3, 0.5 # expected SD and difference to detect (min)
z = stats.norm.ppf(0.975) + stats.norm.ppf(0.80) # alpha 0.05 two-sided, power 80%
n = 2 * z ** 2 * sigma ** 2 / delta ** 2
print(f"flights per propeller to detect {delta} min: {n:.2f} -> {math.ceil(n)}")
means 18.95 vs 19.98 min, difference 1.03 min
Welch t = 5.89, p = 0.00016, Cohen d = 3.4
flights per propeller to detect 0.5 min: 5.65 -> 6
Propeller B flies about 1 minute longer, the p-value is very small and the effect size is large. Six flights per propeller were enough to detect half a minute, as computed in advance. Still, the team must report the test conditions, such as temperature and wind, because the result only holds within the conditions tested.
Logging tests so they can be traced
A test without a record is as good as no test. One test card per run should contain:
| Field | Example |
|---|---|
| Requirement being verified | R1, recall at least 85% |
| Factor settings and randomised order | Run 3 of 4: 10 m, 1 m/s |
| Software version | tag flight-test-2026-10-14 |
| Parameter and model files | File names and hashes |
| Environment | Time, wind, temperature, light |
| Log files | Flight-controller and companion-computer log file names |
| Result and recorder | 34 of 40 detected, signed by the recorder |
Flight-controller logs can be opened with tools such as PX4 Flight Review or the ArduPilot log viewers. The team should look at the logs after every flight, not only when something seems wrong. All of this evidence feeds the requirement verification table in the module 5 report.
Module lab
Lab: a test campaign
- Choose two factors expected to affect a key requirement, design a 2 × 2 factorial and randomise the flight order.
- Place simulated blockages at known positions in the gutter, fly the plan and compute the effects as in Example 1.
- Work out the flights needed before comparing two options, then test as in Example 2.
- Fill in a test card for every run, keep the log files and review them after each flight.
- Summarise the results against every requirement: pass, fail or not yet conclusive.
Common mistakes
Watch out
- Changing one factor at a time, so interactions stay hidden
- Flying in a convenient order instead of a random one, mixing time and battery effects into the factor effects
- Drawing conclusions from a single flight when the result is close to the criterion
- Reporting only the p-value without the size of the difference
- Not recording the software version and environment, so the test cannot be repeated
Summary
- A 2 × 2 factorial uses four runs to show the main effects of two factors and their interaction.
- A main effect is the average at the high level minus the average at the low level.
- A Welch t-test says a difference is unlikely to be chance; Cohen’s d says how large it is.
- Work out the number of flights before testing, and keep test cards that can be traced.
Check your understanding
- A 2 × 2 factorial gives (low, low) = 90, (high, low) = 80, (low, high) = 70 and (high, high) = 60. What are the main effects of factor A (the first), factor B and the interaction?
- Two group means differ by 0.6 minutes with minutes. What is Cohen’s d and how large is it?
- To detect a 0.5-minute difference with minutes, and 80% power, how many flights per group are needed?
- Why randomise the order of test flights?
- p = 0.001 but the flight times differ by only 0.1 minutes. What should you conclude?
Answers
- A · B · AB , no interaction
- , large (above 0.8)
- , rounded up to 11 flights per group
- So that things that change over time, such as wind, light and battery temperature, do not get mixed into the effects of the factors being studied
- The difference is statistically significant but too small to matter in practice
Key formulas
| Main effect of a factor | |
| Effect size, Cohen d | |
| Sample size per group |
Key references
- Box, G. E. P., Hunter, J. S., & Hunter, W. G. (2005). Statistics for experimenters: Design, innovation, and discovery (2nd ed.). Wiley. link
- Montgomery, D. C., & Runger, G. C. (2018). Applied statistics and probability for engineers (7th ed.). Wiley. link
- NIST/SEMATECH. Two-sample t-test for equal means (section 1.3.5.3). e-Handbook of statistical methods. link
- Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates. link
- NIST/SEMATECH. e-Handbook of statistical methods. National Institute of Standards and Technology. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
UAV testing and evidence analysis
Elective: simulation and control
การอนุมานเชิงสถิติ
In class / field
Team project work, advisor meetings and progress presentations
Learning evidence: Project milestone deliverables