Scott Keck-Warren
0:05
Hello developers and welcome to the PHP Architect Community Corner where we have conversations with members of the web development community. I'm your host Scott Keck Warren. Today we're talking with Philip about his talk at PHP Tech 2025 on frontend testing. Philip Tadeo has been a frontend dev since 2005 and professionally since 2013. He currently works at PhoneBurner where he architects applets and helps modernize the core application. He enjoys writing tests and building testing tools, documenting, and of course finding solutions to crazy frontend problems. Father of 2 beautiful children, Phil lives in Washington State near Olympia and was born and raised in California's Central Valley near Fresno. He enjoys video games and traveling when he can. Thank you, Philip, for finding some time to talk to us today.
Hey, great to be here, Scott.
Scott Keck-Warren
0:51
Yes, absolutely. So you're kind of come on my radio radar because we've talked before in the past. We've met at previous conferences, but you're going to be one of the speakers at PHP Tech 2025. Can you give us a little like introduction to what it is that you're going to be talking about at Tech this year?
Yeah. So basically, I'm going to cover how we do testing at PhoneBurner and the philosophy around just high-level testing versus low-level testing and why we do that. And basically, the idea is that you get to write very minimal tests, but cover a broad spectrum of your application. And so it's really kind of a push to be more efficient and also to really test in the real world and do real-world testing as opposed to this romanticized, like, hey, we're going to test end-to-end and test everything together and whatnot. And so, yeah. And it is going to be from a frontend perspective, but hopefully backend folks could take that home and rethink a little how they're testing.
Scott Keck-Warren
2:05
And so I just want to make sure that we're clear on the nomenclature here. When you say high-end testing or high-level testing, what does that exactly mean? Are you testing individual pages or workflows or?
Yeah. So it's essentially integration tests. And the way our front end works is that we have disparate little applets, if you will, of Vue. Normally, in an ideal world, you would have a single SPA, right? So a single page application. But we are dealing with a legacy client here. And so there's mixes of Bootstrap and HTML, vanilla HTML, along with some Smarty templating and stuff. So we can't just kick everything out and write a SPA. So what we do is we embed these individual applets, kind of like back in the day, like Flash and Java applets and things like that. Anyway, and so when we say high level, we mean the actual applet itself and how it interacts with either the page it's embedded in or the APIs it's calling. And the human using it. So we go end to end.
Scott Keck-Warren
3:28
And so how is it that you do this? Is this something that you automate or is it something that is a manual process?
A little bit of both. So basically we have a custom tool called Mock Server, which is essentially just a wrapper around Mock Service Worker that allows us to build a router, if you will, of these mocked responses. And so once we stub out the responses, from there we can just start up the app in the environment, and it'll start calling like it would normally, except in a controlled environment. And then so from there, we can actually mutate the responses per the scenario and then look for whatever we need to confirm that it's working.
Scott Keck-Warren
4:18
That's really fascinating. So is it automated? So I guess I'm missing that part.
Oh yeah, yeah. Sorry, sorry. Yeah. So it's run through npm and basically every time we run it, it checks everything. But no, in terms of automating, man, that's the next step in the tooling really where we feed it some documentation. Like for example, the API open specs, things like that. And then it just builds it for us. But unfortunately, we're not there. So we still have to manually build out the shape of it. But that being said, there is some level of automation in that if you don't provide a specific thing, like a name or something or a value, it will generate its own value based on its own constraints. So like name, it would have random names in there and things like that. But, but yeah, so it's somewhat automated, somewhat not.
Scott Keck-Warren
5:20
Okay. That's really fascinating because we, we do a lot of, um, I, I like to say it's like, we like test, we just like hope for the best mostly with a lot of our, like our frontend components. Um, because like we, we do like, we struggle with that as like, as a, oh, I struggle at, I guess what I should say is like, I, I can very easily go like mock everything out and have it nice and neat in like backend code. But then there's just like so many pieces that are running like within the frontend that like, I always try struggle with like that concept of like mocking out like the actual service worker. Like that's like a— that would be very helpful for us, right? Like because it was like we just kind of go like, we think this will work. And we just do manual testing when we make changes to those components. But we don't have that like an automated piece that does that or whatnot. So—
Yeah, that's definitely— that's definitely something that we struggled with on our end as well. You know, one of the things that really helped kind of bring all this together is really how you view what the frontend is doing. And basically, the way I see it is the frontend is working with 2 sets of APIs. One, it's working with the server API. And 2, it's working with the human API. And so there's your input and output edges. And so everything in between, as far as we're concerned, is an implementation detail. And so the components you build, how you build them, and things like that, that doesn't really— it shouldn't really matter, right? All that matters is that when I feed this through the API to the app, then I should see this text, or I should see these buttons, or I should be able to click. Or as a human, whenever I punch in this information through the form, I should get a— a request that looks like this. And so when you look at it that way, you're kind of like, well, we don't really have to mock any JavaScript stuff. We don't really have to mock any internal things. It's just, it's literally, hey, is the app doing what we built it to do? And we don't really concern ourselves with how it does it. Because again, in an ideal world, you'd want to. You know, you'd want to mock out services or you'd want to check to make sure all those work. But really, if it's at the end of the day displaying how it's supposed to, then you can infer that it's, that those things are working.
Scott Keck-Warren
7:45
Yeah, that's, that's really fascinating. So, so like when you all, um, so you're big enough, probably you have a separate frontend and separate backend teams. So like when you all are like implementing new functionality, like how does it, how do you usually like split that difference? Do, do the backend developers do a little bit of like, here's the tweaks to do frontend, or do you end up taking all those pieces and running with them? Well,
that's actually the cool part about being able to stub out responses is that we could actually jump ahead. So typically what we do is we have a meeting with the backend team and product and everything, and we figure out what needs to happen. Then from there, we create a contract and we say, the backend developers, okay, what do you need? Or here's what we're going to give you. And here's the shape of the response, and here are the endpoints that we're going to work on. And from there, we just stub them out. We create the shape, and then start making the— we essentially start making the scenarios based on the user stories that product gives us. And then everything in between, sometimes there'll be scenarios where they didn't account for certain things, so we'll cover that as well. And basically just go TDD from there. And so it's like, all right, here's what it would look like once it loads it and everything, and start testing that way. And then basically we could just have the page hidden until the backend devs— or sometimes we come together and— I like to think of it kind of like when you're digging a tunnel, you got 2 different you know, team's boring. And then right as we meet in the middle, boom, everything just fits together. And, uh, yeah, it's really exciting. But yeah, this approach has allowed us to kind of work independently.
Scott Keck-Warren
9:39
Because I've never worked in like a team, like in, in that situation where there's like a frontend team and a backend team, it's always just been like, you know, one team. And so it's interesting. Like that is an interesting concept of having to like meet in the middle. Right. And like, you know, it's like when they like dug from both sides of a river and they have to make sure they like meet up right in the middle. And then not go, oh, it's all broken.
Yeah. The bridge is like far apart. So
Scott Keck-Warren
10:04
they would do recently, like, I live in, I live in Michigan and they were building a bridge between the United States and Canada. And like, they had to, like, that is the situation that they came to is like, they had to be within like millimeters of like the bridges touching in the center of the river. And it was like this big, like, you know, there was like a news story about how like every couple days they would go out and like verify that they were still like gonna hit each other. And I don't know how you do that, but it was really like an interesting thing to, to see that. So. And we'll be right back after this word from our sponsors. So we all know that when your application breaks in production, you want to quickly understand and fix it and not sift through logs for the next hour. And that's where Honey Badger can come in. Honey Badger notifies you of errors, outages, and performance issues as they occur and helps you respond instantly when your systems go down. When you need to dig deeper, Honey Badger's advanced query engine helps you reach into your logs and grab just the information that you need. With error tracking, performance and uptime monitoring, log management, and support for over 10 languages, Honeybadger is the best tool to gain real-time insights into your application's health and performance. Best of all, it's free to get started and setup takes less than 5 minutes. Be sure to bookmark honeybadger.io. That's honeybadger.io. And we're back with Philip. So, so as part of that, that talk, are you going to go through some examples of like how you— because I'm curious about examples. Are you going to go through some examples of how all of this is done?
Yeah, definitely. We're going to go over a high level and philosophy, and then I'm going to show off a little bit of the tools we used and how they stub out. And the part that I'm really excited about is it works really well with collections. So if you have a page that, say, has a collection of books or something, You just essentially stub out 2 endpoints. You stub out the collection endpoint, and then you stub out a model of the actual identity endpoint. And then it just— you could tell it, hey, simulate 100 books, and then— and it just, you know, you could see how your app behaves, you know, with that load and stuff. So it's super cool. I'm really excited to show off. Awesome. what we've done.
Scott Keck-Warren
12:17
Yeah, it sounds really fascinating. I'm really looking forward to like seeing that at some point. So, um, the thing I've been trying to do with like all of the tech speakers is ask them if they have any suggestions for first-time conference-goers so that they can like maximize their, their time at the conference. Could you give us like a suggestion for people?
Yeah. Um, if you're going with a group, stay away from your group, you know, try to network as much as possible. Find out, find people. And I know programmers are mostly introverted. I happen to be extroverted. I don't know how that happened, but I just go around and try to get people out of their shells. But you should definitely try and get yourself out of the shell and explore and talk with a bunch of people and ask them what they're up to and things like that. Yeah, stay away from your group because you already know those folks. So you want to— another thing that I would say is if you can't stay at the hotel where the conference is, because that is where the best networking comes in. You get up and go get some coffee, you see some programmers. Sometimes they're just chilling there writing code and doing their own thing. Trust me, if they mind getting bugged and asked questions, unless they're on the phone or something, then they, they're doing it wrong. So just please just walk up to folks and say, hey, how you doing? I'm so-and-so.
Scott Keck-Warren
13:46
Yeah. I think like the networking perspective of it is like really like one of the huge benefits, especially like, and I think like, I, this is going to be out later. Like, you know, we're like ahead a little bit in the recording schedule, so there might not even be any rooms available, but yes, like getting a room is like one of the most important things. Cause it's just like, get up in the morning, head down and just start talking to people, go to the sessions, you know, and then like, The thing I always love too is like, I'm like, I need a break and you can go back to your room and just be by yourself. If you are like me and need to be and are introverted, you know, there's, you know, it's a benefit to just like being alone in a quiet space for, you know, 5, 10 minutes. So, um, yeah.
Scott Keck-Warren
14:23
Yeah. So is there any, anywhere you'd like to direct our listeners to before we let you go?
Yeah. Uh, I don't have many public social media, uh, stuff, but the one, the one I do have is on X or Twitter, whatever you want to call it. And it's @phil_t. That's Phil with P-H-I-L-L-L underscore T. And you can— if I post, I'll post on a JavaScript group or something like that. And every once in a while, something that I find funny. So yeah, if I should— yeah, reach out to me. And if I should join other areas, I'll gladly join those. I hear Mastodon's pretty popping, but I'm still trying to figure it out.
Scott Keck-Warren
15:02
Mastodon and Bluesky are both pretty good for tech stuff right now. Yeah. So thank you. So thank you. I do appreciate you like finding time to talk to us today.
Of course. Yeah. I'm super excited and I, uh, look forward to seeing everybody in person.
Scott Keck-Warren
15:16
Yeah, me too. I have to say another heartfelt thank you to Phillip for all of his time and for yours for listening today. If you're not already a subscriber, make sure you subscribe with whatever your preferred method is so you can get our episodes as soon as they're released and maybe share this post with a coworker so that they can go to Tech and enjoy the frontend testing that we just talked about. This podcast is available both as an audio version on the PHP Architect website, as well as a video version on our YouTube channel. This is Scott Keck Warren for the PHP Community Corner signing off and reminding you to keep listening, keep coding, and keep reading.