Skip to main content

Posts

Showing posts from May, 2014

Learning Tests

At the last Agile Staffordshire I attended the task was to complete the string calculator with constraints. The group worked in pairs and everything was running smoothly. Until I heard a few guys behind struggling with something.I'd worked with one of the developers previously, so they called me over to take a look. What he found was pretty shocking - they had found a bug in the .NET framework. The string class of all things. Bugs exist in all code. Bugs in the substring method though are probably rarer given how exhaustively used this particular bit of code is.The problem was how they expected the method to behave. When creating a substring they were getting confused with how the offests worked. This is an easy mistake. Different languages or frameworks can have different methods to do similar tasks. I take no shame in not knowing of the top of my head whether the offest of the substring method is an offset of the index, or an offset from the start of the string.I managed to spo…