5.3. Importance of Automated UI Testing
We feel that UI testing is an important part of a project. Though the tests are still automated, they have to be handled in a slightly different fashion and different considerations need to be taken into account when creating them.
With unit tests, the focus is on an isolated and targeted method with a clearly defined set of inputs and outputs, and as such, it is easier to understand the flow of the test and the interactions it is performing. With UI tests you lose this ability. This means that you need to combat this by reconsidering how you write and structure your tests to take this into account. As with most parts of software development, if you lose something — such as readability or automation — then you need to react by replacing or mitigating the impact. This is solved by paying more attention to another area that will help combat this. Because it is more difficult to understand the internals of the system when dealing with a black box, you need to make UI tests even more readable.
UI tests also have a different focus and role than unit tests. They both focus on catching regression bugs, but unit tests, and in particular TDD, focus on design and improving testability of the code base. Sadly there isn't this relationship to the UI. The UI tests can provide a form of documentation for your UI and the UI interface about how the software should work. If you combine this with your BDD or acceptance testing then you can create a very effective ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access