Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
code:tdd [2013/09/26 20:02] alfred [Best Practices] |
code:tdd [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| ====== TDD (Test Driven Development) ====== | ====== TDD (Test Driven Development) ====== | ||
| ===== Basics ===== | ===== Basics ===== | ||
| + | El TDD es una metodología de diseño. No de desarrollo ni de tests. | ||
| + | ==== Test unitarios y funcionales ==== | ||
| ==== TDD pipeline ==== | ==== TDD pipeline ==== | ||
| {{:code:tdd:tdd_cycle.jpg?direct&200|}} \\ | {{:code:tdd:tdd_cycle.jpg?direct&200|}} \\ | ||
| Línea 25: | Línea 27: | ||
| * Use mock objects to test code at system boundaries (e.g. database, container, file system) so that tests run fast. | * Use mock objects to test code at system boundaries (e.g. database, container, file system) so that tests run fast. | ||
| ==== Why unit tests? ==== | ==== Why unit tests? ==== | ||
| - | Every day in our office there is an exchange which goes something like this: \\ | + | Every day in our office there is an exchange which goes something like this: \\ \\ |
| - | ''Man, I just love unit tests, I've just been able to make a bunch of changes to the way something works, and then was able to confirm I hadn't broken anything by running the test over it again...'' \\ | + | //Man, I just love unit tests, I've just been able to make a bunch of changes to the way something works, and then was able to confirm I hadn't broken anything by running the test over it again...// \\ \\ |
| The details change daily, but the sentiment doesn't. Unit tests and test-driven development (TDD) have so many hidden and personal benefits as well as the obvious ones that you just can't really explain to somebody until they're doing it themselves. | The details change daily, but the sentiment doesn't. Unit tests and test-driven development (TDD) have so many hidden and personal benefits as well as the obvious ones that you just can't really explain to somebody until they're doing it themselves. | ||
| Línea 39: | Línea 41: | ||
| - Good unit tests can help document and define what something is supposed to do | - Good unit tests can help document and define what something is supposed to do | ||
| - Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. | - Unit tests help with code re-use. Migrate both your code and your tests to your new project. Tweak the code till the tests run again. | ||
| + | |||
| + | ===== Patrones ===== | ||
| + | ===== Notas ===== | ||
| + | * {{:code:tdd:testing_fun_really_.pdf|Unit and functional tests}} | ||
| + | * {{:code:tdd:advanced_unit_test_part_v_-_unit_test_patterns_-_codeproject.pdf|Unit test patterns}} | ||
| + | * [[http://stackoverflow.com/questions/333682/tdd-anti-patterns-catalogue|Anti patterns catalogue]] | ||
| + | * [[http://www.ibm.com/developerworks/java/library/j-test/index.html|How to make unit tests?]] | ||
| + | * [[http://www.youtube.com/playlist?list=PL0CCC6BD6AFF097B1|Videos of unit test patterns]] | ||