Learn, Share and Keep Learning
| Software Testing - A Cautionary Tale |
|
There are some basic rules of thumb which will serve you well in testing any application that deals with lists of data (and which applications don't?). 1.1; few; many" 2."don't make any assumptions" 3."remember to mix it up a little" This case study covers a very interesting example of where following the rules of thumbs *exactly* paid dividends. The ProblemThere was an interactive reporting solution that was having performance issues: essentially there was some pathological performance degradation under some circumstances. The code contributing the biggest slice of time wastage was in a 3rd party component that really could not be There were multiple passes at the problem and the usual things were done: * Direct: get the problem project and simply pause the debugger at the obvious pain point These scrubs made a palpable difference on each iteration: for reasons related to the constraints of the 3rd party component and the application framework it was hosted in, traceability was not great in the code and it turned out to be difficult to get the job right first time. The bombshell In this case it's worth going into a little detail: Developer and testers have an awareness to some level of the importance of the complexity of a given process on the run time: essentially they tend to have an expectation that (roughly) the run time will go as O(n) and for many apps there is a strong pressure for n to be a small number, otherwise the user experience can be very disappointing. Many defects are raised around the issue that n is not in fact a small number. In this instance, n seemed to be an acceptable figure if not great. What was going on? The developer debugged the application: the same call sequence as any other data; just a very different time taken. What was different in the project? Working furiously to the very last days of the development deadline the answer suddenly became apparent in debugging and comparing the behaviour of the "good" big projects and the "bad" big projects. Where x and y where below the application defaults the second term was never noticed through behaviour and the 3rd party component source was never scrutinised to the level where the flaw could have been found. When the application defaults were massively exceeded this O(x-y) had the opportunity to become - "quite significant". Why didn't the automated tests catch this when the new larger sizes were set in configuration? Because the tests made a reasonable assumption - that n mattered and hence it was not noticed by the tester and developer that the list sizes were all the same - x-y was always zero The problem project has real data with large and different lists counts - all it took was a list to be several 1000 items long and for another to be small for the lurking performance issue to be exposed. The moral of the story |