I agree with you.
this issue was discussed once on this mailing list. within web2py it
is possible to write doctest strings for controllers and it is
possible to write a test controllers that runs all the test strings.
Unfortunately this is undocumented. It is on my agenda to explain it
better and perhaps make such test controller part of the framework.
Actually it would be easy to write a red/green controller as you
suggest using doctest strings. I will try to make it part of next
version.
Massimo