views:

229

answers:

4

I think I understand unit testing. But I was wondering: is there a way to automate something visual, like making sure anti-aliasing works or that the rounded corners on a web site look how they are supposed to? I have a feeling that it just isn't practical, but I have little experience in the QA world.

+1  A: 

Do hallway usability testing. ;)

http://www.joelonsoftware.com/articles/fog0000000043.html

melaos
+1  A: 

You could also consider automation at GUI level, using a tool such as TestComplete. There are many such tools out there at a range of prices with a huge range of functionality. Check out the SQAF automation forum for some good discussions on this topic.

Shane MacLaughlin
+2  A: 

"anti-aliasing works or that the rounded corners on a web site look how they are supposed to?"

You could theoretically write automated tools to take snapshots of the renderings and somehow parse them and compare vs the mockup.

You'd need some sort of "anchoring" mechanism to align the model answer with the rendered output and then do a colourwise diff on it, where the resulting output being a complete black image == perfect compliance.

However, doing this is undoubtedly exhaustively complicated, and wont compensate for perceptual failures such as how it is seen to a colourblind person on a screen with a poorly calibrated colourmap.

What you instead need to do is create a full tree of all navigation paths possible in the application ( a little easier to do programmatically/test suite driven ), and then hand a specification to a set of humans to go through and execute on a variety of platforms.

That will handle this week, but will you repeat the manual tests evey time you make a change to code? Or every time you make a release? Manual tests simply will not scale. They're cheap in the short, but hopelessly costly in the long run. – Tim Ottinger

FWIW, Even Firefox still has a human driven test suite. Humans are simply better at recognising behaviour that while meeting the defined standard, does not meet some other standard that has not yet been arbitrarily defined, and thus, has not had a test-case written for it yet.

Kent Fredric
+1  A: 

This is a hard problem with unit testing, and there is no good answer. Inspecting the result displayed on the screen technically isn't unit testing anymore (it's more functional testing).

The best approach I've found is to structure your code to make the view layer as thin as ultimately possible. Patterns like MVC and Presentation Model are useful for this. Once you've done that you can test the business logic of the view (as in the specific interactions between view components) programmatically without having to actually display anything.

madlep