dev-resources.site
for different kinds of informations.
Thoughts on ThoughtWorks Radar 2024
The ThoughtWorks 2024 Radar was released (you can download the PDF with 1 click, no annoying sign up required). Below are 2 things:
- me covering things Iâm confused about on Component Testing
- cool new tools to investigate or figure out why they are going from âAssessâ to âAdoptâ
If you just wanna learn about the cool new stuff to look at, skip my component testing rant.
Component Testing: Adopt
I have lots of questions on this âAdoptâ. My current employer has invested a lot of training & tooling around helping teams do Component testing, which I love. What I donât love is the yet another testing technique whoâs definition differs based on who is talking about it.
Lemme outline the few definitions Iâve seen in the wild in the chronological order I learned about them, with what I _think_ ThoughtWorksâ definition is last:
- Storybook to help test React components in isolation, utilized heavily for component framework authors
- testing components in an isolated browser environment using Cypressâ Component Testing
- My latest definition of Cypress Whitebox Testing, meaning all external I/O calls (fetch/xhr, loading JSON, reading localstorage, etc) are cy.intercepted or stubbed/mocked
None of that is the same. A component in the above contexts kind of means a UI component, either something like a or a which composes many other components, code, and CSS. I say âkind ofâ, because in Storybook and Cypress, youâre using a real browser, not a fake one like JSDom. In this context, I believe using a real browser can suss out a lot of issues, specifically around Acceptance Testing, not Unit Testing. I have the opposite experiences to what theyâre citing: you can make Cypress/Playwright extremely fast (using things like it.only, heavy stubbing, designing your UI to be more de-coupled to test specific user flows), and the amount of confidence I have in the application working, for the user, is extremely high. Given Elmâs typing system, this is the primary way you can validate the lack of race conditions in your Elm code, and is nice because you can spend more time writing Acceptance Tests using that tech. Cypress whitebox tests are NOT flaky; theyâre deterministic af, thatâs why we all love them.
However, I do acknowledge debugging can be challenging. Just because youâre âin a browserâ doesnât always give you extensive insight into why something broke despite breakpoints, debugger keywords, the compiled source code, insight into network calls, and various logs all at your disposal (not tongue in cheek, even with all that you can still be like âdude, why isnât this workingâŚâ)
Next, both ThoughtWorks and Cypress cite âend to endâ tests. The definitions here are also muddy. Here are a few definitions Iâve seen:
- Dave Farleyâs e2e take, which is basically validating âall the thingsâ work together (not to be confused with a push for early All Up Testing)
- Cypressâ Blackbox Testing, where you do NOT stub/mock ajax calls and other I/O, and this just tests âyour site and its integrationsâ
- ThoughtWorks appears to be saying Playwright/Cypress/Selenium are primarily e2e tools where I view them as Acceptance Test tools, with the exclusion of Cypress Component Testing functionality which mirrors Storybook a bit
- Hillel Wayne calls âem that too
Finally, Iâve never enjoyed Reactâs component testing extensions. They are heavily mock / side-effect infested, and heavily encourage you to whip out JQuery skills to validate âMy component is rendering correctlyâ which that doesnât always equate to âworking correctlyâ, feels like breaking abstraction, and testing if React is working. Instead, whether React, Angular, or Elm, Iâve always felt testing your code works, creating primarily pure components, and testing the âSmart Componentsâ (e.g. components with side-effects) you validate in Acceptance Tests (Cypress or Playwright).
JavaScript web devs have varied opinions, and various definitions of words. Thatâs generally fine, but as someone who had ThoughtWorks as a young adult hood hero, constantly recommends Martin Fowler and other ThoughtWorks written works as wonderful recommendations to learn, and event wanted to work with them someday⌠you can see why this completely opposite viewpoint is giving me a crisis of faith.
So:
- agree with component testing in various forms
- disagree with JSDom and âassert my componentâs list item 2 has a bold tag with innertext of âcow'â in your unit test language of choice.
For what itâs worth, the above is nuanced in various languages. Angular and Lit/WebComponents, for example, if you avoid templates having any logic beyond if and switch binding to public component variables, are way easier to unit test and assert side-effects vs. the current frameworks React and others expose. However, Angular and some WebComponent frameworks require verbose setup code that is itself extremely hard to debug, whereas React/Elm the opposite.
Also, I know creating these PDFâs is a herculean effort, and so is trying to summarize anything in tech, so Iâm sure Iâm just missing gallons of context.
Continuous Deployment: Adopt
It was amazing boomeranging and seeing my CEO talk about this in his yearly talk. I know event attempting Minimum CD can be a huge change for people, but itâs the best way Iâve seen in working, so good to see it obviously called out in Adopt.
Golem: Assess
I was super pumped when the Zio creator had a hand in creating this State-Machine-That-Canât-Crash as a Service, called Golem. I was further excited because they had support for Grain, an OCAML style FP soundly typed language. I could just never find the time/inspiration to play as I still feel trapped in the âall things are AWSâ vortex. Yes, Iâve played with & used CloudFlare in production, but⌠as a AWS Step Functions fan, this seemed like a cool idea. One of these weekends Iâll try again with TypeScript since Grain appears to be no longer an option.
Bruno: Adopt
A lot of these REST Clients, some built into VSCode, are getting blocked by various companies because they host your internal API details on their servers or post details to other places. Things like Postman and Insomnia and others have started requiring subscriptions despite claiming they donât which just makes things worse. So there is a huge push to find similiar tools which donât share your data. Bruno is one I need to check out since Iâm no longer allowed to use ThunderClient.
Visual regression testing tools: Adopt
There are various ways CSS can break your entire application, and there is no way to easily unit test or acceptance test your way into preventing that. I really struggled with early React snapshot tools, and felt the ROI wasnât there for smaller sites given the numerous false positives. Tools like Applit and BackstopJS are some of the many, including services, to validate your site looks and works ok. They often run after, or at the same time, as your acceptance tests in your pipeline. Iâve got maybe 5 minutes experience with Applit tools, but definitely want to check out Backstop.
GitButler: Assess
The one Iâm most excited about is GitButler. As someone who hates Pull Requests after experiencing Trunk Based Dev, and being disappointed in the state and abandonment of various tooling aroundâabstractions over PRâsâ, GitButler looks like it could restore my sanity in the context switching to making PRâs of PRâs.
Mise: Assess
Mise is kind of weird because Iâve never had issues with nvm for managing Node.js versions, and pipenv for managing/running Python projects, so curious go give this a spin and see what all the fuss is about.
Mockoon: Assess
I hate mocks. I tend to work in languages which allow side-effects, and with developers who do not follow Pure Core, Imperative Shell. So anything I can do to learn more about my enemy, and how to manage it, is a good use of time, and Mockoon is another one of those mock creators.
Rspack: Assess
Thankfully, Iâve never had to integrate with Webpack. Unfortunately, Iâve been impacted multiple times by _other peoples_ integration with Webpack. Vite was a breathe of fresh air; super fast, and it worked. So itâs interesting to hear of another contender on speed. Vite won not just because of its amazing speed, but wonderful Developer Experience so cool see what happens here with Rspack.
Zed: Assess
Excited to try the Zed IDE despite VSCode having itâs clutches on me, namely because built-in pair programming, super fast speed, and because the Roc lang creator joined their team.
Pkl: Trial
I was first turned onto Pkl during my Dhall Trough of Disillusionment phase (Dhall is cool, but man is it hard) by James Ward. It looked to be a language that had enough types to compile YAML/JSON configuration files wayyyy more safely. Iâve had enough YAML/JSON misconfigurations break production, that I started looking into ways to compile those problems away, and Dhall helped a lot, but the learning curve and compiler errors are brutal to work through, and I never got excitement amongst peers. Hoping Pkl makes in-roads here.
Conclusion
Be sure to download the PDF yourself, as Iâve ignored a TON of new and existing tech on there (LLMâs, infra, data science) that I find boring, but others may find compelling.
Featured ones: