Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24...

16
Testare automată ROSEdu CDL, martie 2011

Transcript of Testare automată · 2011. 3. 22. · 2011-03- it html' 2011-03- 2011-03- 2011-03- 1B 18 23:30:24...

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

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

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

• 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
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

• 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

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
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

• 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

• 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

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
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

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

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

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

Concluzii• Testarea se face oricum,

mai devreme e mai bine• Beware temptation• Expune probleme de

organizare a codului (smell)

• Testarea e grea dar merită