Smoke Testing
Get introduced to smoke testing and try it on an example.
We'll cover the following
What is smoke testing?
Smoke testing refers to the practice of testing that code doesn’t behave in unexpected ways rather than testing for the exact behavior of the code. The idea is to run tests that only verify that nothing major is severely broken.
For example, our list-sorting function should always either return a list or fail with a FunctionClauseError in case the argument is not a list, but it should never fail with any other error or return anything other than a list. If that were the case, it would mean that something is very wrong. The list-sorting example is a bit too simple to understand the benefits of smoke testing. But when the system under test is complex, then a smoke test can be significantly faster to write and to run, thus providing a lot of value. When it’s hard to generate precise data for your code, and it’s hard to find accurate properties to ensure that code works correctly, property-based testing can still help with smoke testing.
Example
Let’s take a look at our list-sorting example:
Get hands-on with 1400+ tech skills courses.