Skip to content

Instantly share code, notes, and snippets.

@pslusarz
Last active August 20, 2019 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pslusarz/ff636cae98e6191560bb96d60d439671 to your computer and use it in GitHub Desktop.
Save pslusarz/ff636cae98e6191560bb96d60d439671 to your computer and use it in GitHub Desktop.
test workshop day 3
============================
** Context ***
============================
Day 1 - meticulous, unit test TDD
Day 2 - refactoring
Day 3 - "Automated testing in the real world" or "10,000 foot dive (with some hand holding)"
============================
** Day 3 Training objectives ***
============================
- identify types of non-unit tests
- recognize strengths and weakensses of various types of tests
- identify inputs and outputs of a module/application
- understand how dependency injection can facilitate higher level tests
- rudimentary knowledge of Spring support for testing
- ability to apply concept knowledge to identify dependencies and write higher level tests for a webapp
================
** Content ***
================
- Test pyramid
- unit tests don't scale
- single assert per test
- bugs on the boundaries... need integration
- continuum: confidence, integration, fragility, run time
- end to end vs unit... what about in between?
- Module as a blackbox
- identify inputs and outputs
- given/when/then vs instantiate module given sequence of inputs and check outputs
- how do you check outputs in external systems? How do you assure inputs from external systems?
- workshop. Given a few sentence description of an application, split into groups and identify internal and external inputs, internal and external outputs. Each group facilitated by one instructor. After 20 minutes, present results (share other apps)
(lunch)
- Present Spring MVC support for testing (https://spring.io/guides/gs/testing-web/)
- demonstrate how mocking external systems via a text context allows fully repeatable (and quick running tests)
- workshop: given an functioning app with external dependencies and some internal configuration, write higher end tests, starting with end to end
- instructor demo of a possible approach
- discussion. Identifying weak spots in automated testing and how to cope. How to cope with external systems integration (focused integration tests, contract tests).
===================
ideas: try introducing layers for purposes of testing
chain of different components and the tradeoffs of different strategies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment