Write a linter for requirement sentences. Read lines until the end of input; each line is ID: text. For each requirement print its EARS pattern and its problems.
Pattern (case-insensitive, on the text after ID: ):
- starts with
when→EVENT - starts with
while→STATE - starts with
where→OPTIONAL - starts with
ifand containsthen→UNWANTED - starts with
ifwithoutthen→UNWANTED?(incomplete) - otherwise →
UBIQUITOUS
Problems (in this order):
- no
shallin the text →no 'shall' - each weak word from this list that appears (substring, list order):
appropriate,user-friendly,fast,easy,efficient,as much as possible,etc,and/or,flexible→weak word: <w> - the text contains the word
itortheyas a whole word (ignore punctuation) →pronoun: check who it refers to
Output: ID [PATTERN] OK or ID [PATTERN] problems: p1; p2; .... At the end: Checked n requirements, k with problems.
Input:
R1: When a post receives 3 reports from different students, the system shall hide the post.
R2: The app shall be fast and user-friendly.
R3: If login fails 5 times, the system shall lock it.
Output:
R1 [EVENT] OK
R2 [UBIQUITOUS] problems: weak word: user-friendly; weak word: fast
R3 [UNWANTED?] problems: pronoun: check who it refers to
Checked 3 requirements, 2 with problems