• 0 Posts
  • 33 Comments
Joined 2 years ago
cake
Cake day: October 23rd, 2023

help-circle






  • I know how to use parametrised tests, but thanks.

    Tests are still much more repetitive than application code. If you’re testing a wrapper around some API, each test may need you to mock a different underlying API call. (Mocking all of them at once would hide things). Each mock is different, so you can’t just extract it somewhere; but it is still repetitive.

    If you need three tests each of which require a (real or mock) user, a certain directory structure to be present somewhere, input data to be got from somewhere, that’s three things that, even if you streamline them, need to be done in each test. I have been involved in a project where we originally followed the principle of, “if you need a user object in more than one test, put it in setUp or in a shared fixture” and the result is rapid unwieldy shared setup between tests - and if ever you should want to change one of those tests, you’d better hope you only need to add to it, not to change what’s already there, otherwise you break all the other tests.

    For this reason, zealous application of DRY is not a good idea with tests, and so they are a bit repetitive. That is an acceptable trade-off, but also a place where an LLM can save you some time.

    If you’re writing complex mocks frequently, there’s probably room for a refactor.

    Ah, the end of all coding discussions, “if this is a problem for you, your code sucks.” I mean, you’re not wrong, because all code sucks.

    LLMs are like the junior dev. You have to review their output because they might have screwed up in some stupid way, but that doesn’t mean they’re not worth having.




  • Ignore for a second the law in question. Suppose Temu started importing harmful goods into your country in the knowledge that they were going to poison kids. (This doesn’t seem too much of a stretch…) Should it be OK for Temu to just say, “OK, we’ll just stop importing to the UK then”? Shouldn’t they face the consequences for breaking the law?

    I think this take is motivated by disagreement with the law in question (although it’s not actually clear exactly what they’re alleged to have done - the ICO released a statement saying it relates to an investigation from March, so before the age verification requirement).


  • Then write comments in the tests that say they haven’t been checked.

    That is indeed the absolute worst case though, and most of the tests that are so produced will be giving value because checking a test is easier than checking the code (this is kind of the point of tests) and so most will be correct.

    The risk of regressions covered by the good tests is higher than someone writing code to the rare bad test that you’ve marked as suspicious because you (for whatever reason) are not confident in your ability to check it.






  • When I got a kindle (10 years ago) I did it on the basis that it was possible to strip the DRM of the books and load them on another device. I’m not going to be tied to some shitty platform for ever more. I must say though that when I have bought books on other places, the process of stripping the DRM and getting the book onto the device has been an absolute ballache - presumably the same for any device when you’re not using the native store.

    I won’t be going back to physical books though. I bought a hardback for the first time in ages and my wrists don’t like it. Nor does my partner when I’m reading while they’re trying to sleep.


  • Yeah I am also not particularly interested by healthcare which only benefits a tiny fraction of society.

    However, when glasses were first invented they were only accessible to very few people. Technology tends to get more accessible over time as it is developed from a niche product to something for the mass market. So we can be cautious about the impact of these smart glasses, but still recognise that, for something that costs significantly less than a hearing aid and has hearing-aid like features, making life easier for people with hearing and vision impairments is in fact a key area where tech can help, is helping, and is recognised as such even in the world of big tech.