Skip to content

Instantly share code, notes, and snippets.

@Jhowden
Created October 28, 2013 02:42
Show Gist options
  • Save Jhowden/7190637 to your computer and use it in GitHub Desktop.
Save Jhowden/7190637 to your computer and use it in GitHub Desktop.
TDD Video
When delivering quality software, it is unwise to just hack something out that works. This way produces ugly and unmaintainable code.
TDD produces better results faster because you are not just flailing around making guesses about mistakes/errors. Furthermore, having a plan gives programmers a process to follow and work around obstacles.
Testing and TDD are not one in the same. Difference between testing and TDD:
* tests provide documentation of code
* tests help us cath future errors
* tests give long-term time savings because of catching errors
However, tests are just a tool and not a process.
TDD helps programmers:
* decide what the code will do
* write a test that will pass if the code does that thing
* run the test to see it fail
* write the code
* finally, run the test and see the written code pass
TDD is:
* designing and planning before coding
* documenting our design
* proof that code implements design
*************** encouraging design of testable code ***************
Testable code is:
* Modular - forces us to break it down so that we can test it
* Decouples design - if our methods are too tightly interwoven then we can't test them. Separation of concerns
* Ensure the methods have limited scope
The result is better code in less time
* You will get the job done fast today because your thinking is organized and not flailing
Can't test everything, so you have to use judgment:
* some things are too hard to test
* some tests are too trivial to be useful
* overtesting is possible, don't have to repeat the test
* explaoratory coding w/o tests is ok, but as soon as it looks like production code; stop, back test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment