Skip to content

Testing the use cases of a frontend application #44

Answered by gregorriegler
nikoheikkila asked this question in Q&A
Discussion options

You must be logged in to vote

I like to start with a test that does a thing like the user would do it. So mostly blackbox, UI driven.
Then I make it pass as simple as possible.
Doing this I soon discover how I'm mixing UI Infrastructure code with UI Logic code. When that happens I use the existing tests to refactor and separate those two. This yields a seed of logic that is not UI but is nicely isolated and testable. Maybe its a countdown, or a calculator, or a data-retriever. I then test drive this new thing directly to cover the missing paths, forming a coherent model.
I end up with tests like the test-pyramid describes. A little through the UI, more on the unit level. My design has a boundary between the UI itself …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nikoheikkila
Comment options

Answer selected by nikoheikkila
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants