text
stringlengths
0
2.35k
**Mat Ryer:** Well, if they've got that many bugs, how did they get to the Moon?
**Bill Kennedy:** There we go, man... It was a lot of testing.
**Mat Ryer:** Confidence.
**Bill Kennedy:** But here's the question.. I get asked this, so I'm curious, everybody here... At some point, you have to be done. You have to be done writing tests at some point. So one, what is your definition of "We're done writing tests", and if that answer has to do with some sort of level of code coverage, then ...
**Chris James:** \[53:42\] It's not easy to come up with a straightforward answer to this, and I think I'd like to stress also, again, that whilst TDD does give you a test suite, and does kind of naturally give you coverage, TDD is not primarily about verification. It's a method for driving out software, right? So just...
So TDD and testing, they're clearly related, but they're not quite the same thing. And I think really, it just comes down to confidence. In terms of software, we want to be able to ship it as quickly and as reliably as possible. So if a bug comes up, I want to be able to like fix a bug and ship it as quickly as possibl...
So if your test suite is in that state, I would say you're done. But as I said, writing software isn't quite like that. Normally, it has to grow and evolve over time as you learn from your users. You need to -- "Oh, the users told us they need to do this. Okay, well, now we need to go back and change things."
**Bill Kennedy:** That's fair. But if you're managing a team of people, and you say to that person -- at some point you say, "Do we have enough test coverage? Because if we don't, I don't want you moving on to the next thing." So it's like anything in engineering - how do we know we're done with this so we can move on ...
**Mat Ryer:** In my experience, I'm not interested in code coverage that much, because essentially, the only promises I'm making are what the tests say. And so the tests -- you know, if there's hidden logic, if there's like hidden stuff that happens that's not in the tests, then it's unofficial, essentially; it's not p...
**Bill Kennedy:** Okay, but you still didn't answer my question, Mat. How do you know that the tests are giving you that? How do you know you're done? How do you know the tests are giving you that ability to sleep tonight? We all agree, and I've learned this too hard over the last ten years working with people from Goo...
**Mat Ryer:** Well, just if I've satisfied the user, really. That's the thing. And also, I understand when people say "We're never done" in software. So I understand that basically it's fine, this is good enough for now; but it's not done. Like, we'll definitely evolve it and change it.
**Bill Kennedy:** Okay, at some point you're done. It may not be complete.
**Mat Ryer:** Okay, fine.
**Bill Kennedy:** How many times have you seen a module out there where the author said, "I'm not working on this anymore"? I consider those done. The PQ driver for Postgres - I still use it. Everybody's like "Why are you using it?" Because it's done, and it's stable, and why should I go to PGX, where they're still doi...
**Mat Ryer:** Yeah. Well, I think -- I look at code coverage, because I'm interested if there's any blocks that I've missed. And I don't test every error -- like, if error return; I don't test those. I sort of trust myself that I get those right. And sometimes that bites me, because there'll be some strange little thin...
**Chris James:** \[58:07\] It's done when it's done, right?
**Bill Kennedy:** Yeah, Chris \[unintelligible 00:58:11.05\]
**Chris James:** I mean, I can only describe what my team does. And I tried to bring up another TLE but, BDD, behavior-driven development, right? That's another thing that people throw around.
**Mat Ryer:** It's another DD...
**Chris James:** Yeah. To me, without going on too much about it, it's about understanding your problem with your stakeholders, like the customers, or like your business people, or whoever. So when my team pick up a ticket, what we try to do is understand these requirements, and we try to express them in these kinds of...
And then of course, something goes wrong... Okay, we recover from it. And I think a far more interesting question to me in terms of software developer - it's not so much like "How many bugs can you prevent?" but "How quickly can you recover from them?" Mean time to recovery for me is a way more interesting question. An...
**Natalie Pistunovich:** I see that there's a little bit of an MVP, in the sense that you do the basic thing you need in order to run with that, and then you can always add to that. And what is included in that MVP is what sort of, you can say what is in the API, in the sense of what you communicate, what you commit to...
**Mat Ryer:** Yeah, I really like that idea, actually, of anticipating how it might be misused, and catching that. Sometimes that really is helpful. And that's really the only time I will write panics, is if it's going to panic anyway, but I want to add a bit more context, or I want to just explain what's happened in a...
**Bill Kennedy:** This is actually one of the best answers I've gotten for done, to knock it against that list. Just the last two days I've had to go through JIRA tickets for a client, because they were like "Is all the stuff in there?" I'm like "I don't know", and I had to rip all the JIRA tickets out in a spreadsheet...
**Mat Ryer:** I'm sorry...
**Bill Kennedy:** And now my brain is just like that; I can't use JIRA directly, I have to move it. I have to see 30,000 feet of feature functionality, and I need to see it at a high level. But for me, I love that idea that it's done when I check those boxes off, because that feature functionality is at least in there....
\[01:01:58.15\] Now, Chris said something that triggered something else in my head, and it's this idea of deploy-first sort of development, where from day one you get enough of a little thing working where you start deploying it... Because if you're not deploying it day one, you're not able to deal with bugs that are g...
**Mat Ryer:** I love that. I think anything you can do from the beginning, any constraints you can put in like that, really... I.e. this deploys automatically. The tests have to always be passing before you can get them into main" - those kinds of rules, I find them to be just great. It's easy to do, because you spread...
And in my case, with the test suite I talked about, by the way - I can actually point those tests to production, and run the same test suite in production. And that's a great, nice little check. Post deploy, it runs the same tests again. And because it's hitting real API's, it's the same thing; or very, very similar. S...
**Natalie Pistunovich:** That's also kind of the essence of CI/CD.
**Mat Ryer:** Right. Yeah, continuous.
**Chris James:** Yeah, I'd like to say, definitely making it so that those acceptance tests can be ran in production is such an enabler for that kind of agility... Because - you know, just because those tests run locally, or even in like the staging environment, the whole kind of dev/prod parity thing is, at best, like...
**Mat Ryer:** Yeah, I agree. One of the nice things is - and this happened - I had an error, a bug in production, I wrote a test to prove it, I ran the test suite against production, and proved the bug. And then I was able to fix it locally, and I ran it locally too, and saw the same behavior. So that's -- first of all...
**Bill Kennedy:** I'm curious about -- I've never thought about running tests in production. So I think it's a brilliant idea, but my brain gets stuck on two things. If the tests are doing some form of database manipulation, how do you not put that bad data in? And if it's making API calls, how do you make sure that's ...
**Mat Ryer:** \[01:06:01.21\] Well, it does change the state, because my later bits of the test will be asking for that state to verify that it's correct. I'll have either a -- usually, it's multi-tenant. That's another thing, I tend to build everything kind of multi-tenant as well, from the beginning... So just a tena...
**Chris James:** I think you should avoid that as much as possible, and you should try and test as a user would...
**Mat Ryer:** As a real user.
**Chris James:** Because if you start putting those kind of backdoors in, you run the risk of making these tests green, but actually, it doesn't work for real users. I think for me it's a really interesting topic in itself, is just as having your architecture enable you to do this kind of test automation in production....
**Mat Ryer:** Other observability platforms are available.
**Chris James:** Sorry... \[laughs\]
**Natalie Pistunovich:** And then came time for all the loading tests and so on, and the chaos and start breaking things. So I have a question for you all...
**Jingle:** \[01:07:42.25\]
**Natalie Pistunovich:** My question is, how do you like Mat' song? \[laughter\] No, what is your unpopular opinion?
**Mat Ryer:** Well, this whole episode's been Bill's...
**Natalie Pistunovich:** \[laughs\] I think Bill is slowly convincing you all...
**Mat Ryer:** Is it popular, Bill?
**Bill Kennedy:** My opinion?
**Mat Ryer:** Yeah.
**Bill Kennedy:** You know, I might lose half of my Twitter followers after this one.
**Mat Ryer:** Well, you might anyway, mate. But...