~/talk

Leveraging a Functional Approach for More Testable & Maintainable ROS 2 Code

Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 15:15· Cottonwood 8/9, 6700 North Gaylord Rockies Boulevard· [testing]
links:none on file
slides:none on file

Claims that refactoring a ROS 2 node into pure functions, higher‑order functions, monadic error handling and dependency injection yields 100% coverage, deterministic unit tests and far fewer flaky tests. Uses C++20/C++23 features and a TL::expected polyfill (TL::expected) to return errors instead of logging, moves middleware calls to the edges so core logic is pure, and tests by injecting a mocked middleware handle so no middleware invoked during unit tests.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08Talk overview
  3. 3:35Why ROS 2
  4. 5:21Conventional ROS 2 challenges
  5. 8:11Problem statement
  6. 9:34Conventional ROS 2 walkthrough
  7. 14:29Limitations of conventional approach
  8. 15:53Testing challenges
  9. 19:04Functional programming principles
  10. 23:36Closures and partials in C++
  11. 25:24Higher order functions
  12. 29:21Monadic error handling
  13. 33:57Functional testing benefits
  14. 34:19Refactoring to functional style
  15. 38:36Testing without ROS 2 API
  16. 41:26Key takeaways
  17. 42:29Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.