~/talk

Defensive Programming Done Right, Part II

Talkat CppCon 2014 · on Monday, 2014-09-08· at 15:15· Descartes· [testing]
slides:none on file

Library-level defensive checks are implemented as three assertion levels (optimized ≲5% cost, regular ≈5–20%, expensive >20%), selectable per build or via overrides (e g -D BSLS_ASSERT_LEVEL), with a global callback allowing handlers like failAbort failThrow or spin/sleep; mixed-mode builds are possible but can violate the one-definition rule; a negative-testing harness injects out-of-contract calls, captures a test exception with file/line/text and verifies the handler ran; source and utilities live on GitHub and the design runs in production at Bloomberg.

AI-written summary · about

  1. 0:00Intro
  2. 3:06How do we as an enterprise decide what to do?
  3. 5:35High-Level Requirements
  4. 10:17Ex. 1 (Client): Using failAbort (by default)
  5. 14:44Library): Using BSLS_ASSERT_SAFE
  6. 20:16Soft Undefined Behavior is Relative
  7. 25:47Library): Using BSLS ASSERT IS ACTIVE
  8. 33:44Client): Creating a custom handler.
  9. 34:16Client): Installing/Invoking custom handler.
  10. 37:59Motivating example: Sorted Order
  11. 39:18Client): Using BDE_BUILD_TARGET_SAFE_2
  12. 39:44Build-Mode Summary
  13. 46:51What is a Test Driver?
  14. 47:12What is the Command-Line Interface/Contract?
  15. 51:24For negative testing to be successful
  16. 54:08Plan (FOR EACH TEST DRIVER)
  17. 58:06Constructors present a unique problem
~/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.