@jitterted@sfba.social
@jitterted@sfba.social avatar

jitterted

@jitterted@sfba.social

He/Him. Technical coach. All about Making #Java Code More Testable. #TDD #Refactoring #HexagonalArchitecture #JUnit #AssertJ

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jitterted, to random
@jitterted@sfba.social avatar

These days I'm trying to differentiate between tests where dependencies (used by the Code Under Test) can't (and shouldn't) be replaced by Test Doubles—inside the Domain layer¹—and those that are replaceable (Use Case/Application layer), where the concrete version of the dependency accesses hardware or I/O.

¹ These are almost always part of an Aggregate (graph of objects).

jitterted, to random
@jitterted@sfba.social avatar

Friends don't let friends create forms with separate boxes for First and Last names.

jitterted, to random
@jitterted@sfba.social avatar

Testability and fast feedback loops drive everything I do in creating software. (One could say just fast feedback loops, and testability follows, but without testability, long-term viability of continued fast feedback loops can easily be lost.)

jitterted, to random
@jitterted@sfba.social avatar

One of the best things about live coding (and doing it enough to have a few people in the "audience") is that it raises my level of awareness of what I'm doing by being asked questions:

"Why aren't you refactoring after getting to TDD-Green?" or "Why didn't you extract that string into a variable?" or "Do you use Test Data Builders?"

If I was trying to "get work done", these questions would be annoying¹, but instead (especially as a technical coach/educator) they are More Valuable than GOLD!

One of the hardest things to do as an "expert" who is also a coach is to take what has become automatic and turn it into steps that can be taught to a non-expert.


¹ of course if I wanted to just get work done, live coding is not the most efficient way to go (tho it works really well for me despite the welcome interruptions.)

jitterted, to random
@jitterted@sfba.social avatar

I need to hire (i.e., pay) someone who can clean up some Adobe Illustrator files, or possibly recreate them (which ever is better), so that I can more easily work with them to change their text, size, etc., as I need to. Right now they look OK, but are very difficult to modify.

An example is below. I had to extend the edges (bleed) for printing, but this is terrible if I need a digital version that looks correct.

Recommendations of folks who can do this (perhaps it's you?) and boosts appreciated. (And in case it wasn't obvious, this is for-pay work!)

jitterted, to random
@jitterted@sfba.social avatar

I've been reflecting on LLM tools in IDES, like Sourcegraph's Cody and JetBrains's AI Assistant, and I think that they (and other LLMs targeted for code generation) suffer from the same problem:

The inability to FORGET.

Unless you have complete control over the data used to train the LLMs, you're going to get old solutions for problems that may not exist anymore, because languages, libraries, and frameworks eventually deprecate and remove code, come up with better (or worse, but different) ways to do things, etc.

It's a bit frustrating to get a solution that works, but is the "old" way of doing things (indexed for loop instead of a for-each, or instead of a stream). It's even worse when the solution worked 3 years ago, but no longer does, or worse is a mixture of modern and obsolete code, making it difficult to separate the two (LLMs are entirely based on "mixing", so this happens frequently).

I'm pretty sure the solution for these kinds of tools is to be trained on better (or at least more recent) data.

jitterted, to random
@jitterted@sfba.social avatar

@claresudbery talking with @jbaruch about Continuous Integration at https://www.youtube.com/live/l7vpkCBad2U

jitterted, to Java
@jitterted@sfba.social avatar

🚨 #LiveCoding Alert 🚨

Working solo on some final Ensemble Timer features using #Java #SpringBoot and a bit of #htmx.

Join me now on Twitch at https://jitterted.stream

jitterted, to random
@jitterted@sfba.social avatar

The whole reason that Premature Optimization is evil is that it can make the code (much) more complicated, when you might still be modifying it heavily (hence the "premature").

Get it to work.
And ensure it's what's needed.
Then look at optimizing.

(This is a general guideline: your context, of course, might require you to do optimization up-front, but then it's not premature!)

jitterted, to random
@jitterted@sfba.social avatar

Using in my apps has let me turn the "no logic in HTML templates" all the way up to 11.

I am now very aware (and suspicious) of any logic being evaluated, or even things like string concatenation, being done in HTML templates.

I may have to write a tool to warn me (or fail a test!) if I start using th:if, th:unless, or anything that looks like a method call in my Thymeleaf templates.

jitterted, to random
@jitterted@sfba.social avatar

On today's solo stream, I was doing my as usual, and, because I use Predictive Test-Driven Development (see https://ted.dev/articles/2021/03/05/clarifying-the-goal-of-behavior-change/), I was able to avoid writing code that wouldn't get the test to pass.

Why? Because 3 separate times, I predicted how the test should fail, and it failed differently! They failed in the unexpected way because I had either written the test setup incorrectly, or misunderstood a library method¹.

Had I just looked out for a failing test, I would have started writing code to make it pass, and been disappointed that it didn't pass when I was done.

--
¹ Turns out Java's String.indent(4) normalizes line endings, meaning it will add a line ending to the last line, even if it didn't have one before! Surprise!

jitterted, to random
@jitterted@sfba.social avatar

Well that was a bunch of wasted time because the Mac PDF Preview app is BROKEN when it comes to password-protected PDFs that limit things (for form-filling).

I filled out the form in Preview, but once I saved it, nobody could VIEW it without the original security password (that nobody seems to know).

Apparently this is a known issue, but Apple has yet to fix this 2+ year-old problem.

Had to open it in Adobe Acrobat, fill out most of it there, then "print" to a new PDF, and then finish the edits with that new PDF.

jitterted, to random
@jitterted@sfba.social avatar

One (of MANY) lesson learned is to NOT name your Thymeleaf template "index.html". You will get confused. You will be surprised.

Spring Boot will serve it up as a static page to your "/" path GET request, even if the "index.html" is in the src/main/resources/templates directory.

(See WelcomePageHandlerMapping and WelcomePage for details.)

jitterted, to random
@jitterted@sfba.social avatar

Hey Game fans!

If you were thinking of ordering your own copy of JitterTed's TDD Game, I recommend ordering soon, as I'm running low on inventory (and won't get more for another month or so).

Get your copy (or multiple copies—saves on shipping) today at https://tdd.cards

jitterted, to random
@jitterted@sfba.social avatar

This is how you should be asking for name information!

(From the We Review conference submission system:)

jitterted, to random
@jitterted@sfba.social avatar

I continue to find ChatGPT and the like to not be very helpful for writing more than a little bit of code, and even there, it's mostly helpful in areas where it's with APIs that I'm familiar with, but don't use enough to be fluent in. I also find it useful in suggesting alternatives for solutions I already have, but even there it's still pretty limited (e.g., my attempts to get it to write better ArchUnit tests that don't include my test code that didn't include the "obvious" solution).

I find it much more useful in clarifying my understanding (and therefore my explanations) of concepts. For example, I've been thinking a lot about Mental Models vs. Heuristics and where the line is. For example, are "DRY" and "SOLID" mental models or heuristics? How about "OOP"? Or, more specifically: do I model my countdown timer with pause support as a "bag of seconds that get consumed" or as "end time gets postponed by amount of pause time".

jitterted, to running
@jitterted@sfba.social avatar

Finished my Half-Marathon race today in a better-than-expected time of about 2h25m. Was able to keep a pretty consistent pace, until the last mile where I ran the fastest mile of the whole event!

(Mile 12 was slow because I had to stop and fix the cushioning in my shoe.)

jitterted, to random
@jitterted@sfba.social avatar

Took me almost 2 hours to finally wrangle some HTML into what I wanted. It's frustrating only because I don't do CSS from scratch very often and there's so many tiny little things one has to know separately and how they work together.

Luckily the browser tools have gotten good enough to provide quick feedback along with help for grid and flex layouts. Juggling align-content and justify-content and so on is so much easier with immediate feedback.

jitterted, to Java
@jitterted@sfba.social avatar

Today (on my live coding stream) I found that the best way to get ChatGPT 4 to give you a good answer is to give it an already working answer, ask it to simplify it, and then correct its wrong answer with information provided by a viewer.

Otherwise it was over an hour of trying (and failing) to get it to create a working ArchUnit test that would compile, let alone test the right thing.

https://www.twitch.tv/videos/2102181288

jitterted, to Java
@jitterted@sfba.social avatar

Using JetBrains tools on Mac, but upgraded to macOS 14.4? The OS update introduced a bug (see https://blogs.oracle.com/java/post/java-on-macos-14-4) affecting applications like IntelliJ IDEA, WebStorm, etc.

JetBrains has some potential workarounds while Apple and the Java community figure things out:

"If this is affecting you from running our IDEs, please consider using the workaround (https://jb.gg/workaround) we have provided. Should you encounter any other issues, please report them to us (https://jb.gg/JBR-6802)"

jitterted, to Java
@jitterted@sfba.social avatar

"Writing the , , WebSocket, etc. Tutorial"

Starts at 1pm PST | 9pm UTC

helps me focus, so this'll be a "boring" stream where you get to watch me struggle writing this darned tutorial.

Twitch: https://jitterted.stream/ and YouTube: https://youtube.com/live/NRaLOImk-aw

jitterted, to Java
@jitterted@sfba.social avatar

On today's Solo stream, I'll be working on the and WebSocket portion of my Ensemble Rotation Timer.

Join me in about 25 minutes (11:30am PST | 7:30pm UTC) on Twitch: https://jitterted.stream

jitterted, to random
@jitterted@sfba.social avatar

I don't understand why folks using an LLM assistant simply accept what it proposes as a comment for a method or a class.

If it's that easy for the LLM to figure it out, then let the reader of the code ask the LLM to explain it on-demand. That way it's never out of date.

jitterted, to random
@jitterted@sfba.social avatar

Accidentally pushed a failing test (because I'm in the middle of changing the behavior), but it didn't go live because I have an action set to run all the tests before going to production.

How did the code get pushed with a failing test? I thought the failing test was in a file that I hadn't yet committed, instead of a file that hadn't been updated for the new behavior.

Oopsie. Lesson learned (again): I was a bit careless in starting on a new feature without making sure I was always in a shippable state. Took 2 minutes to repair and now production is updated and still working.

But also, this is why we have tests running upon push, too!

jitterted, to random
@jitterted@sfba.social avatar

Upgrading my main machine, an iMac (2020), to Sonoma. Wish me luck...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines