@jamesshore@mastodon.online avatar

jamesshore

@jamesshore@mastodon.online

Agile guy. Consultant, practitioner, author of The Art of Agile Development.

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

jamesshore, to random
@jamesshore@mastodon.online avatar

I’m thrilled to announce that my commercial “Testing Without Mocks” training course is now available for free!

My “Testing Without Mocks” resources—also known as “Nullables”—are consistently among the most popular material on my site. I used to offer an instructor-led course for it. But I’m too busy for that now, so I’ve released that same high-quality course in a self-guided format.

https://www.jamesshore.com/v2/blog/2024/free-self-guided-testing-without-mocks-training

jamesshore, to random
@jamesshore@mastodon.online avatar

New blog: "A Useful Productivity Measure?"

"In my new role as VP of Engineering, there was one question I was dreading more than any other: 'How are you measuring productivity?'

I can’t fault the question. I mean, sure, I’d rather it be phrased about how I’m improving productivity, rather than how I’m measuring it, but fair enough. There are real problems in the org, I do need to fix them, and I need to demonstrate that I’m doing so."

https://www.jamesshore.com/v2/blog/2024/a-useful-productivity-measure

jamesshore, to random
@jamesshore@mastodon.online avatar

What if, instead of saying, “you can’t manage what you don’t measure,” we said, “you can’t manage what you don’t understand?” With the addendum: “*metrics aren’t a substitute for understanding.”

jamesshore, to random
@jamesshore@mastodon.online avatar

I'm happy to announce that my Testing Without Mocks training course has returned! This is an in-person course that's ideal for people in Europe. It's taking place in Budapest, just prior to the Craft Conference, on May 28th and 29th.

I'm not sure when I'll have a chance to deliver the course again, so if you're interested, this is a rare opportunity.

https://www.jamesshore.com/s/nullables-training?mastodon

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman I’ll take a look at your code when I get the chance. There are some common mistakes people make. But it’s also possible it’s just not a good match for you. That’s okay too.

jamesshore,
@jamesshore@mastodon.online avatar

@davenicolette @jasongorman It's a lot of material, but I invite you to read the full article, and maybe check out the examples, before making up your mind:

https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks

I'm happy to dig into specific scenarios whenever you like.

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

First, the overcomplications: You don't need interfaces. Your code doesn't have multiple implementations of the interface, so they're redundant. WeatherData and WeatherDataImpl can be combined into WeatherData. Ditto for FootballData.

Also, Weather/Football doesn't have any meaningful code. They're both answering a question about the underlying Weather file. Why not answer that question directly in WeatherData, rather than a different question?

2/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman I looked at your sample code (the v4 version) and I saw one misunderstanding of Nullables and several overcomplications that are typical of people used to a mock-based approach. I'm not familiar with the kata, so maybe I missed something.

The summary: for your current code, you only need four classes: Driver, Weather, Football, and FileSystem.

1/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

You might think, "well, I might have more complicated business logic in the future." Great. Solve that problem in the future. For now... YAGNI.

And as long as you're combining Weather and WeatherData, why not call it what it is? It's an abstraction over the "weather.dat" file. I would call it "WeatherFile."

3/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

Finally, the misunderstanding. You have a separate "StubbedReader" class, which is used by WeatherDataImpl and FootballDataImpl. In the Nullables patterns, stubs are an implementation detail. They aren't exposed. It should be a private class within WeatherDataImpl and FootballDataImpl...

...except that would mean duplication. Right now, WeatherDataImpl and FootballDataImpl duplicate their file-handling logic.

4/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

FileSystem is the only thing that should have a stub, and that stub should be a private implementation detail. You can use a flag and an if statement if you prefer... embedded stubs are optional, but often make the code cleaner.

WeatherFile (aka WeatherDataImpl) and FootballFile (aka FootballFileImpl) would have a simple createNull() that would just delegate to FileSystem.createNull().

To conclude:

6/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

In the Nullables patterns, WeatherDataImpl and FootballDataImpl are "high level infrastructure wrappers." They should delegate to a "low level infrastructure wrapper" that talks to the external system. In this case, I would have them delegate to something that abstracted the file system. Because I like stupid-obvious names, I would call it "FileSystem." It can expose the only thing you care about, which is String readFileContents(filename).

5/n

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

Or you can stick with the existing design. But there's absolutely no reason to have more classes in the Nullables version than in the mocked-base version, as you claimed in your readme. Nullables support a low ceremony approach: no interfaces, no layers, no nothin'... until you actually need them.

8/7

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @davenicolette @jasongorman

Driver, which instantiates WeatherFile and outputs file.getDayWithMinimumTemperatureSpread().

(A full implementation would have a nullable StdOut and System.exit, which would allow you to test Driver, but we'll let that slide.)

WeatherFile, which instantiates FileSystem, calls fs.readFile("weather.dat"), then does its existing logic.

and FileSystem, which handles Java's file-reading.

(And FootballFile, I guess, whatever it's for.)

and records.

7/7

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries @jasongorman @davenicolette It may be be an overreaction, but I don’t agree the WeatherFile name is a minor detail. It gets to the heart of my design philosophy. (It’s not really part of the Nullables patterns, but may shed light on some of them.) The philosophy is this: call things what they are. WeatherFile could be another data source, some day, but today, it’s not. It’s a file. If it ever changes, it’s trivial to rename it.

jamesshore, to random
@jamesshore@mastodon.online avatar

New blog: "A Software Engineering Career Ladder."

"What I’m really doing is changing the engineering culture at OpenSesame. Culture doesn’t change easily. It tends to snap back. True change involves changing hundreds of little day-to-day decisions. That’s hard, even when people want to make those changes, and full buy-in is hard to come by... This is where the new career ladder comes in."

https://www.jamesshore.com/v2/blog/2024/a-software-engineering-career-ladder

jamesshore,
@jamesshore@mastodon.online avatar

@RonJeffries Thanks, appreciate the feedback. Agreed that this loses some of the juice of the thing. Like being told how an orange tastes rather than eating one. ### Regarding Humility and Psych Safety, they’re implied by a lot of skills (like “Try it their way” and “Yes and”), so those are more about being a leader. Did you look at the skill descriptions document? Your comments valued either way.

jamesshore, to random
@jamesshore@mastodon.online avatar

Hey folks, you might be wondering why I've been so quiet lately. It's because I joined a late-stage startup as VP of Eng. Now for the best part: I'm hiring multiple Staff Engineers / XP coaches to help me transition the company to XP. We're also using FaST (Fluid Scaling Technology). Details follow:

jamesshore, to random
@jamesshore@mastodon.online avatar

If you've got kids and like C64 or old-school basic, my friend Woldie's got a really neat project for sparking kids' interest in coding: Saturday Morning Code-Toons, complete with old-school programming environment and turtle graphics! Very cool stuff. The latest episode is here:

https://www.youtube.com/watch?v=bQEygxIgZFY

jamesshore, to random
@jamesshore@mastodon.online avatar
jamesshore, to programming
@jamesshore@mastodon.online avatar

I have to confess to some hubris. After evaluating the various Node.js testing frameworks, I've decided to write my own instead. In this 🧵, I'll explain why. Mostly so I can remember it for the future.

jamesshore, to random
@jamesshore@mastodon.online avatar

This week on my stream with @jitterted, we discuss estimation, responding to dealine pressure, academic studies, and more. Oh, and our tests find a bug that only could expose!

Episode 19: For the Win. https://www.jamesshore.com/v2/projects/nullables/jitterted-livestream/19-for-the-win

jamesshore, to random
@jamesshore@mastodon.online avatar

There seems to be a generation of programmers who believe interfaces (as in “interface MyInterface”) creates decoupling, so have an interface for every class is a good thing. I can’t agree. Code is decoupled when a change HERE doesn’t require a change THERE. An interface with one implementation does little to help, in most cases, and adds a lot of noise. If you think sprinkling interfaces everywhere magically makes code “decoupled,” you almost certainly have REAL coupling issues you’re ignoring.

jamesshore, to random
@jamesshore@mastodon.online avatar

Nullables are a novel approach to testing that allow you to create fast, reliable tests without using mocks (or interfaces). They're a way of "turning off" production code so you can have sociable, state-based tests that don't talk to the outside world.

I'm hosting office hours on May 10th at 9am Pacific / 12pm Eastern / 18:00 CEST for anybody who'd like to discuss these ideas. Bring your code! Details and a calendar reminder are available here: https://www.jamesshore.com/v2/calendar/2023-05-10

jamesshore, to random
@jamesshore@mastodon.online avatar

Here’s a crazy idea: instead of story points, let’s make them after fruit. Story pears, story kiwis, story grapes. Then, when a manager complains one team has a bigger number than another: “Sorry, you can’t compare apples and oranges.”

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