Unit testing - A comprehensive guide for beginner / intermediate developers (4 hour course)

Опубликовано: 12 Январь 2021
на канале: Programming Duck
216
9

In this video we cover unit testing from beginner to intermediate (and even touch on some advanced topics). We have a lot of practical examples of testing different types of code. We also cover many fundamental assertions, different ways to write your tests and how to maintain your tests. Finally, we examine how the source code you write can make tests easier or harder to write.

This video is language agnostic. We use JavaScript for the examples, but the examples are easy to understand and translate into your own programming language. The concepts are universal and apply for all programming languages.

Chapters:
Introduction:
00:00 Intro
01:38 Why we write tests
03:00 Types of tests
03:34 Why unit testing
06:00 Test framework
Testing pure units:
09:39 Testing pure units - Add
18:53 Testing pure units - Multiply
26:08 Testing pure units - CalculateDamage
34:42 Summary of testing units
Testing code with side effects:
37:28 Testing code with side effects - Stack
1:13:14 Testing code with side effects - onlyOnce
1:37:30 Summary of testing code with side effects
Testing IO:
1:40:18 Introduction to testing IO
1:44:57 Testing IO - Replacement environment - toggleActiveClassOnBody
2:00:37 Test cleanup
2:04:01 Testing IO - Replacement environment - saveToDatabase
2:16:15 Refactoring for tests
2:21:36 Testing IO - Replacement environment - appendToDOM
2:36:59 Testing IO - Mocking / monkey-patching
2:53:05 Testing IO - Humble object pattern
Bad tests:
3:02:11 Bad tests - Bad code
3:07:05 Bad tests - Implementation details
3:12:54 Bad tests - Unnecessary mocking
Other assertions:
3:19:25 Other assertions
Unit testing theory
3:25:48 Unit testing theory
3:26:14 Test public functionality
3:27:35 Test the end result
3:28:00 Tests are code and should be maintained
3:29:19 Good tests depend on good code
3:31:36 Have a failing test
3:48:50 Outro

Video links:
GitHub repo: https://github.com/Programming-Duck/u...

Channel links:
Programming Duck: https://programmingduck.com
Facebook:   / programming-duck-100207231868555  
Hire me: https://sargalias.com

#programmingduck #programming #coding