So I've been trying to read about UI and Integration testing (specifically for iOS development). I always though these tests were different, but a lot of the integration tests example I see, appear to be what I would call UI testing.
So now I'm curious, what is the difference between UI and integration testing? Could you please give examples?
UI and Integration testing are fairly different concepts. UI Testing is testing the UI specifically, such as "When I press the login button, the credentials are validated and the page transitions to the home page". While an integration test is to evaluate how different components work together.
Testing is usually thought of as unit testing, but in reality most tests you write are most likely integration tests. While a unit test is supposed to test a "unit" of code such as a function, an integration test will test the use of a bunch of functions "integrated" together.
UI tests become necessary when you can't test certain aspects of your app using some input/output validation or need to test the flows of the app. You would write a unit test for credential validation: does username/password meet the requirements. An integration test to validate retrieving a full User object when logging in a user (assuming you mock the database/network layers), and a UI test to test the login form doing all these.
In the above example, you can see that a unit test may not be as necessary since the integration test will also touch on the individual functions. You should unit specific behavior, such as a user trying the known invalid parameters do in fact fail, i.e. SQL injection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With