Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We recently had a consultant tell us that if a feature can only be tested via automated UI tests (e.g. Selenium, Coded UI), then there is an underlying architectural issue. While this statement might be a bit extreme, it is along the same lines of the testing pyramid in that UI tests should make up a small portion of your overall automated test suite.

So, what kinds of features should have automated UI testing? Will a system with a cogent architecture still have features that can only be verified through UI tests, or should these tests just serve as "back-up" for a suite of unit and service tests?

share|improve this question
    
Apart from every feature of the UI, I presume? –  delnan Jan 15 '13 at 22:00

3 Answers 3

up vote 8 down vote accepted

Presumably you have some sort of architecture that connects buttons and other widgets to actions -- click on save and the save function should be called, etc.

Assuming you have good test coverage of the actions themselves via unit or integration tests, the goal of automated UI testing is to insure that the widgets are all making proper calls to the underlying actions.

In other words, they validate that the UI properly reflects the state of the model, and is properly hooked up to the controller.

The other component is when some business logic is in the UI code. For example, maybe you require certain characters in a password field. You need to test those features somehow, since it may be difficult or impossible to do that via unit tests.

share|improve this answer

What features should be tested via automated UI testing?

All ui features.

You should test:

  • All functions that users can do.
  • Functions that users do in all the browsers (and versions of) that they do them in.
  • Both happy (doing the right thing at every step) vs sad (user makes errors) paths.
  • Valid and invalid Data.
  • Large and Small numbers.
  • All roles and functions roles specific to role.
  • User and Admin interfaces.
  • Attempts to break-in.
  • Creating vs. Updating data works as intended.
  • Delete's work and delete associated database data in other tables.
  • Keyboard vs. Mouse style users.
  • Different devices or simulators of - pc's, phones, ipads, etc.
share|improve this answer

There is no such thing as a feature that can only be tested via automated UI tests. Tools like Selenium just mimic the behavior of a human, without boring the human to the point of suicide. Ask yourself (or your consultant) a question: "How would a program test UI aspects that a person cannot?" The next question is: "If so, why would you care what they do?"

On the other hand if, you have such a feature, well, yeah, I'd say you have an underlying architectural issue. :-)

share|improve this answer
1  
I think by "only" they are referring to automated UI tests versus unit or integration tests. I don't think it's possible to create something that selenium can test that a human cannot (modulo the speed of humans versus the speed of selenium) –  Bryan Oakley Jan 15 '13 at 23:27
    
Sorry, I can see where you'd get that from the question. Though you've challenged me to develop an application that can only be used by Selenium -- just to stick it to our UX team :) –  mragh Jan 16 '13 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.