Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking requirements with function tests [closed]

I'm building a command line tool where I can execute commands like this on the input:

PROMPT>userName=Seán<CR>
PROMPT>zodiacSign=Virgo<CR>

where userName is a string type and zodiacSign is of type enumerator.

I also have auto-complete such that I can hit the tab key and get clues, like this

PROMPT>zodiacSign=C<TAB>
         Cancer
         Capricorn
PROMPT>zodiacSign=Ca

The thing is that I'm getting more and more subtle requirements which I'm finding more and more difficult to document into User Stories. For example, I just received the requirement where if I hit carriage-return for the following:

PROMPT>zodiacSign=Can<CARRIAGE-RETURN>

The software should then auto-complete the command zodiacSign=Cancer and execute it since it is the only option.

I will put in place function tests to test each of these nuances. By doing this, I can demo User Stories via my Function Tests.

But what convenient tool would you recommend where I can store requirements / user stories, perhaps even linking them to function tests? Perhaps this tool includes coverage graphs.

like image 430
Baz Avatar asked Jan 16 '23 16:01

Baz


1 Answers

Who is the audience for the requirements? If it is a developer, I'd say that the version control system is a great place to store them. :-)

I would recommend the use of Cucumber or FitNesse. Using the tests as requirements is the way to go.

Cucumber example:

Scenario:
   If a single match is available and the carriage return is pressed
   auto-complete should accept the match

Given valid Zodiac Signs are "Cancer,Capricorn"
When the user enters "zodiacSign=Can<CARRIAGE-RETURN>" at the prompt
Then the shell should auto-complete to "zodiacSign=Cancer"

This is a completely executable test and does well to describe the required functionality.

Hope that helps!

Brandon

like image 187
bcarlso Avatar answered Feb 01 '23 09:02

bcarlso