Building cross-referenceable requirements statements in test plan documentation



  • I'm in the process of updating document templates for a customer. Part of the documentation template stack are the usual QA items: Requirements (RS), Architecture (ADD), Test Plan (TP) and Test Report (TR). These templates are all manually written Microsoft Word documents (this is a requirement. A management system like EA has not been widely accepted). Has anyone found an efficient (low risk of copy&paste errors, preserving IDs between documents, etc) way of using Word 2010 features to allow document item cross-referencing? (only within a single document - I'm not even dreaming of inter-document linking yet) For example, if I could create a requirement as a "figure", and I insert a caption, I get automatic generation of number and title, which can be referenced later (I can cross-reference either the caption number or the caption title, as required). A built-in bonus is that the "List of figures" automatically lists the defined figures (ID and caption). Right now I'm having to create individual bookmarks - 1 for ID (SRS-O-001) and 1 for title (No blue M&Ms allowed), and take care to reference the appropriate bookmark elsewhere in the document. If I use section level (e.g. 3.3.1 No blue M&M's) it places an artificial constraint on the document layout (code-smell). I have found that these bookmark definitions can be copied from document to document (e.g. RS to ADD) where they can be referenced again (of course, they have to manually maintained during specification change cycles). Update: It seems like the customer will accept VBA macro code to parse a Word style and generate a table. This opens up the possibility of keeping the requirements and tests (etc) in a database or spreadsheet, and dynamically adding content to the Word documents...



  • Unless I'm missing something about your situation, this is not too hard, though a bit obscure. I just created a small document that does exactly this. No macros necessary. Here's the steps I followed: Start a new MS Word document (I'm using Pro 2010, but I think 2007 had the same capability). Create a few list items, select them, and apply one of the Multilevel List styles whose labels are linked to the Heading styles Under, say, section 1.3, insert an image. Give it a caption, labeled as a Figure. As you said in your post, this will auto-generate a number and title. In our case, it should be "Figure 1-1" Under, say, section 2.2, insert a new cross-reference. Choose reference type Figure, and select the image you applied the caption to in the last step. All pretty standard so far. Now let's do two things to throw it off. Above the first section, create a new section with a new title and so on. So what was section 1 is now section 2 Insert a new image in section 2.1. Give it a caption as before, which should appear as "Figure 2-1" So the old caption and cross reference text are now both out-of-date. Here's how we update them, in two short steps. Bring up Print Preview. In Word 2010, this is just File > Print. Note that the Figure numbers have been updated. Exit Print Preview and they stay that way. 🙂 The cross reference text is still out-of-date, though. Select the whole document with Ctrl-A (Select All), and press F9 (Update Fields). The cross reference text now matches the caption text. If your fields don't update when you bring up Print Preview, enable the option at Word Options > Display > Printing Options > "Update fields before printing".



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2