Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24...
Transcript of Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24...
Testare automatăROSEdu CDL, martie 2011
când scriem software
facem greșeliintroducem bug-uri
• Useri
Tipuri de teste
• Useri
Tipuri de teste
• Manual
Sunt leneș.
• Useri
Tipuri de teste
• Manual• Teste funcționale
• Useri
Tipuri de teste
• Manual• Teste funcționale• Unit test
Paranteză: cod organizat
Unit tests
• Testăm un singur lucru• Îl testăm o singură dată• Set-up cât mai simplu• Izolăm codul (mocks & stubs)
Mocks• Izolăm componenta• Verificăm interacțiunea cu restul
codului• De evitat abuzul:• tight coupling• set-up complex
Test-driven development
• scrie un test• rulează-l, trebuie să fail• implementează codul• rulează iar testul, trebuie să
meargă
Concluzii• Testarea se face oricum,
mai devreme e mai bine• Beware temptation• Expune probleme de
organizare a codului (smell)
• Testarea e grea dar merită
•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