From Specs to Monitoring: A CTO's Guide to QA Best Practices
In this episode of "How Many CTOs Does It Take?" podcast, hosts Scott Porad and Brad Hefta-Gaub tackle the evolving landscape of quality assurance in web apps.
They challenge the notion of QA as just "manual testers at the end," instead framing quality as a chain of practices across the entire SDLC: requirements, technical design, code reviews, unit tests, automation, monitoring, and stakeholder demos.
Topics include:
-
Why QA begins upstream with clear requirements and design, not just testing at the end
-
The role of test automation and real user monitoring (RUM) in catching defects before users do
-
Code review culture as a cornerstone of quality (and why reviewers should run the code)
-
Balancing QA investment for startups vs. enterprise-grade systems
-
A proposed ROI heuristic for test automation (risk, cost of failure, complexity, churn, compliance)
-
The role of AI in QA: pair code reviews, vibe coding risks, and the future of end-to-end automation
-
How context-rich prompts (and even teaching AI like you'd teach a junior dev) improve code quality
-
Why quality assurance is ultimately a cultural mindset, not just a checklist
The episode closes with an anecdote on peanut butter & jelly sandwiches, illustrating how precise instructions (and context) are at the heart of both QA and AI development.
- 00:00 Introduction to User Interaction Testing in AI
- 00:29 Welcome to the Podcast
- 00:42 Discussing QA Standards in Web Apps
- 01:22 Philosophical Approach to Quality Assurance
- 03:19 Importance of Test Automation and Monitoring
- 06:15 Real User Monitoring and Production Safety Nets
- 08:32 Challenges with Requirements and Product Debt
- 10:10 Sprint Demos and Stakeholder Reviews
- 15:33 Code Reviews and Implementation Plans
- 16:59 AI in Code Reviews and Pair Programming
- 18:39 Balancing Investment in QA for Startups
- 20:56 Evaluating Risk and Investment in Test Automation
- 22:47 The Importance of Code Reviews and Unit Tests
- 26:23 Challenges and Strategies in AI-Driven Development
- 32:48 The Role of Context in AI and QA
- 36:20 Concluding Thoughts and Anecdotes
Resources:
- How Many CTOs Pod: https://howmanyctospod.com
- Scott Porad: https://www.linkedin.com/in/scottporad/
- Brad Hefta-Gaub: https://www.linkedin.com/in/bradheftagaub/
#TechPodcast #EngineeringPodcast #DevTalks #PodcastForDevs #HowManyCtos #Podcast #Ctos #CtoPodcast #Technology #Engineering #SoftwareDevelopment #TechLeadership #EngineeringLeadership #SoftwareQuality #QA #QualityAssurance #TestAutomation #CodeReviews #EngineeringCulture #AIinTesting
Scott: The part of test automation that's always been the most challenging is that user interaction testing,
right?
Those are always the ones that are the most brittle,
the hardest to get to work well, but in an AI world,
they actually might be the most important.
Brad: All right. Welcome, everybody,
to another episode of the How Many CTOs Does It Take podcast.
I'm Brad Hefta-Gaub, and this is my co-host.
Scott: Scott Porad.
Brad: And Scott,
today,
what are we going to talk about today?
I want to talk about.
QA and how what what are the gold standard what is the gold standard for QA quality assurance as part of web apps and honestly I kind of want to pick your brain a little bit about this Scott because I have realized as I've looked over the last decade or so of my career I've never really felt like I've gotten it right
But how about that for a big topic?
Scott: I don't know that I have gotten it right either,
and I actually,
but I do know that I feel like I have some contrarian views about it, which
Brad: Okay.
Scott: should be interesting.
But let me start with a philosophical question,
not
Brad: Yeah,
okay.
Scott: a question,
philosophical comment.
I think when a lot of people talk about QA or quality assurance,
they're talking about a person who tests something,
clicks
Brad: Okay.
Scott: through an app or does something like that, right?
And I've always sort of preached QA begins way,
way, way upstream.
Did we have the right requirements?
Did we have the right scope?
Did we build the right technical design?
Did we do a good code review?
Did we write test automation to prevent defects?
Did we write monitoring to detect defects?
Brad: Yeah.
Scott: That's all quality assurance,
right?
You can actually even go further than that and say,
did we do small?
commits and small pull requests so that it was easy to review.
There's a lot of different things all along the whole SDLC that leads to quality. That person at the end who clicks through it,
if they are your safety net.
Brad: They're your only safety net.
Scott: If they're your only safety net,
then, you know, you're probably effed.
Brad: Hey, first of all, I love that framing that I don't I you're not going to get an argument with me on that.
But to be fair, I really wanted to talk a little bit about the how do we verify that the code that we've written is behaving the way we wanted it to behave.
Scott: Yeah
Brad: And so of the of the chain of stuff that you described.
I think I'm asking about the middle third of that.
Scott: Yeah.
Well,
where I've had the most success in my career,
we leaned very heavily on two things.
A lot of test automation,
unit tests, all different types of test automation.
We did not have manual.
CUA testers doing stuff.
Brad: Interesting.
Scott: We felt like engineers should be responsible for what they're shipping.
We had a very...
Well,
I should tell you about a bunch of the practices we have,
okay,
because they're actually all part, they're all part of the package.
But I guess I said there were two things.
We had a lot of test automation,
we had a lot of monitoring, but there was a specific type of monitoring.
Often people monitor for when things go wrong.
You can also monitor for when things go right and log when things go right and then set up monitors and say,
the thing that's supposed to be going right isn't going right anymore,
right?
And I think that's a...
different mindset about monitoring that can result in like better detection of problems.
So I'll dig into that for a second.
When we were doing that,
we were doing a lot of logging and monitoring around user behaviors.
So I'll give you a concrete example.
We knew that, you know, customers came to our website and our mobile app and they ultimately entered a credit card and to book something.
And so we started logging how often credit cards got added.
And then we put that into Datadog and we just I can't remember exactly how we did it, but I actually can't remember. I'll come back to that in a minute. We put it in the Datadog and then we put a monitor on that and an anomaly monitor so that.
We have enough volume that it was pretty consistent throughout the day. You should be having a relatively steady stream of people adding credit cards to their accounts.
I mean, it's going to be lower on Christmas Day than it's going to be on, you know, Black Friday or whatever,
but it is.
you're going to be able to monitor that and put an anomaly detection on it so if you ship a bug where all of a sudden we broke credit cards you're not seeing the user behavior like something that's tracking our user behavior has changed and i actually remember how we implemented that
I don't remember the details,
but it was roughly something like we had everything that inherited from some sort of base object and on the save method of that object, we just put logging in. So we were actually logging the save of every object. And if you think the save of every object is effectively a user behavior,
somebody did something that needed to be recorded,
right?
They added an item to their cart,
they added a credit card,
whatever it was.
And so that became a very powerful tool for us to help.
detect problems that were happening but let's go a little bit further upstream
Brad: Hold
Scott: oh
Brad: on a second,
Scott: yeah
Brad: Scott.
So I think what you're talking about there,
I think this sounds like a really great point. And I feel like, you know, again,
like we kind of talked a little bit about this and in past episodes that we've had guests that are sort of like made this point.
So what I'm hearing you talk about right now is kind of the idea that production safety nets.
And
Scott: Yeah.
Brad: something like the idea that like your users aren't your testers, but production is ground truth.
Whatever is happening in production at scale is ground truth about the effectiveness of your product.
Scott: Yeah.
Brad: And so this term of RUM or real user monitoring and tracing the idea of like using your telemetry, whether it's open telemetry or Datadog or whatever you said,
and it's capturing everything that's happening and you can you should be able to say in a steady state.
you know 100 you know like 100 of transactions end with the person the shopping cart ended you know or whatever and so then if that all of a sudden changes you know something has gone wrong
Scott: Yes, I learned something.
You know the book Anna Karenina?
Brad: yeah
I mean, I don't have it memorized,
but.
Scott: Do you know the first line of that book?
It's a famous first line.
It said all happy families are alike.
Every unhappy family is unhappy in its own way.
Brad: Yeah.
Scott: And so apply that to technology.
It's often easier to.
verify that something's happening correctly than it is to because things go wrong in all sorts of unexpected ways that's why it's going wrong right so but it's you can under you can understand the pattern of a correct thing more easily and so it's often better to try and look at the things that are going well and eliminate them and then you got all the rest over all the leftovers and say if there are problems here or not
Brad: So I like that idea a lot and I think that there's value in that and I agree that that's part of the, you know, kind of like the best practices quality guide,
Scott: Mm-hmm.
Brad: right?
But I guess one of the things that I.
And, you know, maybe this will go back to an episode we've talked about in the past about this notion of tech debt versus product debt.
But one of the things that I wonder about with quality is you started with are our requirements really well documented?
And are the and so if you have high quality requirements and you have high quality descriptions of what you want the behavior to be,
then downstream you can check against that, you know, like acceptance criteria.
et cetera but
Scott: Yeah, that's
Brad: what if you don't have high quality requirements or you've lost your requirements into the ages of of product debt or something like that you know like
Scott: a good question.
Brad: early on early on in a lot of ventures you kind of don't know what's going to work right you're kind of doing experimental stuff you're throwing stuff against the wall you're trying to see if it works like i don't like
What if I don't really know what the expected behavior is or I'm moving?
I'm not good at describing the expected behavior.
So one of the earliest things,
one of the earliest bugs that gets reported is, oh,
the product team says,
oh,
that didn't act the way I thought it was going to act.
And you're like,
well,
but,
you know,
the spec was silent on this issue. You're describing a thing that was not covered in your acceptance criteria.
Scott: Well, yeah,
I mean, I learned a phrase a long time ago,
which I haven't used in a long time, but it comes to mind as a spec bug.
That was a bug in the spec.
Brad: Yeah,
I used to always say.
I used to always say the spec is silent on that issue.
Scott: Yeah.
Brad: The spec didn't say anything about that.
If you don't say it in the spec,
you've left it up to the whims of the developer.
Scott: Well,
that, okay,
so to answer your question,
and that's a tough one, but I think there's a couple quality steps that I didn't talk about earlier that I think are useful in this case.
One of them definitely is the sprint demo or at least just a demo before you release it, like just showing it to the whoever requested it. Like this is what we built. Is this what you wanted?
I mean, that's what Scrum and Agile always said, right?
You know, lots of people, I think we've talked about this here, how you can set up different.
you know, temporal environment,
formal environments for different builds,
like even they give the request,
hey,
wait, I've made your change,
I put it in this environment for you, go take a go experiment with it.
I worked at companies where product management owned QA,
the
Brad: By
Scott: point of view was,
hey,
Brad: the way, I support that idea a lot.
Scott: yeah.
Brad: That's a really interesting configuration.
Scott: create create a full loop right we're going to tell you what we want you're going to do it we're going to verify that it was done the way we wanted it done right and they they own the that qa process um so i think those three things right
sewing the doing it actually doing a demo before or incremental demos along the way but doing a demo before you release it can surface a lot of those things where there's silence i think is really effective for surfacing silence it's also good at surfacing silence not just when it doesn't work right but when the engineer is trying to build the thing to show it's like well you guys didn't say what you wanted me to do here so i need to be clear about that
Yeah,
and having minimal having the stakeholder review it themselves,
potentially having QA be part of that stakeholder team, I think are all key things to do.
Brad: Yeah, I had a we just literally just had a example of that sort of thing happen on Sprint's on one of the projects in the project I spend almost all my time on and the product team basically described a.
drag and drop feature for some component but these components have some interesting behavior where they kind of toggle between different states and
it's like they didn't really say what to do if you dragged something and then toggled it right and the developers at the time were like wait i feel like there's some i feel like we're not describing the whole thing here and you know and
Scott: Mm-hmm.
Brad: i encouraged them and kind of got the product team agreement to say yeah go ahead and code what we've said here and let us play with it and if it's and we'll we'll know whether we've missed something when once we can play with it right
And it became super obvious in this little sprint demo like,
oh yeah.
You're right.
We missed a big, we have a big gap in what this is and you coded it, you coded what we asked for.
And yeah,
let's not ship that. It's not, it doesn't, it doesn't work out. It doesn't work well enough for us to ship.
Scott: Well, I think what you did there, and I've seen this done well a lot of times, but it has to be the team has to have the right mindset,
is sometimes the requester
Brad: Yeah, exactly.
Scott: doesn't quite know what they want,
right?
So the engineer gets,
you know, they get an outline.
and give it to the engineer and the engineer the mindset is okay i'm just going to build you something and let's see what your reaction is to it like how about we do that some might call it a prototype or a proof of concept right like and that actually if the if the group of people working on this have the right mindset of like this engineer is intentionally going to bring me something that is not totally baked so that i can react to it
That can be a very good technique. In fact, I've started in many aspects of my professional life to embrace that approach of getting a first draft out, a rough first draft out early.
often which has bold choices in it simply to elicit reactions like i think i know what you want from me but i don't really know so i'm just going to get this in front of you and i'm going to give the provocative things in there so that i can actually get out of you what you want and you can do that with code too rather
Brad: Yeah.
Scott: there's something i have to come back to i talked about the monitoring how that was so important i really need to talk about
the core of
I would say the QA process that the monitoring was the tail end.
We required what I would call then an implementation plan or some people call a technical design doc.
The thoroughness of how that should be written was varied based on what was building.
Sometimes you just wrote it in the ticket. But the thing that we required is that was peer reviewed. Somebody else, you at least turned to your neighbor and said.
Hey,
Brad,
I'm thinking of doing this thing.
This is how I'm thinking of doing it. Do you think that's the right way to do it? You know, and the more complex it was, we would checklist for all these things of like the more things you checked on this checklist,
the more people you should get involved,
the more writing you should do. But that was the key part of quality is just have a conversation with another human up front about what you're planning on doing.
It's kind of like a flavor of rubber duck debugging,
which is just saying it out loud, just putting it on paper has the qualitative effect of like.
What's the investment? Just talking to another person.
Brad: And that's a great point about like baking in quality early on.
And, you know, there's other parts of that too that I'm assuming were also part of your SDLC like code reviews and post implementation reviews.
That's another great opportunity for sort of quality gates.
Scott: Well, let's talk about those two things because code review is a really big part for us.
We rely very heavily on code review.
As good as I've seen it anywhere,
and I have never been able to get the culture as strong at any other place I've worked,
which is because this company, we did not have manual QA testers at the end.
The engineers knew they were responsible for their own stuff. They also knew when they were doing a code review for their peers,
like it wasn't just like I'm going to skim it and make sure it works. We have a cultural expectation. You will.
Put this branch on your machine and execute it, right?
Brad: As
Scott: You will not
Brad: the code
Scott: just,
Brad: review
Scott: as
Brad: as the code reviewer.
Scott: the code reviewer, you will run this, right?
And you will.
just trying to get it to build on your own machine is a big piece of QA right and so that was an important cultural piece and that itself had a huge made a huge difference in QA and then you brought up something else oh you were what was the other thing you said about post implementation something
Brad: Well, it was like a post implementation review,
not not just a code review like I'm reading the code,
but like, OK,
yeah, really walk me through this.
What was your implementation?
So I had
Scott: Gotcha.
Brad: an implementation I planned.
Scott: Yeah.
Brad: Then I had an implementation I actually implemented it, probably variance, it probably had some variance from the plan.
Scott: Yeah.
Brad: And then I have the code that manifests the implementation,
right?
Scott: Yeah.
I want to take a tangent for a sec because we cannot do an episode without talking about AI,
Brad: I was just
Scott: although we have done it in the past.
Brad: about to say something about this.
Scott: I'm starting to get into this, we talk about pair programming,
I'm starting to get into this thing pair code reviews.
Because in a world where AI is maybe writing more and more of the code,
and you still have to get your lesser experienced developers to be more experienced developers.
I think the way I do that is to get is pair code reviews
Brad: I like that.
You know, we used to do, this is so long ago,
right?
So it was like.
You know, a web-based GitHub didn't exist at the time. Right.
But I remember it used to be that code reviews were literally we would get a bunch of us engineers would go to the conference room and the developer who wrote the system would pull up the code on the on the big screen TV.
Scott: On screen?
Brad: And then we'd
Scott: Absolutely.
Brad: all maybe have our paper copies of the code or we'd have our local copies on our computers and we'd be like,
OK,
Scott,
walk us through this new.
This new auth system that you've implemented and we're going to walk
Scott: Yeah.
Brad: it through, we're going to walk through it. We get to ask our questions. We get to almost like a doctoral thesis defense or something.
Scott: Yeah.
I remember those days.
Brad: What has happened to that?
Has the world moved too fast now?
Is that meaning
Scott: Social media.
Brad: no
Scott: Everyone's just staring at their screens all day
Brad: attention
Scott: long.
Brad: span.
Scott: People don't interact as much anymore.
Brad: Okay,
so I have a couple of quick reactions. I love your peer code reviews.
I like that idea.
I kind of want to challenge this in something we haven't talked about yet here in this conversation is how do you decide how much you're going to invest in each of these steps?
Right.
And I feel like, you know, I often I'm often working with, you know, startups that are pre MVP startups that are trying to like figure out like get product market fit, you know, or and and I feel like it's pretty hard for me as a CTO or a fractional CTO to tell an entrepreneur like you're going to need to spend.
20% of your budget on writing automated tests for this feature that you haven't gotten product market fit on yet.
Scott: It's such high ROI.
If you think about it as a portfolio, what I was trying to say when I mumbled my words is,
oh, yeah,
but it's such high ROI.
If you think about it as a portfolio,
like the ROI on the tests of the stuff that you keep.
around is tremendous and if you end up throwing out a bunch of code because those parts of your product didn't meet like didn't didn't fit with your customer well those were investments that were zeros but overall like
end up with a system that has a high level of test coverage is just such a high ROI.
Brad: Let me challenge that and say,
I think there's some framework that we would need to apply that has something like a.
kind of roi uh roi of test investment type metric right and for example i think we might want to include things like okay what's the what's the risk of the feature is there security privacy data loss what's the cost of failure like if the thing fails is it a revenue loss is it a trust loss is it you know or demos
how often are we changing this code is there like a bunch of churny code benefits from tests how complex is it how much runtime criticality is it you know performance media real time and you know do you have some kind of a compliance or contractual requirement right so this is kind of like this risk reward how much risk is there in the future how much cost of what happens if you fail you know what and to me it feels like there's some way to
way to like multiply all that stuff out and then kind of get yourself a guideline of like okay like how much do we need to invest in the in each of the components of the of the test off automation of this based on that all
Scott: Okay, so when we just talked about test automation,
we talked about all these phases
Brad: these phases
Scott: along the
Brad: i
Scott: way.
Brad: feel like like for example like if something is relatively low like let's call this the the investment
heuristic right so
Scott: Mm-hmm.
Brad: if we scored like risk cost of failure rate of change complexity criticality compliance if we scored all of those like on some zero to three type thing and then you added up all the points
Scott: Yeah.
Brad: then you're going to get a bunch of features that are like low
low roi heuristic right like
Scott: Mm-hmm.
Brad: they're not they don't have any risk to them if they fail that's not a big deal um it's relatively not complex code you know you've got no contractual obligation to it and so that if that score is low on like all these vectors then i feel like very low roi in investing in a lot of automation there and going with
with and going with just some kind of like a low end like smoke it just hold the hold the developers accountable for smoking it and or end-to-end only type stuff if it's a critical path feels like a reasonable investment but if it's like high risk high cost of failure you know high complexity
then like then go hardcore on strong unit tests strong integration tests throw all the bells and whistles at it and throw the canary the canary and the rum monitoring of
Scott: I would say yes in general, but I'll tell you how I think about it, like a little bit finer points.
Everything, let's just go,
everything,
code review for everything.
Brad: course
Scott: Everything
Brad: everything
Scott: gets code reviewed.
Brad: gets code reviewed totally agree with that
Scott: Everything gets code reviewed.
engineers save me but it's only one line it's so simple why should someone code review it it's like well if it's so simple it won't take them very long Exactly. right
Brad: I agree there.
Scott: so it's just let's just take that decision out of it everything gets code review the second thing i would say is everything gets unit tests right
if it's everything gets unit tests but then the other things
Brad: unit
Scott: how much time
Brad: tests
Scott: you spend yeah
Brad: though really are about like logic that are fractionable logic right so like when you say everything get unit tests like the instantiate the button ui the unit test for that tends to be you're not those those are low
Scott: low value you're saying it's low value but what i would also so to me there's a cultural piece there
Which is like the thing about the unit tests is in this heuristic of things is it's easy to make a mistake on the.
on the heuristic and think something is low value when it really should have been high value so like at least with the code review and the unit test which they sort of see as the foundational things like let's just say we're going to let's just we're just going to have a culture of just doing these things and it's going to be it's going to be it's going to set the right culture of having these things buttoned up but then when it comes to more complex tests your integration and end tests and it comes to your monitoring and it comes to your upfront
technical design planning,
those are the areas where I've varied it based on the heuristic that you're using.
But in the center of it, in my mind, is the code review and the unit test is just we're just going to do those because what happens is, oh, this, you know, this button,
it's, you know, if the unit test doesn't provide a lot of value, I'm not going to put a unit test on it.
But then somehow one way or the other someone breaks buttons and no buttons don't
Brad: You
Scott: work anymore.
Brad: also include in everything has to have a unit test. Do you have some kind of a code coverage branch coverage requirement as well?
Well, like must have 100% coverage,
must have 80% coverage,
what?
Scott: We put like a yes,
sort of, and they had 100% strived for 100%. In one company, we just had an agreement, hey, it's got to be.
You need to have a certain level of coverage.
Another company I was at, we actually had a danger rule that wouldn't let you commit if your coverage wasn't.
Brad: And somebody figured out how to add like 100 lines of comments and get their coverage up.
Scott: and there was another place that was that we had a different danger rule which is you couldn't commit if the over i think i can't remember how this worked maybe we didn't do this maybe we just thought about it but it was you can't commit if you're making the overall coverage go down
Brad: Yes.
Scott: right we just always want to be getting better yeah people game the system all the time and that's i mean i don't love it but you know i think most people don't try to game the system but i think what i was really trying to do with code review
code reviews and unit test coverage was just set a foundational culture of like these are two things where if we do them right can really save our bacon frequently and let's just take the decision making out of it because the decision it's it's clear when you don't need the tests and it's clear when you do need the tests it's the gray zone in between where you make the mistakes
Brad: Yeah,
Scott: so
Brad: yeah
Scott: let's just eliminate the gray zone by just saying we're going to do everything
Brad: Okay, so you sort of hinted to the question of AI in the case of, you know, like, let's start doing pair code reviews of AI so we can teach young developers how to read code and understand code.
I love that idea.
But let me ask this other AI question.
With the trend towards vibe coding.
I'm skeptical.
I am skeptical that the vibe coding out there, I feel like it's making every possible wrong choice in your quality chain of quality,
right?
Like lack of clear specificity of what the behavior is,
lack of a design plan up front,
lack of a review of that.
But, you know, and didn't you recently have a story with you were asking me, right?
You sent me this text message about, hey, my my AI code pilot wrote a bunch of unit tests,
but it's not running them.
What do I tell it? How do I tell it to run the unit test it wrote?
Scott: Well, it's funny. I did text you that recently, and it turns out that some configuration got messed up.
And so that wasn't the only problem I had.
It wouldn't do anything to my.
into my Oh, code it
Brad: man.
Scott: wouldn't even change it there was there was some setting somewhere i couldn't find it i actually had to uninstall this thing and reinstall it there was some setting somewhere i must have twiddled with that
you know like safe mode which is like okay well we'll tell you what to do but we're not going to do it to your code right and i couldn't turn it off but all of this talk the instant you mentioned ai made me think something
It's that final sort of end-to-end test,
which is becoming the most important,
because it's like you've mentioned many times the ephemeral app,
you know, people aren't going to buy apps anymore.
They're just going to say, AI,
make me this app that does this thing, right?
The code is going to be a black box.
Brad: Yeah.
Scott: Nobody's going to know what's going on. It could be spaghetti cut in there. It could be beautiful.
Nobody's going to know. Nobody's going to care as long as they ask, does the things we want
Brad: But
Scott: to do.
Brad: isn't that didn't you just didn't you just basically bring us right back to manual testing,
which is all ephemeral apps will just be built. They'll be completely bespoke. And the answer to quality is, did it did it meet the needs of the person who used it?
Scott: Well.
I mean, you can automate those tests, right?
When the users click the button,
does the thing go ding?
Brad: Yeah.
Scott: But you don't need to know if the code underneath there,
you don't need to code review that.
You don't need to have unit tests on that.
You don't need to know if it's any good.
The data could all be stored in one giant.
All your data could be in one text file that's stuffed into one field in one database.
It could be crazy sauce,
but hey,
I pushed the button, it went ding.
Brad: Yeah, the database is
Scott: I
Brad: literally
Scott: guess just it works.
Brad: in a giant string in the JS file of the main.js.
Scott: Yeah.
Brad: Yeah.
Scott: It's not the craziest thing in the world.
It probably is the craziest
Brad: I'm
Scott: thing
Brad: sure
Scott: in the world.
Brad: that worse code has been written.
Somebody might actually write an ETL job to copy usernames and passwords from one database to another.
You never know.
Scott: It's you never know.
But this is making me think the part of testing that has always been the most challenging test automation that's always been the most challenging is that user interaction
Brad: Yeah.
Scott: testing,
right?
right selenium
Brad: Yeah.
Scott: those kinds of i don't know there's different tools now is it cypress i think is one that's out there i haven't been up those are always the ones that are the most brittle the hardest to get to work well and engineers hate them the most but in an ai world they actually might be the most important degree
Brad: I agree.
Scott: Which is pretty interesting.
Brad: All right. So basically.
Scott: Okay, wait, there's one other. So you're going to go. So basically there's one other thought I have to put out there about the AI world.
I've thought about this a little bit,
but I haven't really formed any concrete thoughts. I'd love yours.
What's the role of test driven development in the AI world?
Or it's getting closer actually to the Gherkin stuff,
the requirements,
the BDD. What is BDD?
whatever the requirement-driven development is getting closer to that
Brad: Yeah.
Scott: stuff.
Brad: I mean, look, I.
I mean, all the AI agent code that I'm writing these days, I do try to tell it like from day one, like,
hey, I'm going to want you to have unit tests for everything. I'm going to want you to make a Cypress or Selenium end-to-end tests.
And as we go through each of these steps,
Mr.
AI agent,
like get, you know, get to the end point and.
I want unit tests that test the expected outcome of the step.
And so I, to your point about your chain of quality,
like, yeah,
absolutely.
It's way easier for me to write unit tests for everything.
The AIs are quite good at that and I can even throw it like I can run a coverage report and say,
hey, your unit tests only had.
75% coverage and I noticed that it's missing all of these branches from this code that you wrote can you please go write your unit tests that will test those corner cases as well and it's usually pretty darn good at getting those the only times that the only times that it will tend to like have to work extra hard or fail to do it is if you've got like some kind of defensive coding that's like you know gracefully handling null pointers or something like that you just
Because there's no version of it's like the code paths are almost unexecutable or something like that.
Scott: Yeah, you're making these you're making you've provoked thoughts in my head, you're making me be thoughtful about something you've pointed out a few times, the upstream stuff, and that the vibe coding is making the upstream stuff like get fuzzier because you're just talking to your computer,
but it actually makes me think that's in terms of quality like that's.
More important, you know, recently I mentioned to you, I can't remember if I mentioned it on the podcast or not, but I had seen these posts about people doing prompt engineering with Jason.
Brad: Yeah, yeah, you and I talked a little bit about that, I think, recently.
Scott: And I was thinking about that and I'm wondering.
If you agree with this, I think I thought, well, I think the reason this worked better is actually that JSON is just helping people structure their thoughts more
Brad: I
Scott: clearly.
Brad: agree with that.
Scott: If people actually wrote as clearly as the JSON is driving them to write.
Plain text might be fine,
but people just get there and do sloppy stuff in their words and the computer doesn't know what to do.
Brad: I was going to say like another quick little mini story here that I recently had a pair programming session with one of my junior engineers where he was working on a bug.
he was struggling to work on it.
And I said,
hey, why don't we get together and we'll just sit down and do some pair programming together on this.
And I focused a lot on the how are you prompting the AI to help solve this problem.
and um there was a couple things that i took away from it one thing that was really cool was he and i kind of like prepped ahead of time like i knew the bug i grabbed his copy of the code base i went and threw some prompts at it and watched the ai come up with answers and so i kind of had my own kind of what i thought it was going to be good at um and he did some really cool stuff where he actually
ran i was super happy to see this he ran the code he ran two different versions of the code he had like the develop branch so he knew like the main code base he had his local build he was inspecting it in chrome and and this was something like a rendering type issue so he was like inspecting the two different objects uh in the chrome dom to see like why is this the tailwind css class not being applied correctly so it was like he did some really good prep debugging that i thought was great and i you know kind of said hey
i said hey good job buddy um but when he prompted the ai he didn't he didn't basically give it a bunch of context right so he didn't say this code works the old code works i changed the following when i changed the following the bug got introduced he didn't give it the context of the other stuff he changed and i kind of was like hey
Why don't you try that? Why don't you try telling it what you changed?
That's going to give him give the AI a better clue about where the possible interactions were happening.
And it was night and day the difference in the AI's results. Like without that context, the AI just threw up some completely random ideas that weren't were completely wrong.
Scott: How did he tell the AI what he changed? Like, did he give it a diff, like here's my diff?
Or did he just say in words like this is what I did?
Brad: In this particular case, he said.
it was something like this was drag and drop related so it was like an object that didn't used to be draggable that he was making draggable so simply saying like this object used to not be draggable i started using the draggable action so like that was enough context for it to
Scott: That
Brad: that
Scott: was enough.
Brad: was enough um
Scott: Fascinating.
Brad: that being said i have definitely given it prompts like my branch is brad's feature x branch
It has this following bug.
The develop branch has this following bug.
uh it doesn't have the bug it works correctly here's the description of bug and so i'll give i'll sometimes give the ai and it'll often go and say cool i'm going to go check out those two branches and do a diff between them and that and you'll see it like working away going up checking out old branch doing the diff you know and then come back and go oh i see you made the following changes
here's where the problem is so i feel like so the reason i mentioned this only because of your json point like i think that's a
That's a really good point that like if you had a I'm doing a bug fix and the prompt is I'm going to make sure when you do the prompt for bug fix,
always give it the context of the branch. Where does the bug not happen?
Where does the bug happen?
You know, what was the change you were making when the bug started to happen,
et cetera.
Scott: Can I leave you with an anecdote today?
Brad: Yeah,
I
Scott: Have you seen the video going around the internet of the school teacher making the peanut butter and jelly sandwiches?
Brad: have not, but my immediate brain starts to picture what the joke is going to be about this.
Scott: It's not a joke.
I mean, this is.
uh this is an elementary school teacher you don't see the kids in the video you only see the teacher but you hear the kids and i would i would guess they're you know third fourth fifth grade somewhere in that range based on the tones of their voices and the kinds of things they say and they had an assignment there she's an elementary she's doing they have a descriptive writing
Brad: And she's following their descriptions to how to make a sandwich.
Scott: yeah and she has been she's asked them
write instructions for how to make a sandwich and so she has got a jar of peanut butter a jar of jelly and a loaf of bread and the instructions are you know you're supposed to write how to make a peanut butter and jelly sandwich and she says okay i'm gonna she's got the stack of papers right there she's like i'm gonna do exactly what you told me
and she doesn't in this video and it's adorable because the kids are laughing and they're like no no no so the first one is like get some bread and put peanut butter and jelly on it and so she puts the bread on the desk there and she puts the peanut butter and jelly right on top of the bag of the loaf of bread she's like is that what you meant you know they're all like no no no no then she gets another x one and it says um get some bread
and spread peanut butter and jelly on it or something like that and so she opens up the jar of jelly and takes her hand in and spreads it right on top of the bag of the wonder bread or whatever it is and spread it and they're all no no but this is a you know and it was a really powerful powerful illustration of what it means to be descriptive Yeah. and when we think about this AI in context
right context is so important because when someone says we'll take the bread and spread some jelly on it when you hear the word spread as adults or even maybe as a child you kind of like get a knife and use it to spread it on the bread but these computers are so smart yet so dumb and you have to just give them exquisitely detailed context to get them to do the thing that you want them to do
And how that relates to QA, which is the topic we started with, I have no idea,
but the video was adorable.
Brad: Love it. I'm going to have to link that video in the show notes of this episode.
Scott: I'll have to find it and I'll do that.
Brad: Great talking to you, Scott.
This was super helpful.
I appreciate your insight on the chain of quality.
Scott: Thank you. I'm glad it could be helpful.
It's fun talking to you too.
Brad: Everybody, please rate, review and smash that subscribe button.
Scott: You could be our one millionth subscriber.
Brad: He could be.
Scott: See everybody.
Brad: This episode of How Many CTOs Does It Take podcast was edited by Saffron Epigal.
Our theme song was AI Generated by Brad.
Scott: Please follow us on all the social media platforms at at HowManyCTOsPod.
You can find us on YouTube,
LinkedIn,
Instagram,
Facebook,
Threads, X,
TikTok,
and Patreon.
Or at our website at HowManyCTOsPod.com.
And remember to rate, review,
and subscribe on the podcast platform of your choice.
Thanks for listening.