Speccing Lists
By Adrian Sutton
I’ve commented a few times before about how difficult it is to test text manipulation code and most of that is caused by the fact that it’s so hard to comprehensively define all the possible states, user actions and resultant behaviors that are expected. There’s just way too many different cases that can occur (infinite in fact). The two hardest areas for most rich text editors are lists and tables (not surprisingly since their really the only complex structure used in text markup). In order to improve behavior in those areas and avoid any regressions we’ve started specing out the expected behavior.
The first draft for lists contains around 600 expected behaviors (which will map pretty much directly to test cases). That’s 600 basic things that a user might do to lists within the editor. It doesn’t include sequential actions either. It also doesn’t include anything about parsing, serializing or rendering. Fortunately it’s the weekend, I think I’ll try to focus on something a little simpler – you know, like brain surgery or rocket science….