Last active
November 7, 2017 23:15
-
-
Save patriknyblad/966fa8dad7af34745197f818e0c12231 to your computer and use it in GitHub Desktop.
Types of tests you can write
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Testing | |
When writing automated tests there is a sea of terms out there for what your tests are doing or aim to do. | |
This gist is here as a cheat sheet for future reference. | |
## Unit test | |
Tests a small unit of the code, one test typically tests one branch (if, switch, for etc.) in one method. | |
Dependencies and interactions should be mocked to not affect the outcome of the test or invoke things | |
outside of the scope of the test. | |
## Smoke test | |
Simple suite of integration tests that do not test all the features of the environment. This is more for | |
checking for obvious mistakes. Sort of like checking if something is burning or not. | |
## Integration test | |
Tests how one unit talks to another. This can be as small as a class talking to another class or a whole | |
system setup, testing integration with the production environment. I would argue that Blackbox testing | |
falls under this category. | |
### - Blackbox/System test | |
Tests that perform operations with expected (or unexpected) data on the final product and verifies that | |
the result of the operation is what we would expect. However other systems being interacted with should | |
probably be mocked, otherwise this is more of an integration test. | |
## Regression test | |
This type of test is typically written when a bug is found to verify the bug's existence and to make | |
sure it does not come back. Could also be a test to record the current behaviour of a component to | |
later verify that the behaviour is kept when implementations change. | |
## Acceptance test | |
Much like an integration test but focuses more on a specific usecase rather than verifying integration | |
between two systems. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment