Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Code
callback function directly ● There was no invocation of the middleware using DI and all code is testable without invoking the ROS 2 API! Testing with DIConclusionConclusion ● The refactored tests are Cairl ● Everyone else at PickNik Thanks to:Bilal Gill Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Code Thank you! All code and the presentation are available at https://github0 码力 | 200 页 | 1.77 MB | 5 月前3Regular, Revisited
e_t& u) { { t == u } -> boolean-testable; { t != u } -> boolean-testable; { u == t } -> boolean-testable; { u != t } -> boolean-testable; }; template< class T > concept equality_comparable boolean-testable; { t > u } -> boolean-testable; { t <= u } -> boolean-testable; { t >= u } -> boolean-testable; { u < t } -> boolean-testable; { u > t } -> boolean-testable; { u <= t } -> boolean-testable; { u >= t } -> boolean-testable; }; template< class T > concept totally_ordered = std::equality_comparable&& __PartiallyOrderedWith 0 码力 | 180 页 | 19.96 MB | 5 月前3Changing Legacy Code: With Confidence
out similarly to A New Main0 码力 | 114 页 | 982.54 KB | 5 月前3The Most Important Design Guideline is Testability
TestsTestability 16 • Unit Tests • TDDTestability 17 I often struggle with how to make my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate going along this line but I won't.Testability 18 I often struggle with how to make my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate going along this line but I won't.Testability 19 I often struggle with how to make my classes testable. I sometimes find that the issue is hidden state. I then have to find ways to expose and manipulate0 码力 | 126 页 | 9.11 MB | 5 月前3Extending and Simplifying C++: Thoughts on Pattern Matching using 'is' and 'as', and Can C++ be 10x Simpler & Safer?
constexpr bool is( auto const& x, auto const& value ) { if constexpr (requires{ {value(x)} -> boolean_testable; }) return value(x); } else if constexpr (requires{ bool{x == value}; }) { return x == value; constexpr bool is( auto const& x, auto const& value ) { if constexpr (requires{ {value(x)} -> boolean_testable; }) if constexpr ( requires { argument_of{x}; } ) { return value(x); } constexpr bool is( auto const& x, auto const& value ) { if constexpr (requires{ {value(x)} -> boolean_testable; }) if constexpr (requires { std::declval >(); }){ if constexpr 0 码力 | 108 页 | 5.08 MB | 5 月前3阮一峰 《ECMAScript 6入门》 第三版
一个提案将这项功能,引入了 ECMAScript。 @testable class MyTestableClass { // ... } function testable(target) { target.isTestable = true; } MyTestableClass.isTestable // true 上面代码中, @testable 就是一个修饰器。它修改了 MyTestableClass MyTestableClass 这个类 的行为,为它加上了静态属性 isTestable 。 testable 函数的参 数 target 是 MyTestableClass 类本身。 基本上,修饰器的行为就是下面这样。 @decorator class A {} // 等同于 class A {} A = decorator(A) || A; 也就是说,修饰器是一个对类进行处理的函数。修饰器函数的第一个参数,就是所 所 要修饰的目标类。 Decorator 540 function testable(target) { // ... } 上面代码中, testable 函数的参数 target ,就是会被修饰的类。 如果觉得一个参数不够用,可以在修饰器外面再封装一层函数。 function testable(isTestable) { return function(target)0 码力 | 679 页 | 2.66 MB | 1 年前3Guzzle PHP 5.3 Documentation
Client The procedural API is simple but not very testable; it’s best left for quick prototyping. If you want to use Guzzle in a more flexible and testable way, then you’ll need to use a GuzzleHttp\ClientInterface integrity of messages before and after they are sent over the wire, and anything else you might need. Testable Another important aspect of Guzzle is that it’s really easy to test clients. You can mock HTTP0 码力 | 63 页 | 275.75 KB | 10 月前3Guzzle PHP 5.3 Documentation
Client The procedural API is simple but not very testable; it’s best left for quick prototyping. If you want to use Guzzle in a more flexible and testable way, then you’ll need to use a GuzzleHttp\ClientInterface integrity of messages before and after they are sent over the wire, and anything else you might need. Testable Another important aspect of Guzzle is that it’s really easy to test clients. You can mock HTTP0 码力 | 72 页 | 312.62 KB | 10 月前3Leveraging C++20/23 Features for Low Level Interactions
best practices for using C from C++? How can we use C++ to make HW access cleaner, safer, and more testable?Why is C so proli�c? It’s the kernel, silly! 30 years ago, all low level interaction was done with .. private: unique_ptrp_regs; }Why use a pointer to a register set? Make more testable code! Any object that can be casted to my_uart_regs or is inherited from my_uart_regs can be handed 0 码力 | 56 页 | 5.39 MB | 5 月前3Back to Basics Unit Testing
unit tests is part of the writing code cycle; they need to run fast Design Good designs are testable, testable designs are good. If your code is hard to test, revisit your design Test Driven Development0 码力 | 109 页 | 4.13 MB | 5 月前3共 307 条- 1
- 2
- 3
- 4
- 5
- 6
- 31
相关搜索词
LeveragingFunctionalApproachforMoreTestableandMaintainableROSCodeRegularRevisitedChangingLegacyWithConfidenceTheMostImportantDesignGuidelineisTestabilityExtendingSimplifyingC++ThoughtsonPatternMatchingusingasCanbe10xSimplerSafer一峰ECMAScript入门第三第三版GuzzlePHP5.3Documentation2023FeaturesLowLevelInteractionsBacktoBasicsUnitTesting