Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
spawarotti
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
spawarotti
4y ago
> how are you suppose to "unit test" that you properly increment a varibale before inserting into the DB without mocking the DB? You put the logic that increments that variable into a pure function and unit test the input/
32.
▲
by
spawarotti
4y ago
This rule is also recommended by section 9.2.4. "Only mock types that you own" of 2020 book by Vladimir Khorikov: "Unit Testing Principles, Practices, and Patterns". Worth noting is that book also says in 9.2.1: "Mo
33.
▲
by
spawarotti
4y ago
A tool similar to what you want. It generates input/output pairs from the code, aiming to maximize coverage, and allows you to convert them to unit tests with one click. https://docs.microsoft.com/en-us/visualstudi
34.
▲
by
spawarotti
4y ago
I’ve been struggling with the same problem and found a solution that works for me. I was procrastinating up to 8 hours per day, on average. The core idea is to make a contract with oneself to not exceed a daily budget of procrastination and
35.
▲
by
spawarotti
4y ago
I think it is fair to not spend time and resources engaging with such ideas, as long as there is a good "decision record" documentation explaining that this subject was already discussed, decisions were made, and there is no point
36.
▲
by
spawarotti
4y ago
I think they meant that "a continuing rise in the general price level usually attributed to an increase in the volume of money and credit relative to available goods and services." is theft.
37.
▲
by
spawarotti
5y ago
Thought experiment: say to the songwriters accusing Ed Sheeran: we are going to use software to evaluate all the songs you wrote against all other songs in existence. If we find at least one overlap, of any of your songs with any other son
38.
▲
by
spawarotti
5y ago
That's exactly my point. Understanding the dependent context can be considered the "advanced morality" the parent post asked about.
39.
▲
by
spawarotti
5y ago
And how do you know if they are sensitive? Are you going to ask them, or not? If not, why not? If yes, would it still be the golden rule? Or perhaps platinum rule - do unto others as -they- wish, not as -you-. What I am trying to say is tha
40.
▲
by
spawarotti
5y ago
What if I am very secure about given topic (e.g., balding), so I feel very comfortable joking about it, even "at my cost". Should I disregard the fact other people might be insecure about it, because I don't mind people "
41.
▲
by
spawarotti
5y ago
What you are saying might be a manifestation of the "bounded context" pattern/problem: https://martinfowler.com/bliki/BoundedContext.html It is a huge topic. Hard for me to discuss this further without k
42.
▲
by
spawarotti
5y ago
On an "abstract/fuzzy" level I would say that a class with several hundreds lines of code means you are missing some terms in your domain language dictionary. For example, you might be doing a lot of inline operations on stri
43.
▲
by
spawarotti
5y ago
There is a Kurzgesagt video about that: https://www.youtube.com/watch?v=JyECrGp-Sw8 If you detonate all nukes you could destroy every city with population of over 100'000, worldwide. About 4'500 cities in total. Y
44.
▲
by
spawarotti
5y ago
Naturally, I agree that the shouldExecute / ValidateSyntax methods should be tested too, but this is not the whole story. Let me clarify my point with a more precise example. Let's say we want to test this: ParseUrlDomainAndPath(s
45.
▲
by
spawarotti
5y ago
> I don’t care how that function is implemented, only that it returns a boolean Let's take your example of "shouldExecute". I assume your unit test operates on some inputs (with the values provided inside the unit test its
46.
▲
by
spawarotti
5y ago
> The heart of the argument presented is that using mocks in unit tests is problematic (...) If you use real implementations No. As you say, the moment you have a real out-of-process dependency, you no longer have a unit test, but an &qu
47.
▲
by
spawarotti
5y ago
This article espouses what is known as "classicist testing" school of thought and rejects "mockist/London-style testing". I wholeheartedly agree with it. I have been championing it in my team of 20+ devs since many
48.
▲
by
spawarotti
5y ago
The funny part is when the person you committed to is yourself.
49.
▲
by
spawarotti
5y ago
Isn't Stack Overflow one big FAQ? So arguing FAQs shouldn't exist is like arguing SO shouldn't exist? Nice in theory, but in practice...
50.
▲
by
spawarotti
5y ago
The four quadrants of code types as shown in the article also appear as Figure 7.1 in an excellent book on testing: Unit Testing Principles, Practices, and Patterns, by Vladimir Khorikov, January 2020. https://www.manning.com
51.
▲
by
spawarotti
5y ago
I think you touch on an important point: you have some expectation and the person doesn't share it. But here is the rub - maybe they are right, not you? Why do you assume you are right? Maybe that person indeed is not needed on that me
52.
▲
by
spawarotti
5y ago
> You were ten minutes late this morning. I was annoyed at having to wait for you and lose productivity. Could you explain why you were late? Honestly, this sounds even worse to me than just the observation. IMO a good test is "Woul
53.
▲
by
spawarotti
5y ago
I think you jumped to conclusions here by assuming bad intent. Perhaps implicitly the new policy assumes it is obvious you can mention your husband and anybody giving you problems because of that is violating the policy. I do think the poli
54.
▲
by
spawarotti
5y ago
I've heard the "1) Low Cost" is false. [1]. Mainly because it takes time and effort to actually execute someone, to give plenty of time to find evidence exonerating them. That delay and proceedings end up being way more expen
55.
▲
by
spawarotti
6y ago
> What's great for you is not what's great for another. > Too bad we can't understand this in our politics Unless you have a very good reason to not get a vaccine and not wear a mask I will expect from you to do these
56.
▲
by
spawarotti
6y ago
I wonder how this relates to "Calc Intelligence" or "Project LAMBDA", made by Simon Peyton Jones (of Haskell fame) et al. https://www.microsoft.com/en-us/research/blog/lambda-the-ult... &g
57.
▲
by
spawarotti
6y ago
I can relate. Similarly, I ensure I put some time into my side-project on a daily basis, but don't coerce myself into very narrowed down optimal path. Once I gain momentum, I have easier time tackling the not-most-fun "shoulds&quo
58.
▲
by
spawarotti
6y ago
> After the Russian annexation of Crimea during the 2014 Crimean crisis, Ukrainian authorities greatly cut the volume of water flowing into Crimea via the canal, citing a huge outstanding debt on water supplies owed by the peninsula. Whe
59.
▲
by
spawarotti
6y ago
I would not say it is a flaw. I think it is a reasonable implicit assumption that there is only one round, unless explicitly stated otherwise.
60.
▲
by
spawarotti
6y ago
Key observation: you lose when switching the door only if your first pick was winning. Your first pick had 1/3 chance of winning. So switching has 1/3 chance of losing. Thus it has 1 - 1/3 == 2/3 chance of winning.
More ›