Testing a web application questions
I have never really done any serious testing other then writing some simple Java unit tests at University. I want to try and get into the practice of testing so I want to start small on this simple website that I am currently developing.
The site is built using CodeIgniter and doesn't really do any dynamic things other then the contact form log开发者_开发百科ging what has been entered into a database.
I have written two unit tests for this controller using TOAST which test the contact model's insert and retrieve functions which you can see on pastebin.
What other testing practices would you recommend and what could be applied to such a small web application?
before you write test, you need to learn how to write a testable code.
this is a good start blog post
google video about testable code
another google video about testable code
Try to test model off your application using TDD. Write test first. Make test fail. Write production code. Make test pass! I don't think you have to test controller and view because they don't have bugs which can't be fixed quick?
According to your requirements, I think you can go for Selenium IDE provided your website is completely in HTML. This is because Selenium does not support Flash Content.
In Selenium IDE you can convert the test cases in the format you want like Ruby, HTML, Java, PHP etc.
Also if your website is quite stable and you want to cover one or two single browser/OS combination, you can save a lot of time by automating the things using Selenium.
精彩评论