After reviewing how code is tested, think carefully what isn't being tested. Instead of telling anyone, put code which causes those untested failure modes straight into production.
2. Leak memory gradually
Overt and explicit allocation will be found out. Instead, choose one of the platform's container-like data structures (even just a string) and hide an instance of it somewhere. Append items to it occasionally.
3. Introduce statefulness
Functions with side-effects are perfect for passing tests but failing eventually in production, eventually returning different results or aiding a gradual memory leak. Cite logging/profiling as the unassailable justification for keeping static variables.
4. Embrace UB
Keep a personal catalog of statements and function inputs which are undefined/invalid and don't cause compile/runtime warnings. Some C++ statement examples are "i = ++i + i++" (same-variable assign, pre-increment and post-increment), and recasting pointer types to structures which may not be the same size. Bonus for combining those.
Functions/APIs are a more fertile UB source; look for non-throwing calls which produce unpredictable results when provided numbers out of range, empty lists and other inputs not listed/considered.
[ + ] lord_nougat
[ - ] lord_nougat 3 points 16 hoursMay 1, 2025 13:54:26 ago (+3/-0)
[ + ] SithEmpire
[ - ] SithEmpire 2 points 2 hoursMay 2, 2025 03:49:15 ago (+2/-0)
After reviewing how code is tested, think carefully what isn't being tested. Instead of telling anyone, put code which causes those untested failure modes straight into production.
2. Leak memory gradually
Overt and explicit allocation will be found out. Instead, choose one of the platform's container-like data structures (even just a string) and hide an instance of it somewhere. Append items to it occasionally.
3. Introduce statefulness
Functions with side-effects are perfect for passing tests but failing eventually in production, eventually returning different results or aiding a gradual memory leak. Cite logging/profiling as the unassailable justification for keeping static variables.
4. Embrace UB
Keep a personal catalog of statements and function inputs which are undefined/invalid and don't cause compile/runtime warnings. Some C++ statement examples are "i = ++i + i++" (same-variable assign, pre-increment and post-increment), and recasting pointer types to structures which may not be the same size. Bonus for combining those.
Functions/APIs are a more fertile UB source; look for non-throwing calls which produce unpredictable results when provided numbers out of range, empty lists and other inputs not listed/considered.
[ + ] xmasskull
[ - ] xmasskull 0 points 16 hoursMay 1, 2025 13:49:14 ago (+0/-0)
[ + ] Autismo
[ - ] Autismo -1 points 13 hoursMay 1, 2025 17:23:59 ago (+0/-1)