Join Kit Eason for an in-depth discussion in this video What are automated tests and why do they matter?, part of F#: Automated Testing for Developers.
- [Narrator] If you're an experienced software developer, you're probably more than familiar with the concept of automated tests. Just in case you aren't, or at least as a recap, automated tests are any kind of code which exercises other code in order to make sure that other code works correctly. As an approach, it's much more repeatable and scalable than having humans test our code manually. The lowest level of automated tests is unit tests. Unit tests seek to test some simple piece of code, typically a method in the object or entered world or a function in the functional world.
If a test is there to make sure two parts of a system work together, that's an integration test. You won't be talking about integration tests in this course, but you can use the techniques from the course to run integration tests, since ultimately we are just running code. At the top level, we have end to end tests, which are there to ensure the system as a whole works for the user. For instance, we might want to have a test version of a website with a real web server and database behind it. And we might use a tool to simulate the actions of a user in clicking and typing on the website.
We will talk about UI automation tests in this course. Automated testing is controversial. In the software development community, there is a very wide variety of strongly held views about what constitutes a good test, and so forth. However long meetings I've sat in about this, focusing down on the EFSHAR community, there are some folks who de-emphasize unit testing in favor of leaning very heavily on the type system. Well, good luck to them. But my view is you're going to need some tests, and the discipline of writing and passing good tests is crucial to the craft of software development.
In this course, you'll learn a range of practical techniques for writing automated tests. You don't have to use all of them. Pick a style that suits you and your team, and run with it.
Kit Eason explains how to use xUnit—a .NET unit-testing package—to do some test-driven development, and demonstrates how to improve your test run experience using NCrunch, a test runner. He shows how to use FsCheck to generate test cases, and how to use Expecto to move into the world of tests as first-class values. He also covers the use of Canopy to automate the testing of web user interfaces, and of mocking to tame dependencies.
- Solving issues with early versions of Visual Studio 2017
- Classical unit testing with F#
- Creating a testable project and installing Paket and xUnit
- Test driving an implementation
- Improving your test run experience with NCrunch
- Going beyond test cases with FsCheck and Unquote
- Making tests first class using Expecto
- Using mocking to tame dependencies
- Web UI testing with Canopy