If you are going to do test driven development and unit testing, you should watch these videos and slide decks, most of them by Miško Hevery:
- Not a video, but a good starter: Guide: Writing Testable Code (or read the PDF version).
- 0:32:07 ▶ “The Clean Code Talks — Unit Testing” – YouTube.
- slides: Clean Code Talks – Unit Testing (Q&A: be careful that Monkey Patching does clean up after itself and not infect the global state).
doc: https://docs.google.com/presentation/d/1kwOVQakhNo_lRTbuSDyCut3-ob1RIJVhTjuPQda04q0/embed
- slides: Clean Code Talks – Unit Testing (Q&A: be careful that Monkey Patching does clean up after itself and not infect the global state).
- 0:37:56 ▶ The Clean Code Talks – Don’t Look For Things! – YouTube.
- slides: Clean Code Talks – Dependency Injection. (eye opener: slide 56; “when you separate your two piles”)
- links:
- 0:54:08 ▶ The Clean Code Talks – “Global State and Singletons” – YouTube.
- slides: Clean Code Talks – Global State and Singletons. (slide 57; “global state is the root of all test problems”)
- global state consequences for unit tests:
- flakiness
- order of test matters
- tests cannot be run in parallel
- red flags:
- getting current time or date
- getting a random number
- be careful:
- new operators are dangerous;
- ask for what you need;
- global state is nightmare;
- constructor work is dangerous
- 0:38:24 ▶ “The Clean Code Talks — Inheritance, Polymorphism, & Testing” – YouTube.
- slides: Clean Code Talks – Inheritance, Polymorphism, & Testing. (eye openers: slide 2; “most ifs can be replaced by polymorphism”, “don’t return null, return empty lists or throw exceptions”)
- 0:56:02 ▶ Design Tech Talk Series Presents: OO Design for Testability – YouTube.
- slides: Design For Testablity (eye opener: slide 3; “No tests”: unit testing Common misconceptions/Invalid excuses)
- 1:18:41 ▶ How to Write Clean, Testable Code – YouTube.
- slides: not available separately (eye opener: slide 56; “when you separate your two piles”)
- handout: https://docs.google.com/document/pub?id=1Pfh0aq_qsBwfvlxUskszX5NRuo-US6DigJ5h9NGCJvU
- red flags:
- global state aka singleton,
- law of Demeter violation,
- global reference to time,
- hard-coded new operator/object creation,
- lack of dependency injection
The colon separated numbers in front of each video are the duration in H:MM:SS (yes, the final one is over an hour, but very interesting).
Each item consists of a video from the …. followed by the slide decks I find on …. site:
Thanks Stu Sherwin for pointing at this playist: Google Tech Talks – Misko Hevery – YouTube by rtvdoorn (I found the playlist after bumping into the second talk).
There is also a list of videos at Info on OOP | westworld of which the non-overlapping ones are more aimed specifically at Java development (but for non-Java programmers, it is good to know about things like GUICE, JMock and EasyMock).
I still need to review the rest of the talks listed at About Miško Hevery.
–jeroen
Filed under: .NET, Agile, C#, Delphi, Development, Java, JavaScript, JavaScript/ECMAScript, Pascal, Software Development, Unit Testing, VB.NET
