I was asked many times about front-end testing: what to test and how to test it, and what tool are best to be used? And this is my final answer: You need to consider Mike Cohn’s analogy – the test pyramid. It will help you decide what kind of testing best to be done in a certain situation. At the bottom of the pyramid are the solid test units they are the foundation of the test strategy – they can provide you with a fast feedback. At the top, occupying the smallest part of the pyramid , are the UI tests. They interact with your UI directly(for example Selenium), but are costly and very slow on feedback. They can become very brittle and hard to maintain. At the middle of the pyramid there are integration tests that do not require an UI. In Rails, for instance, you would test your REST interface directly instead of interacting with the DOM elements. For smoke or regression tests UI are very useful. If there is a need to automate these, there are some dangers to consider. First, you shoul...
Comments
Post a Comment