I’m currently working in an industry where extensive documentation is required, but the apps I’m writing are all pretty much cookie cutter at a high level. What I’d like to do is build an app that asks a series of questions regarding business rules and marketing requirements to generate a requirements spec.
For example, there might be a question set that asks “Does the user need to enter their age?” and a follow-up question of “What is the minimum age requirement?” If the inputs are “yes” and “18”, then this app will generate requirements that look something like this:
“The registration form shall include an age selector”
“The registration form shall throw an error if the selected age is less than 18”
Later on down the line, I’d like to extend this to do additional things like generate test cases and even code, but the idea is the same: generate some output based on rules determined by answering a set of questions.
Are there any patterns I could research to better design the architecture of such an application? Is this something that I should be modeling as a finite state machine?
4
This is not fully baked, but you should get the idea.
Requirements Table:
RequirementID PK
Question String
Action String
Artifact String
Condition String
Role String
Template String
Example tuple:
Question "What is the minimum age requirement"
Action "display an error message"
Artifact "the registration page"
Condition "age is less than <$ answer>"
Role "user"
Responses Table:
ResponseID PK
RequirementID FK
ProjectID FK
Answer String
Pseudocode
foreach(response in Responses)
{
// Display template text with text substitution
}
Sample Template text
The application shall <$ Action> on <$ Artifact> when <$ role> is <$ condition>
1