DEV Community

Discussion on: When TDD doesn't click, something else should click "harder"!

Collapse
 
leightondarkins profile image
Leighton Darkins

I founds this to be a really entertaining article. Nicely written 👍.

I will challenge you on something though: "never test your UI".

I really hope you mean "never unit test your UI", because without some level of automated end-to-end or user journey tests I'd be very nervous about making changes to a product. How can I be confident that I haven't significantly broken some part of the overall application behavior without spending way more time that I need to poking around the UI for myself? I'd much rather my test suite did that for me.

For my part, when it comes to TDD and the UI, if I'm adding something new to a user journey, the first thing I'm doing is altering the end-to-end test for that behavior to include what I want my change to look like. It will fail initially, and continue to fail until I'm done implementing my work. Once it's passing, I know for certain that the change I made plays nicely in the context of the overall application.

With e2e tools like Cypress at our disposal, there are fewer excuses than ever to avoid writing tests for our UI's.

Collapse
 
yaser profile image
Yaser Al-Najjar

Oops... been edited thanks for the notice 😅

Yeah, there must an automation to test some user stories in an abstract manner, I found recently another very simple tool yet SO POWERFUL tool here:

uilicious.com