O'Reilly logo

Programming Elm by Jeremy Fairbank

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test-Driven Development in Elm

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required