Using Trompeloeil, a mocking framework for modern C++ - Bjorn Fahller [ACCU 2017]

preview_player
Показать описание
A popular technique in unit testing is to break dependencies by replacing collaborators of the unit under test with mock objects. Mocking frameworks makes it easier to create mock objects.

Trompeloeil is a new, open source, mocking framework written in C++14. It is easy to use while also allowing great expressive power.

This presentation will show how to use Trompeloeil by following the step-by-step development of an example program using TDD (test driven development.) The example will begin with the most basic usage and go on to cover increasingly more advanced topics, including:

- testing patterns
- techniques for controlling sequential ordering relations
- how to represent data in violation messages
- managing the life time of mock objects
- writing matchers
- disambiguating overloads
Комментарии
Автор

As a guy who doesn't have a need to do any mocking at work (not much OOP is going on in the image processing field), I must admit that this presentation only starts to make sense to me once I got to the examples at about 15:00, where I was able to infer that the point of this is to assert on what member functions are called inside some opaque call, in a readable, declarative way. This might be a huge win in some niches. The name Trompeloeil is unrememberable though.

piotrarturklos