Skip to content

Replace hypothesis with random-based fuzzing#3192

Open
adeebshihadeh wants to merge 2 commits intomasterfrom
nohypothesis
Open

Replace hypothesis with random-based fuzzing#3192
adeebshihadeh wants to merge 2 commits intomasterfrom
nohypothesis

Conversation

@adeebshihadeh
Copy link
Copy Markdown
Contributor

Summary

  • Remove hypothesis dependency
  • Replace with os.urandom/random based fuzzing (same coverage, no framework overhead)
  • Also converts test_toyota.py to unittest.TestCase

Local benchmarks

test hypothesis random speedup
test_car_interfaces (241 tests) 19.0s 14.6s 23%
ford/hyundai/toyota fuzzy 0.44s 0.22s 50%
full suite parallel 18.1s 15.0s 17%
full suite serial 63.6s 58.9s 7%

Coverage

hypothesis generates random data with shrinking (finds minimal failing inputs). Our replacement generates purely random data without shrinking. Since these tests validate sanity bounds (mass > 1, wheelbase > 0) rather than edge cases, shrinking adds no practical value — a random failure is just as informative. The fuzzy FW tests just assert "no crash on random input" where shrinking is meaningless.

🤖 Generated with Claude Code

Remove hypothesis dependency. Replace with simple os.urandom/random
based fuzzing that provides equivalent coverage 17-50% faster.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added car related to opendbc/car/ ford hyundai toyota labels Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

Testing 541 segments for: FORD_BRONCO_SPORT_MK1, FORD_ESCAPE_MK4, FORD_ESCAPE_MK4_5, FORD_EXPLORER_MK6, FORD_F_150_MK14, FORD_F_150_LIGHTNING_MK1, FORD_FOCUS_MK4, FORD_MAVERICK_MK1, FORD_MUSTANG_MACH_E_MK1, FORD_RANGER_MK2, HYUNDAI_AZERA_HEV_6TH_GEN, HYUNDAI_ELANTRA_GT_I30, HYUNDAI_ELANTRA_2021, HYUNDAI_ELANTRA_HEV_2021, HYUNDAI_GENESIS, HYUNDAI_IONIQ, HYUNDAI_IONIQ_HEV_2022, HYUNDAI_IONIQ_EV_2020, HYUNDAI_IONIQ_PHEV_2019, HYUNDAI_IONIQ_PHEV, HYUNDAI_KONA_2022, HYUNDAI_KONA_EV, HYUNDAI_KONA_EV_2022, HYUNDAI_KONA_EV_2ND_GEN, HYUNDAI_SANTA_FE, HYUNDAI_SANTA_FE_2022, HYUNDAI_SANTA_FE_HEV_2022, HYUNDAI_SANTA_FE_PHEV_2022, HYUNDAI_SONATA, HYUNDAI_SONATA_LF, HYUNDAI_STARIA_4TH_GEN, HYUNDAI_PALISADE, HYUNDAI_SONATA_HYBRID, HYUNDAI_IONIQ_5, HYUNDAI_IONIQ_6, HYUNDAI_TUCSON_4TH_GEN, HYUNDAI_SANTA_CRUZ_1ST_GEN, HYUNDAI_CUSTIN_1ST_GEN, TOYOTA_ALPHARD_TSS2, TOYOTA_AVALON, TOYOTA_AVALON_2019, TOYOTA_AVALON_TSS2, TOYOTA_CAMRY, TOYOTA_CAMRY_TSS2, TOYOTA_CHR, TOYOTA_CHR_TSS2, TOYOTA_COROLLA, TOYOTA_COROLLA_TSS2, TOYOTA_HIGHLANDER, TOYOTA_HIGHLANDER_TSS2, TOYOTA_PRIUS, TOYOTA_PRIUS_V, TOYOTA_PRIUS_TSS2, TOYOTA_RAV4, TOYOTA_RAV4H, TOYOTA_RAV4_TSS2, TOYOTA_RAV4_TSS2_2022, TOYOTA_RAV4_TSS2_2023, TOYOTA_RAV4_PRIME, TOYOTA_YARIS, TOYOTA_MIRAI, TOYOTA_SIENNA, TOYOTA_SIENNA_4TH_GEN

✅ 0 changed, 541 passed, 0 errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ ford hyundai toyota

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant