Back to Basics: Unit Tests - Ben Saks - CppCon 2020

preview_player
Показать описание
---
Automated unit tests can accelerate software development by quickly identifying regressions, clarifying interface requirements, and encouraging more modular designs. However, actually incorporating unit tests into your development process can be intimidating. Choosing a unit testing framework can be a daunting task because there are so many frameworks with such wide-ranging capabilities. Moreover, even when using a really good framework, crafting effective tests is a skill that takes time to master.

This session takes you through the process of writing automated unit tests for realistic code, working from very simple tests up to more complex ones. It starts with a brief introduction to automated testing and test-driven development. It shows you the first steps toward using automated unit tests in your development process.

In this session, you’ll learn the practical benefits of a unit testing framework through examples using Google Test. You’ll see how you can simplify difficult tests using dependency injection and Google Mock in addition to Google Test. Along the way, you’ll learn about different testing strategies, as well as concepts such as test coverage and ordering dependencies. Whether you’re new to automated testing or looking for a way to test challenging components, this session will help you take the next step toward more reliable, test-driven software.

---
Ben Saks
Chief Engineer, Saks & Associates

---

*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

This person is genius, he explains really well!! Thank you.

kuxnal
Автор

Good introduction based on an existing project.

volkerdr.milbrandt
Автор

Author::RetitleVideo(“How to use Google Test”);
Thank you for helping with my homework!

mikeperry
Автор

I have one problem with most tutorials on how to introduce tests in legacy code. Almost all of them are testing an application that gets one input and produces one output. Sorry, but that is easy. Where is a video on how to introduce testing in windows MFC MDI application, where almost all components depend on each other; where there is no meaningful operation that does not include a query to the database? Where do I start with such legacy code? How to introduce regression tests in a non-deterministic application (meaning the same input does not always produce same output)?

hrnkas
Автор

34:25 I need to disagree here because I had multiple cases where the public interface still seemed to do the correct thing, but the private functions didn't but in a way which made the error only detectable via other means quite a long time later.
Also testing private function saved me way more time than you might think.

kuhluhOG
Автор

Unit tests are good if you want to lock the code, make it hard to modify it. Do you want this? If not unit test are going to slow down the development process a lot.

perghosh
Автор

You put us too deep into your boring project with parsers and tokens

ivan