This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "OWASP Secure TDD Project"
From OWASP
Lauren Tabak (talk | contribs) |
Lauren Tabak (talk | contribs) |
||
Line 27: | Line 27: | ||
This can be done with unit tests, functional tests and acceptance tests. Usually, all three are used.<br> | This can be done with unit tests, functional tests and acceptance tests. Usually, all three are used.<br> | ||
− | The tests tell you what to do, what to do next | + | The tests tell you what to do, what to do next and when you are done. They tell you what the API is going to be, what the design is. <br> |
The tests permit you to refactor safely, ensuring that the desired behavior continues to work while you adjust your design. The tests also guide you to testable code, promoting smaller methods, shorter parameter lists, and overall much simpler design than other methodologies lead you to.<br> | The tests permit you to refactor safely, ensuring that the desired behavior continues to work while you adjust your design. The tests also guide you to testable code, promoting smaller methods, shorter parameter lists, and overall much simpler design than other methodologies lead you to.<br> | ||
Line 39: | Line 39: | ||
You can write unit tests before you write your code, after you write your code or while you write your code.<br> | You can write unit tests before you write your code, after you write your code or while you write your code.<br> | ||
− | So how does a TDD test differ from a unit test? Unlike a unit test, a TDD test is used to drive the design of an application. A TDD test is used to express what application code should do before the application code is actually written.<br> | + | So how does a TDD test differ from a unit test?<br> |
+ | |||
+ | Unlike a unit test, a TDD test is used to drive the design of an application. A TDD test is used to express what application code should do before the application code is actually written.<br> | ||
TDD is less about testing, and more about designing the code. Unit tests are then used to set the expectations for the end code.<br> When the end code is written, and passes tests (specifications), you have a code that was designed using tests.<br> | TDD is less about testing, and more about designing the code. Unit tests are then used to set the expectations for the end code.<br> When the end code is written, and passes tests (specifications), you have a code that was designed using tests.<br> |
Revision as of 18:39, 12 March 2014