Write a tool that checks user stories written as
As a <role>, I want <goal>, so that <benefit>
Read stories, one per line, until the end of input. For each story print Story k: followed by its problems, one per line starting with - , or - OK if there are none. Check, in this order (matching is case-insensitive):
- The line must start with
as aoras an. Otherwise print- missing roleand skip the other checks for this story. - It must contain
, i want→ otherwise- missing goal. - It must contain
, so that→ otherwise- missing benefit. - For each vague word in this list that appears as a substring:
fast,easy,user-friendly,etc,simple,flexible→- vague word: <word>(in list order). - If the text between
, i wantand, so that(or to the end if there is no benefit) containsand→- goal has 'and': consider splitting. - If the story has more than 30 words (split on spaces) →
- too long (N words).
Finally print Stories: n, OK: k.
Input:
As a student, I want to post a question, so that classmates can help me
I want a fast app
As an instructor, I want to tag and hide exercises, so that Buddy is easy to control
Output:
Story 1:
- OK
Story 2:
- missing role
Story 3:
- vague word: easy
- goal has 'and': consider splitting
Stories: 3, OK: 1