This course is not up to current Frontend Masters standards, but it still shows some relevant lessons on what makes code difficult to test. We now recommend you take the JavaScript Testing Practices and Principles course.

Check out a free preview of the full The Psychology of Code Testability course:
The "Testing Examples" Lesson is part of the full, The Psychology of Code Testability course featured in this preview video. Here's what you'd learn in this lesson:

Testing after the fact means you assume the code works, then try it out. The problem is largely insoluble. Can you write the test before the code? If you write the test first, it will probably be able to survive changes to the code. If you know what the tests are actually trying to achieve - the stories of the tests - you’ll be able to write code that can be tested by it.

Get Unlimited Access Now