MD5 code kata and BDD -


I was thinking of implementing MD5 as code code and wanted to use BDD to run the design Was (I am a BDD newby).

However, from the beginning of the only test, I can start thinking that passing in an empty string, and the easiest thing to do is embedding hash in my program and returning.

Its logical extension is that I finish embedding hash in my solution for every test and to decide whether to return, switch to input which course Working MD5 will not result in the program.

One of my problems is that there should be only one public function:

  public stable string MD5 (input byte [])  

And how do I check the internal?

Is my view completely flawed or is it inappropriate for MD5 BDD?

I believe that you decided to work very hard for a BDD code- Kata code -Cata or whatever I have understood about it so far, is that you want to see some problem in small incremental steps, so that you can complete these steps in red, green, reflector iterations.

For example, there may be an action to find the position of an element within an array, it could be:

  1. If the array is empty, the position 0 There is no needle element
  2. test type execution. Refactor
  3. If the array is not empty, and if the element does not exist, then Position -1 is
  4. Test Write Implementation. Refractor
  5. If the array is not empty, and the element is first in the list, the position is 1
  6. Write the test implementation. Refactor

I really do not know how to break the MD5 algorithm in such steps. But this can happen because I'm not really an algorithm man if you better understand the steps involved in the MD5 algorithm, you might have a better chance.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -