Ask HN: What do you use to Unit Test your Web app?
I've been working on a web-app with a team for the past 2 years, and we are trying to move into a fully continuous integration model. Currently we have no unit tests - however our app is fully tested and we have a good amount of happy live clients. We are at a point where it's becoming increasingly important that we maintain a well working system with each update.
- I'm curious what test harness you would recommend? - For a web-app, what exactly do you test and what do you skip? - How do you structure the tests? Do you break it into separately testing the UI, data objects, helper classes, etc. - or do you do functional testing and just test specific features? - Do you unit test your web app? Why, why not?
Our app is (unfortunately) in ASP.net/C#, but runs well and development has been quick.
I would appreciate any feedback.
7 comments
[ 3.4 ms ] story [ 27.9 ms ] threadI am pretty diligent with testing, but sadly I am only human.
We have a large test suite using SimpleTest for testing the PHP side of things on 99designs, along with a custom web-based test runner. Only problem is our full test suite now runs at over 4-5 minutes. 90% of the time is taken up with setting up a fresh database environment before each test. Interested to hear how everyone else handles this.
Are you using Webforms or MVC? Just out of curiosity.
Since you have NO automated tests, start this way: 1) Every single time someone fixes a bug or adds a new feature, they MUST have at least one automated test that "proves" this functionality is correct 2) In your "spare" time, you can also write automated tests to test the code execution paths covered in your manual tests that I assume you run
As for what to skip, at the beginning: nothing. Try testing -everything- you touch. You need all you can to get some real regression testing in. Eventually when you are at 50-70% code coverage you will be in a position to know what are the high-value things to cover and maybe pick and choose (although probably not).