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) m |
Lauren Tabak (talk | contribs) m |
||
Line 29: | Line 29: | ||
'''Difference between TDD and Unit Tests''' | '''Difference between TDD and Unit Tests''' | ||
− | |||
+ | 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> | ||
− | How do we solve the problem by implementing STDD? | + | 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 code that was designed using tests.<br> |
+ | |||
+ | |||
+ | Like unit tests, TDD tests can be used for regression testing. You can use TDD tests to immediately determine whether a change in code has broken existing application functionality. However, unlike a unit test, a TDD test does not necessarily test one unit of code in isolation. <br> | ||
+ | |||
+ | Like acceptance tests, TDD tests are used to drive the creation of an application. TDD tests work like mini-acceptance tests. You create a TDD test to express the application functionality that needs to be implemented next. However, unlike an acceptance test, a TDD test is not an end-to-end test. A TDD test does not interact with a live database or web server. <br> | ||
+ | |||
+ | |||
+ | |||
+ | You can do unit testing without doing test driven development. However you can't do test driven development without using unit tests.<br> | ||
+ | |||
+ | When you do traditional unit testing, you write test after you wrote your code.<br> | ||
+ | |||
+ | Test driven development approach is to write unit test before writing code.<br> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | '''How do we solve the problem by implementing STDD?''' | ||
Revision as of 17:44, 12 March 2014