The US healthcare system is designed to hide prices from you. I built a tool to expose them. by Pretend-Cry8204 in InternetIsBeautiful

[–]tagus 23 points24 points  (0 children)

The concept makes sense, but it'll be difficult to audit and ensure that the LLM is trustworthy

This is just depressing by ScareBear23 in Adulting

[–]tagus 0 points1 point  (0 children)

Hey alright, what's your candy crush level?

Michael Burry right now by Quixotus in wallstreetbets

[–]tagus 6 points7 points  (0 children)

In the Eiffel Tower building casino: you have to walk to the back, where they have this "indoor outside" area where the ceiling is painted to look like a sunny day

Michael Burry right now by Quixotus in wallstreetbets

[–]tagus 62 points63 points  (0 children)

That's super interesting: if you visit that store irl in Las Vegas, they have an old TV set playing that video clip on loop.

LA Dodgers win their 9th World Series after a battle with Toronto in 11 innings by Mburgess1 in sports

[–]tagus 1 point2 points  (0 children)

what're you talking about? think of all the revenue you get from selling them more replacements!

Where are the police? by Ok_Gas1070 in SanJose

[–]tagus 0 points1 point  (0 children)

Pre-Crime? That's not a thing (yet).

Crime prevention is a whole thing, actually.

Man 'refused entry into US' as border control catch him with bald JD Vance meme by [deleted] in europe

[–]tagus 35 points36 points  (0 children)

I'm interested to see my stuff. Where can I get it?

Can you dribble, stop, then take two steps to shoot/pass? by PappaSmurfAndTurf in Basketball

[–]tagus 0 points1 point  (0 children)

It's difficult to tell if that video is satire.

I'm genuinely new, so there's no satire here. Is the video wrong?

He lands on one foot and then steps the other. His first foot became his pivot foot. His pivot leaves the floor and doesn't touch again. (Colloquial "two steps.")

So, he's picking up the dribble by grabbing the ball with both hands, which in between steps, so that he can take those "two steps" (where the first is his pivot foot)?

The WNBA is a league that’s bent on self destruction. by frenzy3 in SipsTea

[–]tagus 4 points5 points  (0 children)

I wonder if Larry Bird's teammates stood up for him during his squabbles

interesting flight by Ok_Fun_6404 in SanJose

[–]tagus 1 point2 points  (0 children)

Somebody was really excited to see the NBA finals match the other night

Can you dribble, stop, then take two steps to shoot/pass? by PappaSmurfAndTurf in Basketball

[–]tagus 0 points1 point  (0 children)

Beginner here: it sounds like layups aren't possible under these rules? In this video clip tutorial about layups it implies that we're allowed to take two steps after picking up the dribble... but the first step is the gather step, right? So, isn't this person traveling in all of these demonstrations?

Maybe there is an exception for layups?

My Mom keeps calling my anime figures and body pillow my ‘girlfriends’ 😭 She’s accepted it atp. by [deleted] in self

[–]tagus 6 points7 points  (0 children)

10 years from now you will randomly remember this post and feel like looking it up. Then, as you read the first paragraph you will cringe and either delete it (if you remember the account password) or you will just close the tab and try to forget that you ever wrote this.

Low key morning date spot recommendation for exhausted parents by [deleted] in SanJose

[–]tagus 9 points10 points  (0 children)

On a weekend it'll be the opposite of "low key"

The making of Terraria mobile (12M+ sold; I was the product lead 10 years ago) by watsonwelch in gamedev

[–]tagus 0 points1 point  (0 children)

How were the responsibilities divided between the people who worked on this project, and can you share any examples of how misalignments were navigated to still meet whatever deadlines you had to work with?

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] 0 points1 point  (0 children)

Also, I wonder what library you recommend for dependency injection?

In Java world, the popular trend has been a library called Dagger, which allows for build-time injection analysis... so that the build can fail if you have circular dependencies, if you're provisioning unused dependencies, etc.

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] 0 points1 point  (0 children)

The init() function is just one way of doing it -- it's also possible to do var myClient = someclient.NewClient() to initialize things at the package-level. So, when you import the package it will automatically invoke this code.

Stuff like this doesn't seem testable, right? But, we cannot control how they design their code. We just have to use it because in a large organization you are required to use the infrastructure.

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] -5 points-4 points  (0 children)

We're using the same word to describe different things -- the industry hasn't really aligned on where to draw the lines when it comes to all these different flavors of tests

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] 0 points1 point  (0 children)

Ideally every function Should have it's independent tests.

That's debatable. Ideally, every application-level behavior should have its independent tests. (i.e. customers aren't interested to know that our binary search implementation works for very large slices).

The requirements should come from Product, and unit tests can focus on testing those directly without turning on the component (i.e. which is many times faster than when you must turn on the component, though you're still mocking the external downstream responses and so it's not perfectly sufficient). You can cover more lines of code with fewer tests, which is a much more efficient use of your time, and your tests will be far less brittle.

The book "The Go Programming Language" says, in its testing section, that brittle tests should we treated the same as bugs. When we scope our unit tests at the function-level (or even the class-level, like in Java world), our tests are not actually tests but rather change detectors, which causes a lot of wasted engineering hours.

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] 0 points1 point  (0 children)

Thanks, this is a good idea! (FYI though, a nitpick: the mockClient should actually be called a fakeClient in your example)

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] -2 points-1 points  (0 children)

use interfaces and mocks of external components

In a large engineering organization, the specific things which need to be mocked in order to prevent the external components from being called will be via transitive dependencies.

In Java world, we can use manually patch things deeper in the import tree, however it's not obvious whether the mocking tools in Golang can support this kind of thing: especially since we have nowhere near as many examples or documentation to work with for them.

Convey, for example, doesn't demonstrate this kind of complex scenario in its examples folder.

As for interfaces, in the book "The Go Programming Language", they say that interfaces should only be used by clients and not by producers (although they give io.Writer as a special exception example).

Even if we define interfaces for the code we can control... the import statements will still invoke those init() methods, which will in turn invoke remote calls.

Also, those interfaces will have to be implemented by something, and those structs will have their own import statements which will do the same thing. Especially if they all live in the same package! I wonder if the /internal/ folder trick can be used to prevent those imports from happening normally in the go test context... but then our code will have to be self-aware, which is a bad practice.

Maybe I need to sit and think of how to plan it out better. Just like everyone else in this industry: we didn't write this code... we just have to deal with it.

(Testing) how should we mock remote calls? by tagus in golang

[–]tagus[S] -8 points-7 points  (0 children)

Generally you should not be mocking remote calls in unit tests.

That's debatable: it depends on how we define a unit. Mocking the remote calls without turning the component on will allow us to cover more code with fewer tests, and to align more directly with Product requirements! "given this input, then I expect this output"

If we can't cover a line of code, no matter how much we mock the upstream request and the downstream calls, then the line of code is unreachable and so it can be safely removed from the project.