wiki:RequirementsManagement

Version 3 (modified by Cinc-th, 9 years ago) (diff)

Some minor improvements. Added summary section.

Note
This page is work in progress

Requirements Management

Every once in a while there is a question about doing requirements management with Trac. For quite some time there is a Request-a-Hack for a plugin implementing it, see #1226. While having an out of the box solution would be nice there are quite a few plugins which can be leveraged for building a requirements management solution.

On this page I (Cinc-th) want to show one possible approach for doing so. I'm working in development of IEC 61508 compliant control devices. We use Trac for doing all the requirements tracking mandated by the aforementioned standard.

Be aware that the solution presented here may or may not work for you. We use quite some custom made plugins to support our internal processes wrt requirements tracking. These plugins are private and you may have to create your own to scratch your own itch.

Before you start

Don't select a tool because it's fancy and then model your requirements management process so it can be supported by the tool. This will fail in the end.

Make sure you know your process and environment, e.g.

  • Which types of requirements do you have? System requirements, functional requirements, test cases, ... ?
  • Who is writing them? The tech people or maybe management people? You will learn that it may be impossible to drag your mangement people away from MS Word and friends. So you may need a Word document importer.
  • Is there a predefined workflow for requirements, e.g. draft->in review->approved->closed?
  • Is the workflow dependent on the type of requirement?
  • How do you manage changes to requirements?
  • What about roles and permissions in the process?
  • Do you need some kind of sign off?
  • It may be necessary to import data from other tools or departments. For example the test department may be using their own tool chain and even their own bug tracker.
  • ...

After reviewing your process requirements you should evaluate if Trac with the appropriate plugins is a viable solution. Don't do that by counting bullet points but by actually using it for a project. The beauty of Trac is that by adding the right plugin or writing a new one more or less every need may be fulfilled and in the end your solution exactly matches your process requirements.

Requirements management using Trac

Environment type

Each project lives in a separate environment with its own SQLite database. This way you may not accidentally alter data not belonging to your current project because of a misconfiguration (e.g. broken permissions) or bug in one of your plugins. It makes access control easier which may be important.

After the project is done one may revoke all write permissions and archive the complete environment so the current state of requirements is frozen.

Requirement Types

To distinguish requirements and test cases at least two new ticket types must be created:

  • requirement
  • testcase

In our department we only track requirements in the environment so all other ticket types are removed. If you want to use your requirements Trac also for issue tracking keep the standard ticket types. There is no need to create special types for each level of a V model but !nobody stops you from doing so.

Defining roles

For adding custom permissions see:

http://trac.edgewall.org/wiki/TracPermissions#CreatingNewPrivileges

Creating specialized workflows

A workflow for a requirement is very different from a standard issue workflow. Using MultipleWorkflowPlugin (disclaimer: I'm the maintainer) specific workflows for each new type may be created:

[ticket-workflow-requirement]
leave = * -> *
leave.default = 1
leave.operations = leave_status

approve = new, reopened -> approved
approve.operations = del_resolution
approve.permissions = TICKET_MODIFY

reopen_verified = closed -> reopened
reopen_verified.name= Reopen
reopen_verified.operations = set_resolution
reopen_verified.set_resolution=from verified
reopen_verified.permissions = TICKET_MODIFY

reopen_approved = approved -> reopened
reopen_approved.name = Reopen
reopen_approved.operations = set_resolution
reopen_approved.set_resolution=from approved
reopen_approved.permissions = TICKET_CREATE

remove = new, reopened, approved, closed -> removed
remove.name=Remove this Requirement permanently
remove.operations = set_resolution
remove.set_resolution= removed
remove.permissions = TICKET_MODIFY

verify = approved -> closed
verify.name=Verifiy the Requirement and mark
verify.operations = set_resolution
verify.set_resolution=verified
verify.permissions = TICKET_MODIFY

[ticket-workflow-testcase]
leave = * -> *
leave.default = 1
leave.operations = leave_status
...

You have to adapt this to your own process but you get the idea.

Parent - Child relationship

There must be some kind of parent - child relationship between tickets so one may follow the chain of requirements in forward and backwards direction. The following plugins are suitable:

Requirements Grouping

Grouping may be achieved by specifying different requirement types. Each level of the V model is mapped to a different ticket type. This is probably not practical enough because you may have several thousand requirements for a single level.

Additional grouping may be done using the component field of a ticket or a custom ticket field. In our environment this is done using the custom field docid because every requirement starts life in an external document with a unique document id which is imported into Trac after approval.

By grouping it's possible to find requirements belonging to some part of your product/project. For example in hardware development you may group all requirements pertaining to the power supply by one id thus making it easy for the power supply people to check for fullfillment.

Summary

Install the following plugins:

Add the following settings to your trac.ini:

[ticket-workflow-requirement]
leave = * -> *
leave.default = 1
leave.operations = leave_status

approve = new, reopened -> approved
approve.operations = del_resolution
approve.permissions = TICKET_MODIFY

reopen_verified = closed -> reopened
reopen_verified.name= Reopen
reopen_verified.operations = set_resolution
reopen_verified.set_resolution=from verified
reopen_verified.permissions = TICKET_MODIFY

reopen_approved = approved -> reopened
reopen_approved.name = Reopen
reopen_approved.operations = set_resolution
reopen_approved.set_resolution=from approved
reopen_approved.permissions = TICKET_CREATE

remove = new, reopened, approved, closed -> removed
remove.name=Remove this Requirement permanently
remove.operations = set_resolution
remove.set_resolution= removed
remove.permissions = TICKET_MODIFY

verify = approved -> closed
verify.name=Verifiy the Requirement and mark
verify.operations = set_resolution
verify.set_resolution=verified
verify.permissions = TICKET_MODIFY

# Create your testcase workflow here
[ticket-workflow-testcase]
leave = * -> *
leave.default = 1
leave.operations = leave_status
...