In our last episode, we implemented a simple ability to add a section tag to the XML Notepad. It turns out I wasnt able to work on it after lunch, and in fact its now almost a week since I made that test run. The test points right to the code, and the code is simple, so Ive had no trouble catching up. Chet will be joining me in just a few minutes, and Ill bring him up to speed. Ill record here what we talk about: it will give you a sense of what it takes to bring a new pair up to date.
Meanwhile, Im going to clean up the code a little before getting down to things. Ive learned from experience that it doesnt pay to let it go too long before cleaning things up. Here comes Chet now; Ill bring him up to speed as we go.
In reviewing the code, we discovered that I had copied a bit of extra stuff into the InsertSectionTags(). We also discovered that the Ctrl+S wasnt yet implemented in the GUI. It didnt interfere with the test, but it should have. So Chet said: What we have learned is that when Im not here, you leave things out, your code isnt as good, and your tests didnt find the problem. All true: I need a pair. Anyone in the Ann Arbor area want to volunteer?
We noticed that, at least offhand, we dont know how to test whether the GUI implements a particular control character. Im arguing to defer that issue and go to the core issue of getting things done. A couple of ways exist to check that the key is correctly implemented in the GUI. We both thought independently of the cool way: use reflection to check the class, and see to it that it implements what it needs to. Thats way too deep in the bag of tricks to be a good idea, but it could be an interesting learning experiment at some time. The simplest thing to do is just to build a notepad object in the Customer Acceptance Tests (which now test against the TextModel) and to send KeyPress events to it. Thats probably a good way to do it, but Chet and I both have fear of creating GUI classes during tests. Thats probably not a good fear, but its holding us back right now.
Were going to defer solving this problem. But we know it is a real problem: theres nothing that stops us from writing a good customer test, making it work with lots of good programmer tests, and then having the GUI not show up with the feature. We made a mental note to notice when it happens again, in case we dont get to this test early on. Right now, though, were going forward with finishing the feature.