Essentials of Testing
One tool, one purpose
Bettina Polasek, Head of Quality Management Marco Cicolini, Head of Quality Engineering AdNovum Informatik AG ID 158
Essentials of Testing One tool, one purpose Bettina Polasek, Head - - PowerPoint PPT Presentation
Essentials of Testing One tool, one purpose Bettina Polasek, Head of Quality Management Marco Cicolini, Head of Quality Engineering AdNovum Informatik AG ID 158 Agenda > Scope > Motivation > Toolbox > Tools for a Purpose > Demo
One tool, one purpose
Bettina Polasek, Head of Quality Management Marco Cicolini, Head of Quality Engineering AdNovum Informatik AG ID 158
2
> Scope > Motivation > Toolbox > Tools for a Purpose > Demo > Experiences > Outlook > Conclusion
2
3
3
4
4
5
6
7
7
8
8
9
9
10
10
11
11
12
13
13
14
> General – Test whole application – Test use cases > Selenium – Real browser tests – Ajax support > HtmlUnit – Faster than Selenium – Request-based Test > General – Slow – Fragile > Selenium – Browser fragility > HtmlUnit – Browser implementation
15
> General – Stable (no UI involved) – Faster than UI tests > Embedded container – Test target container > JPA – Fast – Test precisely what you want > General – No UI tests possible – Database required > Embedded container – Container specific – Slow > JPA – No EJB interaction – Low-level API
16
> General – Very fast – Test only business logic > JUnit – One test, one purpose > Mockito – Mock “away” complex components – Test behavior > General – No integration tests > JUnit – DB and UI not testable – Test only functionality > Mockito – Mock setup may get complex – Mocking hides missing implementation
17
> Show your customer what you do. > Design simple and fast executable tests. > Decide on what and how you test (quadrants). > Have the right test distribution (testing pyramid). > Treat your test code as first class code!
17
18
> One tool, one purpose > Tools have to make testing simpler > Set up guidelines & documentation > Form experts for tools > Train developers in using tools
18
19
19
20
20
21
> Books
> Tools
21
22
22
24
24
25
25 25
26
General Test whole application Slow Test use cases Fragile Selenium HtmlUnit Real browser tests Browser fragility Faster than Selenium Browser implementation Ajax support Request-based tests
27
Tool Advantages Disadvantages General Stable (no UI involved) No UI test possible Faster than UI tests Database required Embedded container Test in target container Container-specific Slow JPA Fast No EJB interaction Test precisely what you want Low-level API
28
General Very fast No integration tests Test only business logic JUnit One test, one purpose DB and UI not testable Test only functionality Mockito Mock “away” complex components Mock setup may get complex Test behavior Mocking hides missing implementation
29
> Introduce people responsible for testing > Writing tests is more than just validating features > TDD / BDD > Review your tests
29