Sunday 10 a.m.–1 p.m. in

Python and Windows C++ desktop app: how we made them the best friends

Tomas Danek, Lukas Kucera


Have you ever dreamed of live peeking and hacking inside big C++ desktop application? Controlling it with simple and elegant Python code? That's what we do in our test automation team at Avast software. When we were thinking about test automation for software which protects hundreds of millions users worldwide, we wanted our tests to be as stable as possible. That's why we targeted internals of the application. Boost Python allows us to easily export internal C++ interfaces of our application to be controlled with Python. This approach allows us to automatically create binary that is importable by Python like a standard Python module and natively call the C++ code of the application. It provides us with the best of both worlds: * Python allows easy and fast development of tests * Invoking code of our C++ application directly reduces the test stability problems * We are directly at the core, no extra layers/testing frameworks needed * No need to beg for some extra code in the application: we just use it as it is * We can script our Python tests, as well as interactively control the application In this poster, we show the basic principles of this architecture and present guiding steps for those who would like to start leveraging convenient Python in the cruel C++ world.