News for hackers. Stuff that matters.
Re:Cover your PHP legacy code with 1000 unit tests in just f... by strictfp on Thursday September 19, 2013 @10:25AM (#6411802)
You're probably testing too much. Take Kent Becks advice and only write a test when you can bet a dollar that it would fail. Don't write tests for things which you never fail at. BTW, the term "unit test" can mean many things depending on who you ask. I prefer to stick with the general term "test".
Re:Cover your PHP legacy code with 1000 unit tests in just f... by twistedpair on Thursday September 19, 2013 @11:23AM (#6412158)
This works until you make a significant refactoring. If you have great coverage, you are pretty sure everything's jiving correctly. Not sure what kind of refactoring tools existed back in the SmallTalk days for Beck.
Re:Cover your PHP legacy code with 1000 unit tests in just f... by strictfp on Thursday September 19, 2013 @03:15PM (#6413604)
The OP said that unit testing sucks because it can be automated. If your tests are so simple that they can be automated I would argue that they are useless, because you're not really testing functionality, but more boilerplate. You can usually skip underlying boilerplate tests if you test the functionality (within reason). Focusing on the right level and skipping the lowest level actually makes refactoring easier, since you have a degree of freedom at the very bottom left.
Re:Cover your PHP legacy code with 1000 unit tests in just f... by twistedpair on Thursday September 19, 2013 @04:58PM (#6414258)
Use a boilerplate test generator if you need boilerplate tests, such as Google's CodePro. ;)