Skip to content

Materials of CppCon 2019 talk "Next Generation Unit Testing Using Static Reflection"

Notifications You must be signed in to change notification settings

Manu343726/cppcon2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

This repository contains the slides of my CppCon 2019 talk "Next Generation Unit Testing Using Static Reflection". The recorded talk is available at YouTube here.

Talk description

Unit testing is a widely accepted practice in the software engineering industry, which has been demonstrated to help reduce bugs in production and provide faster iteration cycles for development, helping with development trends such as agile development or continuous deployment.

While being part of the core of modern development, C++ due to its current language limitations lacks a unit testing framework that's expressive and concise enough to keep developers focused around tests themselves and not around all the code needed to support the tests. Current unit testing solutions for C++ usually require arcane constructions through macros, intrusive changes in the tested codebase in the form of class hierarchies for easy mocking, and in some cases manual test registration.

I present unittest, a proof of concept unit testing framework for C++14 based on Python's standard unittest package. unittest avoids the problems described above by using static reflection to figure out what code describes a unit test, and what library functions should be mocked as part of the test. Current C++14 implementation is based on tinyrefl, a libclang based static reflection tool, but the same concept will be possible to implement through future C++ reflection features like those proposed by the Reflection Technical Specification.

(link to schedule)

Contents

The slides were rendered using the Marp plugin for VS-Code.

References

License

All code snippets shown in the talk are published under the MIT Open Source License. Check tinyefl and unittest repositories for the license details of these projects.

About

Materials of CppCon 2019 talk "Next Generation Unit Testing Using Static Reflection"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published