Anti-Moronic Posted November 17, 2010 Share Posted November 17, 2010 I must confess, I've not really done much unit testing at all in the last 3 years. Can anyone give me an idea of what they would test and why that would be faster or more efficient than running the code as a user? One area I can see it having huge benefits is when I'm testing methods which interact with a database, like user registration, which I would probably test by registering several times - fixing any bugs, making amendments and repeating. Ok, so I kinda sold the idea to myself there But, what about for small applications? I've seen people testing whether a variable is countable...why would I not just check the output immediately? Appreciate any advice. Link to comment https://forums.phpfreaks.com/topic/218958-php-unit-testing-practical-uses-in-small-projects/ Share on other sites More sharing options...
ignace Posted November 17, 2010 Share Posted November 17, 2010 Deciding whether or not to Unit-Test does not depend on the size of the application but rather on the risk/value of the application. You can have a tiny application that transfers funds from the client to your bank account, you don't want anything to go wrong there, do you? In short apply Unit-Testing for high-risk and/or high-value software. Unit-Testing is like a bug-spray it doesn't guarantee you killed all bugs but the annoyance will be far less Link to comment https://forums.phpfreaks.com/topic/218958-php-unit-testing-practical-uses-in-small-projects/#findComment-1135680 Share on other sites More sharing options...
Anti-Moronic Posted November 18, 2010 Author Share Posted November 18, 2010 Thank you very much for that thoughtful explanation! Link to comment https://forums.phpfreaks.com/topic/218958-php-unit-testing-practical-uses-in-small-projects/#findComment-1136022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.