The Science of Unit Tests
https://cppcon.org/ https://github.com/CppCon/CppCon2020/blob/main/Presentations/scientific_unit_testing/scientific_unit_testing__dave_steffen__cppcon_2020.pdf
Unit testing has emerged as one of the foundations of modern software development. There are plenty of good talks on how to write tests, full of good advice, guidelines, and procedures: “Test using only the public interface”, “Use Test-Driven Development”, “Write Behavior-Driven Tests”.
But what are the fundamentals that lie beneath all the good advice? What principles should guide our testing?
This talk will start by reviewing the basics of good testing, and then explore the close relationship between unit testing and the scientific method. Unit tests are, in some sense, small scientific instruments to detect phenomena in our source code. When seen in this light, we can start to see why the good advice we’ve been getting is good, and how an empirical approach can help guide decisions about what, when, and how to test our code.
Dave Steffen completed his Ph.D. in theoretical physics at Colorado State University in 2003, and promptly changed course for a career in software engineering. He has worked primarily in defence and aerospace, and is currently a technical lead at SciTec Inc.’s Boulder office. For reasons unknown, he has turned out to be the expert, champion, and occasional street-corner evangelist for unit testing at most of the companies he has ever worked at.
Streamed & Edited by Digital Medium Ltd - events.digital-medium.co.uk events@digital-medium.co.uk
