testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1b 18...
TRANSCRIPT
![Page 1: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/1.jpg)
Testare automatăROSEdu CDL, martie 2011
![Page 2: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/2.jpg)
când scriem software
facem greșeliintroducem bug-uri
![Page 3: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/3.jpg)
• Useri
Tipuri de teste
![Page 4: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/4.jpg)
![Page 5: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/5.jpg)
• Useri
Tipuri de teste
• Manual
![Page 6: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/6.jpg)
Sunt leneș.
![Page 7: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/7.jpg)
![Page 8: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/8.jpg)
• Useri
Tipuri de teste
• Manual• Teste funcționale
![Page 9: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/9.jpg)
• Useri
Tipuri de teste
• Manual• Teste funcționale• Unit test
![Page 10: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/10.jpg)
Paranteză: cod organizat
![Page 11: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/11.jpg)
![Page 12: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/12.jpg)
Unit tests
• Testăm un singur lucru• Îl testăm o singură dată• Set-up cât mai simplu• Izolăm codul (mocks & stubs)
![Page 13: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/13.jpg)
Mocks• Izolăm componenta• Verificăm interacțiunea cu restul
codului• De evitat abuzul:• tight coupling• set-up complex
![Page 14: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/14.jpg)
Test-driven development
• scrie un test• rulează-l, trebuie să fail• implementează codul• rulează iar testul, trebuie să
meargă
![Page 15: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/15.jpg)
Concluzii• Testarea se face oricum,
mai devreme e mai bine• Beware temptation• Expune probleme de
organizare a codului (smell)
• Testarea e grea dar merită
![Page 16: Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24 Terminal — bash — WARNING manage edit INFO Added Updater INFO Application New](https://reader035.vdocuments.site/reader035/viewer/2022062417/61258fb314ada546d405b959/html5/thumbnails/16.jpg)
•http://palladion.com/home/tseaver/obzervationz/2008/unit_testing_notes-20080724
•http://www.voidspace.org.uk/python/mock/
•http://www.sqlite.org/testing.html
•http://blip.tv/file/4881513 (PyCon 2011: Testing with Mock)
•http://www.infoq.com/presentations/integration-tests-scam