Controlled experiments
Turn a claim into a falsifiable hypothesis
A controlled experiment changes a named factor while holding relevant variables steady. Hypothesis: in a fictional scheduler model, a candidate ranking policy never picks a node lacking enough CPU or memory. A positive control contains a feasible node; a negative control contains no feasible node, so the model must return no placement. A separate intentionally defective implementation that ranks before filtering should fail the negative control. That failure shows the test can detect this specific defect; it does not prove all defects are covered.
Independent variable: ranking policyControlled inputs: node inventory and Pod requestsOutcome: selected node or no placementNegative control: every node is infeasibleDesign a reproducible scheduling study
Upstream scheduling separates feasibility checks from preference ranking. The teaching model uses integer millicores and MiB, checks CPU and memory only, and chooses either the largest or smallest remaining CPU among feasible nodes, breaking ties by name. These are invented policies, not implementations of upstream plugins. For a Pod requesting 600m and 256 MiB, node a has 500m/1024 MiB, b has 800m/128 MiB, and c has 700m/512 MiB. Only c passes both constraints. Ranking must never rescue a rejected node.
{ "request": { "cpu": 600, "mem": 256 }, "nodes": [ { "name": "a", "cpu": 500, "mem": 1024 }, { "name": "b", "cpu": 800, "mem": 128 }, { "name": "c", "cpu": 700, "mem": 512 } ], "expected": "c"}Choose controls and a bounded test matrix
Add exact-fit, zero candidates, tied candidates, CPU-only failure and memory-only failure. Record the same input hash, Python version, policy identifier, expected output and actual result. For a real comparison pin Kubernetes versions, scheduler profile, admission, runtime, node allocatable, workload images and placement rules. Start with one change; use fresh isolated fixtures and randomized or counterbalanced order for repeated performance measurements. Never use uncontrolled production load. Our offline deterministic study has no timing claim.
Baseline vs candidate on identical fixturespositive control: at least one valid nodenegative control: no valid noderegression: feasible set unchanged across ranking variantsReport evidence without hiding failures
An experiment can pass, fail or be inconclusive. A missing run, changed input, crashed harness or absent negative control cannot support a pass. Log versions, settings, expected and actual output, deviations, counts, and known limitations. A hash can detect changed bytes when compared with a trusted baseline; it cannot establish that the experiment design was correct. Keep raw observations separate from interpretation. Do not use a model result to claim scheduler conformance.
Run A: identical input hash, expected=c, actual=c -> PASSRun B: missing output -> INCONCLUSIVERun C: expected=no placement, actual=a -> FAILUse regression evidence to inform upgrades
Before a real upgrade, inventory served APIs, feature gates and removed endpoints; review component-specific skew and add-on versions. Retest known behaviors, negative authorization controls, scheduler placement, network and storage, application SLOs and restore. Run predeclared tests on the baseline and candidate under matched conditions. If a necessary control fails, stop and investigate before approval. Avoid assuming rollback of a cluster version is supported or that it reverses external data changes.
baseline evidence -> approved target and compatibility review-> matched regression suite -> review differencesmissing control or failed required result -> HOLDPractice and next step
Run python validate_offline.py from lab-fixtures/expert-research using Python 3. It tests original model cases and performs a mutation check against a deliberately defective ranking routine. Review the input hash and evidence output. Add a case where CPU fits but memory does not; explain why the model still cannot represent affinity, taints, topology, preemption, extended resources, scheduling races or Kubernetes scoring. Next: professional production platform capstone.
Deliver hypothesis, variable, controls, inputs, expected outcome, evidence and limitationsFurther reading
- https://v1-34.docs.kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/ — Versioned scheduler filtering and scoring model
- https://kubernetes.io/releases/version-skew-policy/ — Component-specific version skew limits
- https://kubernetes.io/docs/reference/using-api/deprecation-guide/ — Removed APIs and migration
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Controlled experiments — knowledge check
Design a reproducible test with negative controls
Why include a negative control?
A node lacks enough memory but ranks highest in CPU. What should the teaching model do?
What should happen if the candidate study has no output?
What does a matching fixture SHA-256 demonstrate?
Which change makes a comparison more interpretable?