You learned in Chapter 7, Develop, Debug, and Deploy with Powerful Tooling that the use of static types won’t prevent all bugs. Recall the Picshare bug that added new photos to the end of the feed instead of the beginning.
|||feed ++ model.streamQueue|
Elm’s type system doesn’t notice the bug because feed and model.streamQueue have the same type. A test could have prevented this bug.
Testing also helps you to better design your code modules’ APIs. Developers call this test-driven development (TDD), or test-driven design. Some developers claim that test-driven development and design are different while others say they’re the same. We won’t wade into that debate; it’s almost as bad as whether or not you should use ...