Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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...

share|improve this question
    
I wonder whether you would have better luck on writers.stackexchange.com. –  user246 Aug 8 '13 at 11:43
    
Hmm. Possibly a very valid observation! Yes, my question is test/QA related, but it is very Word technical... –  KevinM Aug 8 '13 at 12:17
    
The old Rational Requisite Pro was a word add in that solved this exact problem. I haven't used it for 15 years or so but you might want to start looking there. –  Bruce McLeod Aug 14 '13 at 0:47
    
an update: I implemented this using a style assigned to the "requirement reference" and a fixed table layout. Then VBA code is able to search for all instances of the style, navigate the table and copy the results into arrays. After a full document search (had to implement a stupid hack to store the location of the first hit, as the search method can't just search the document once), I could generate tables containing the "discovered" data. Voila! If the requirements are updated, re-run the VBA macro to generate a new table. Copy and paste excess columns if required. Nasty, but it works. –  KevinM Sep 26 '13 at 12:42
    
I want to say "Nice" but maybe I should say "Nasty" instead :-) –  Bruce McLeod Nov 26 '13 at 0:09
show 2 more comments

1 Answer

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:

  1. Start a new MS Word document (I'm using Pro 2010, but I think 2007 had the same capability).
  2. Create a few list items, select them, and apply one of the Multilevel List styles whose labels are linked to the Heading styles
  3. 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"
  4. 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.

  5. Above the first section, create a new section with a new title and so on. So what was section 1 is now section 2

  6. 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.

  7. 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.

  8. 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".

share|improve this answer
    
What you've suggested can only be used to produce a single standard "list of figures". Sure, I could use custom labelling to rename "figure 1" to be "SRS-O-001" and set the caption to "No blue M&Ms", but I can only do this once AFAIK. Word 2010 does not provide enough styling control over figures, captions and "Table of Figures" to produce anything even half-way decent. I need to generate multiple custom x-ref tables, as appropriate for test/requirement and specification/requirement correlation. –  KevinM Nov 26 '13 at 7:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.