Back to proposals-2013
Title: Ephemeral Unit Tests Using Clang
Proposer: martin_waplington
Proposer: donal_mulvany
Type: Case Study
Duration: 90 minutes
Description:
Ever had to work on a legacy code base? In this talk we
will show how to use clang to generate unit tests on the fly for C++.
These unit tests can be used in the same way that any other unit test
is but they do not have to be stored: they are targeted at the
refactoring change you are making right now. Once refactoring is
complete and the unit tests pass (or fail in precisely the expected
ways) they can be deleted. Further code changes/refactorings are
accommodated by simply regenerating the unit tests as needed. We will
also talk about strategies for measuring code coverage and generating
unit tests that guarantee every branch is tested.
Roger: I think at least one of the clang proposals would be good, unsure if we want more than one
Asti: why do we suddenly have so many clang proposals? Are we missing something here?
Roger: Clang provides a fairly clean interface to the Abstract Syntax Tree of a C++ program, which allows people to do a number of things tradionally out of reach for C++ code analysers.