Monday, January 10, 2011

PHP Floating Point Bug Crashes Servers

"A newly unearthed bug in certain versions of the PHP scripting language could crash servers when the software is given the task of converting a large floating point number, raising the possibility that the glitch could be exploited by hackers. The bug will cause the PHP processing software to enter an infinite loop when it tries to convert the series of digits "2.2250738585072011e-308" from the string format into the floating point format. The bug only seems to affect version 5.2 and 5.3 of the language.""Computer scientist Rick Regan first reported the bug on Monday, and the PHP development team issued patches the following day."


Thursday, January 6, 2011

Time spent on writing Unit Tests

Many times, developers spend more time writing unit tests than writing actual code.

Code that could have been shipped long ago, is still stuck because of the unit tests.

How much time do you spend writing unit tests?

See Joel Spolsky & Jeff Atwood's good discussion on Test Driven Development:  http://www.joelonsoftware.com/items/2009/01/31.html

Unit Test - Good or Bad?

TDD (Test Driven Development) has been pretty prevailing in the development circles for the past decade or so.

The idea for sure is a noble and important idea - do not release code without testing it, and always have a set of tests ready - unit tests - to be run after every code change. If the test breaks - that's supposed to mean that you've broken the logic of the existing code.

"Supposed to mean..."

I just spent an hour on fixing a series of test that I broke, only to find out that what really broke is some side non important flow control... It had nothing to do with the function's functionality, other than the fact that since this control broke - the function wasn't pulling out any data (from the mock data set, which is material for another post...)
(OK, you might say it was a poorly designed unit test to begin with, but I suppose that's what happens when developers work under pressure; They must provide unit tests, and under a time constraint).

Yes, TDD is great, but sometimes completely misses the point.

Like anything good - don't exaggerate and don't overdo it.