Well, I decided to try to handle the whole TDD process from start to finish.
I write a simple blog in an ASP.NET MVC 2 application and started with acceptance tests to test my fetaures when I implement them. I use SpecFlow as my BDD / ATDD base.
I read Growing Object-Oriented Test-Driven Systems , so I started, like me.
I would be at the point described as an iteration of Zero in the book where I create "Walking Skeleton"
I decided to start the login process as my "thinnest piece of functionality that checks all the components of the system." In this case, the site itself and the database.
So, I wrote a story with a detailed login, and the first script that I write is successfully logged.
One of the values in the specified script
"Given there is a registered user with the username 'TestUser' and password 'TestPassword'"
However, I am not sure how I will implement this step.
Obviously, this means that the database must have data with the specified credentials. However, as a good little programmer, I would like the password to be hashed in some way.
I was thinking of writing some kind of DatabaseHelper class that can insert this for me. However, this will contain a hash code for hashing the password, and then the application itself will need the same hash code that seems to violate DRY.
So here are a few related questions:
- , , , - ? , ? , , , ?
- , , ? ? , , , ?
, , TDD , , , "-" .
Advance.