Reputation:
A friend suggested instead of having a backend class which verifies the user permission in every public function (results are cached and non static) i should have a more 'streamlined' site. When i dropped the backend i also drop the database code and merged them in the appropriate user permission (base user, logged_in_user, moderator).
The site code looks better now that merging them has decreased LOC (tons of LOC in fact) and i write Method() instead of backend.Method() which increases readability. However now that i have no backend how am i suppose to unit test my code? and what about things like user file upload with different extensions? (txt vs jpg vs FLAC)
Upvotes: 5
Views: 445
Reputation: 22438
Google spoke about this at GTAC 2008. They had started looking at creating stubs and mocks for the backend and then run their selenium tests against the front end. This means that when the frontend is doing calls to the backend it is returning something meaningful.
The video of the talk is here http://www.youtube.com/watch?v=5jjrTBFZWgk
Upvotes: 2
Reputation: 11884
As codeape said there are alternatives than unit testing, an alternative is Visual Studio's Website Test
Upvotes: 1