Hendrik Belitz wrote:
> Although I agree with that, I think that unit tests are not the answer
> to detect UI faults. Indeed, Integration and acceptance tests provide
> such capabilities in a much more usable manner, without significantly
> loosing test coverage.
Tests also help you go faster, not just detect faults. Consider this example:
<div style='color: red'>
<div style='background-color: green'>
To assert that your resulting color scheme is nauseating, you might just test
you have a red div followed by one with a green background.
You do not render that - physically, or virtually - then assert the contained
text appears red-on-green. You just assert you have two divs.
Now suppose a careless programmer changed their order:
<div style='background-color: green'>
<div style='color: red'>
The browser would render that correctly, and the user would see no bug. But the
test would fail - it is "hyperactive" - and that is a Good Thing. The test
allowed programmers to rapidly develop, knowing that if any test fails
unexpectedly they have the option to revert, without even debugging to figure
out _why_ the tests failed.
You can't go fast unless your car has brakes and your road has traffic lights!
--
Phlip
http://www.zeroplayer.com/