Blog

Quality Sense Podcast: Lewis Prescott – Contract Testing

Welcome to another episode of the Quality Sense podcast! Today I will share an interview I had with Lewis Prescott. He is a QA Lead at Cera Care and has worked across testing projects including property management, e-procurement, electronic trading platforms, and government. In different areas such as Functional, Automation, and Performance Testing.

He also volunteers within his local community at Code Club teaching kids programming skills, which he really enjoys. 

In this episode, we talked about contract testing, its advantages, and how it can be paired with API testing, our takes on pair programming and more. 

You will also get a glimpse into Lewis’s fatherhood and how becoming a parent changed his perspective as a leader. 

Episode Highlights

  • How Lewis’ background in Psychology led him to a career in Software Testing.
  • What the challenges related to quality and testing in the health care industry are.
  • How to explain Contract Testing to someone who never heard of it
  • What’s the typical role that takes ownership of this type of test? Is it the developer, the tester, the test automation? What’s the advantage?
  • How did becoming a father changed his perspective as a leader?
  • Lewis’ experience with teaching children to code


Relevant Links:

Lewis’s Website
Follow Lewis on Twitter
Follow Lewis on Linkedin
Lewis’s book recommendation

Listen Here

Episode Transcript

Federico:

Hello Lewis, and welcome to the show. How are you doing?

Lewis:

Hi. Hi. Thanks for having me. I’m really good, thank you.

Federico:

Amazing. Amazing. So maybe for starters, can you tell me a little bit of yourself? Can you introduce yourself?

Lewis:

Yeah. So my name’s Lewis, I work for a healthcare startup here in London. Also, I’m a father and a husband, so I do lots of things outside of testing as well. But in my testing side of things, I’ve also speak at conferences, on online courses, have my own podcast. So yeah, I’m sure we’ll get onto that, but that’s a bit about me.

Federico:

Amazing. We’ve been talking before starting the interview that I have a chance to attend a in-person conference the first time since the pandemic started, and it was amazing. I hope you have the chance to attend one over there in the UK soon.

Lewis:

Yeah. Hopefully, fingers crossed.

Federico:

Yeah.

Lewis:

Yeah.

Federico:

So, let me know what, so how you ended up working as a software tester.

Lewis:

Yeah. So, it was by chance really because I did a psychology degree, and then I was interested in getting into like psychometric testing. So, testing people, right? So, analyzing people’s behaviors and their…

Federico:

Are you able to improve the quality of a person?

Lewis:

Well, that’s what these companies try to do, right? Like it’s often high level people, like C level people, who are applying for a job or something, the company will get them to do these psychometric tests. And so, if it comes out that they’re like really selfish, or really not able to do their job well in high pressure situations, then this is what these tests aim to show. So yeah, I was really interested in that. And so, I worked for a company as an apprentice working for them, and I literally did everything. I did sales, I did marketing, I did… Yeah. Literally everything for them, mainly picking up the phone when someone called, so like first line support, but that got me into testing. And then the software side of things just really took my interest and I started looking into it. So yeah, that’s how I got into it, and then worked for a consultancy who provided a graduate scheme, and the rest is history.

Federico:

And what are you doing today?

Lewis:

What am I doing today? So I’m a QA Lead at Cera Care. So yeah, I do everything now, like a lot of management, and training testers, so teaching and also developers, and the rest of the development team. But yeah, I’ve come a long way since I started out in testing for sure.

Federico:

So, it’s also related to the healthcare sector, right?

Lewis:

Yeah. So, Cera Care are a company who work in, carers go into people’s homes. So, we provide the software around that. That industry is like really far behind in terms of technology, so we are basically really revolutionizing that industry, and taking it into the modern age, if you like.

Federico:

Mm-hmm. So, in some way, you are combining your background in psychology or in the health area, and also your experience in software testing. That’s amazing.

Lewis:

Yeah. Yeah. I really have an interest in working in healthcare. I think the skills that I have, I really want to give back, I really want to contribute towards helping people. And yeah, I guess that has come from my background.

Federico:

So, I understand that there are specific challenges in the healthcare industry related to the quality of the products that you produce, right? Can you share with us some of them?

Lewis:

Yeah, absolutely. It’s a really difficult industry because obviously, you’re dealing with people’s lives, right? So, the level of quality has to be really high. And also, you’re dealing with people, especially in our industry and care, where you’re dealing with people who haven’t really used technology before within their jobs. So, it’s very new to them. So, we are dealing with a startup mentality of trying to build features quickly and release them quickly. We have a couple of releases per week on the mobile, but they’re trying to like reign that in a bit at the moment. But yeah, so, we’re trying to move quickly in a startup world, but we’re working in an industry which needs time to adapt to that and also comes with all of that kind of red tape where you need to make sure that you’re coming with the quality because we’re regulated by the health commission. So yeah, it’s a difficult dynamic at the moment, but yeah, it’s an interesting one to be a part of in my role.

Federico:

Yeah. I guess the challenge is also to find the correct balance between the regulated environment and all of the things that you have to be compliant.

Lewis:

Yeah.

Federico:

And also, try to respond quickly to the feedback that you gather from the users and the customers, right?

Lewis::

Yeah, exactly. And another real big challenge that we have is that people are operating in very rural areas so that they are providing care in like the edges of the country which are not really accessible by mobile networks. So yeah, it’s challenging. We have to offer quite a few different formats to allow people to operate in that way.

Federico:

Amazing. So, we mentioned that we wanted to discuss today specifically about contract testing, and I don’t have personally much experience around that. So, how would you explain the term, or the concepts behind it to someone who is new to contract testing?

Lewis:

Yeah. So, that’s a really common question, right? Lots of people have heard of it, but don’t necessarily have the kind of knowledge to be able to explain it. So, for me, the way that I like to describe it is it’s flipping integration testing, upside down. So, the traditional way that you operate integration tests is you have the service, the API service, and that sends a request, and then you receive a response, and you validate in that way. But what the contract testing does, is it puts the power in the user’s perspective. So, when we think about a user of a service, we’re talking about a web app, a mobile app. So, they are the users in this context. So, what they are doing is they are providing the scenarios, and then the API service just replays them. So, we’re not validating our own service anymore, the user is validating the service. So, I think hopefully, that that’s described it in a simple way.

Federico:

Yeah. I understand that the user is also another developer who is using that service, right?

Lewis:

Exactly. Yeah.

Federico:

And you are providing that user documentation, tests… Well, the scenarios.

Lewis:

Yeah.

Federico:

And all what that person needs in order to understand the service, and be sure that it’s going to work as expected, right?

Lewis:

Mm-hmm. Exactly that. Because we all use like documentation tools now to communicate what our APIs are doing, but what we are not doing with that documentation is actively testing it, and that’s where contract testing comes in to say, “Okay, you’ve provided this documentation, but do you comply with this documentation?” And also, it’s a moving target, right? Software is always moving, so we need to make sure that we’re keeping on top of any changes that we make.

Federico:

So makes sense. And when we are talking about this is specifically focused on the functional side of things, or you can contemplate other quality factors like performance, security, or other things?

Lewis:

So, you leave the functional side of things to the unit testing, and the integration end to end testing, and contract testing offers the like schema-based testing. So, any interactions that you have, that can be validated within the contract. So, what you’re expecting within the response to render on the web app, or any requests, so whether it’s a 404, or a bad request, all those interactions you can test by contract testing. Any logic, you leave that for other types of tests, but yeah, it’s purely that interaction that you’re having, that you are testing. It doesn’t cover any of the kind of performance aspects because you are doing it completely in isolation. So, the services don’t communicate with each other in this type of testing, the web app for the user side of things uses a mock, and then the API service just replays it against their service so they’re not interacting again. So yeah, there’s no other… It’s very isolated.

Federico:

Okay, perfect. And how do you do that? I mean, I guess that you need some sort of tools, or something?

Lewis:

Yeah. Yeah. So, I usually use Pact, which is a tool which allows you to do this. It supports many different languages. There’s also native ways to do it like in Java, they have Spring Cloud Contract package, which is native to the spring packages. And then also, I implemented it at cancer research where it was like asynchronous type of testing. And what we did, is we just store the contracting in GitHub and just pulled them down from there. So, contract testing is just the type, right? It’s just the way to describe the interactions that you’re making. So you can do it in any way you like, but it’s just, yeah. The tools have been built for that purpose and they make it much easier.

Federico:

Makes sense. Makes sense. So, you can coordinate with the rest of the team to follow the practice using different.

Lewis:

Mm-hmm.

Federico:

… tools, but there are specific platforms that make things easier in order to be more integrated in the same environment with all the different parts required for the development following contract testing approach, I would say. Is that correct?

Lewis:

Yeah, exactly. Yeah. And they offer helpers, and they offer guidelines on how you can do it. So yeah, it does make it much easier. And there’s a strict format of how you do it. Pact also offers some tools to allow you to verify when the contracts have been tested. So yeah, it’s a nice way to close the loop if you like when you’re doing contract testing.

Federico:

Okay. And, you know, typically, I’ve seen this discussion before that if unit testing is something that is specifically for developers, or-

Lewis:

Yeah.

Federico:

… if testers could also add some value in unit testing, how do you feel this applies to contract testing? It’s something that it’s specifically for developers, test automators, or tester can contribute. Also, there is a specific way to collaborate within the different roles, or what’s your vision on that?

Lewis:

Yeah. So, usually, the developers are the ones that would write the contract tests because it lives directly next to the code. So, anytime you make a change to the contract, you want the contract tests to be updated, right? So, you have to write the tests in line with the code. So, in environments where the testers are removed from that code base, then often, it won’t be them who is writing the test. But in my experience where you’re working with roles like software developer, and test, or you’re working with testers that are really working very closely with the developers, then yeah. In environments like that, testers absolutely get involved. And it’s important for them to get involved in the types of interactions, because you will have a number of scenarios that you need to run against these contracts. Like, as I mentioned before, about the bad request, or the “not found” errors, and stuff like that. So, developers are not necessarily going to go all the way into thinking about all the different edge cases, and that’s where a test that can really provide value in that.

Federico:

So, like a collaboration, maybe small brainstorming sessions, or pair review, or pair testing, or pair programing, how is the dynamic in order to get them both visions contributing to the same feature? I would say, I don’t know.

Lewis:

Yeah. So, I always endorse pair programming, but yeah, we at Cera, one of my QAs had brought it over from another company, but they have testing parties. So yeah, there’s no development on those days, everyone’s just testing and that’s where you can really provide time for those kind of pair, mob testing, pair testing, whatever you want to call it.

Federico:

Yeah. But maybe the question is, what’s your advice for a tester, or a test automator if they want to get involved with the development following a contract testing approach?

Lewis:

Yeah. Good question. That’s a good question. So, the contract testing framework, once it’s set up, it’s easy to add tests afterwards. So, I guess, that’s a route for testers to take. Once it’s set up, they can get involved and start adding scenarios. But if they want to get involved in that process, setting it up for a new service, or anything like that, yeah, absolutely. I would say pair with a developer to work out how it can fit in, and also set up all those steps that I’ve mentioned before about setting up, okay, you set up the consumer side, you set up the provider, you set up the store. And then once you’ve got it all mapped out, then you can just plug and play where you need to. But yeah, it might need a developer to get you started.

Federico:

And maybe now I think that now comes to mind, is how is this related with a traditional API testing approach? Is there something that you should do as a complement of the contract testing, is something that you do in order to explore different scenarios and maybe then you add some of those cases to your contract, how is it?

Lewis:

Yeah, it’s definitely a pair. You want to pair them together. They work well together. But the benefits of contract testing is that you are running it locally as like a unit test so it’s much quicker. And you can also add lots of scenarios, and you don’t have to scale your API tests, for example. So, you can run all of these tests in parallel because they are so isolated. There’s no need for you to worry about them tripping over each other. So, that’s where it comes in. So, you can move a lot of your tests where you’re testing things like error codes, and things like that. You can move down to the contract level, and then you would still want to have your integrated API test because when you deploy to an environment, you still want to make sure that the configuration is right. You want to make sure that the logic is coming through correctly. So, all of that stuff still exists, but the contracts allows you to kind of have those finer tune tests at a lower level, which will run much quicker.

Federico:

Amazing. And to wrap up this part of the conversation, what do you think are the most important advantages of following this approach?

Lewis:

Yeah. So, Pack Flow hosted a webinar the other day about a use case, which they went through, and they evaluated the advantages. So Singular was the agency that ran that and they spoke about some benefits, one of them being the manual testing effort was reduced because in a microservice architecture, sometimes it’s quite difficult to test that end-to-end scenario with automated tests. But when you put contract testing into that, you have the confidence that all the integrated pieces integrate successfully, so then you can reduce those end-to-end scenarios that you were worried about before. And also, because you’re running them in isolation, you can reduce the environment costs, so you don’t have to spin off an environment which is fully integrated anymore, don’t have to spin off an environment for your CI pipeline. All those things are contained.

And also time to resolving the bugs that you find, because you’ve now got this picture. So, one of the benefits of contract testing, it paints a picture of what services talk to each other so you can see that clearly, and you can identify specifically, okay, this interaction broke, and this error was thrown. Okay. I can see that in the visualization of which services communicate with each other.

Federico:

So, it helps to provide more feedback looks, and also to try to go straight to where the programs of the last changes are located, right?

Lewis:

Yeah, exactly. Yeah. Tagging, versioning, all of that stuff’s built-in, so you can clearly see, okay, this version broke with this integration, so yeah. You can pinpoint it very quickly.

Federico:

Amazing. Excellent. Thank you. That was for all that knowledge and experience.

Federico:

Today, you mentioned that you are also a father-

Lewis:

Yes.

Federico:

… that you have a daughter, right?

Lewis:

Uh-huh.

Federico:

How old is she?

Lewis:

She’s just turned one. So, yeah.

Federico:

Oh, okay. And I know that you wanted to mention something related to… I would like to learn more about your experience in those first months because you mentioned something that you had a shared parental leave with your wife.

Lewis:

Yeah. Yeah. So, in the UK, you can split your parental leave. So, she did the first nine months, and then I did the last three months. So, I had three months for my daughter being nine months until one year old. So yeah, it was a really great time. I got to see her start walking, start talking, all that stuff. So yeah, it was really nice to be around for that period of time. But I would say it’s more challenging than the 9:00 to 5:00 working environment because there is no time off when you are on parental. It’s a 24/7 job, so yeah. I just wanted to mention that for all the… The dads out there that I went through it too and it’s yeah. It’s a challenging time.

Federico:

How did that changed, how that experience changed your perspective as a manager, as a leader?

Lewis:

Yeah. Big time. Yeah. I think before when I worked for a company, especially a startup, right? Like I put in all the hours, hit like weekends, evenings, all that stuff. And I took that for granted. And now as a manager, I’m very much like looking to make things flexible for my team. Like we’re a fully remote team, so yeah. Whenever they want to work from home, it’s all good, right? Like it makes such a difference. The commute for me is very short. I’m very lucky I live in central London, but for some people, they’re commuting like an hour, hour and a half each side each day, so it’s a long time and that’s time that you don’t get to spend with your children. So yeah, I definitely admire people who worked pre-pandemic when it was expected to be in the office. So yeah, it’s definitely changed my perspective.

Federico:

Yeah. And I think what you are doing is not only great for you because I understand that it was a great experience for you, but also it’s amazing too the fact that you are also sending a message to your people that this is something that you, as a leader, consider that this is the right thing to do, the normal thing. And by doing this, you are also telling them that they should do the same, that they should spend time with their family, prioritize what it’s really important, and to be flexible with the rest of the team. So that’s an amazing message for your team. And I wanted to mention that because I really admire leaders that can stand on that position, and also not only in words, but in actions to show what the people should do to take care of themselves, and to be happier with their lives, and with their jobs, right?

Lewis:

Yeah. Thank you. Yeah. I appreciate that. I think it’s really nice to be able to spend time with your family and it’s difficult to do that in the work life balance.

Federico:

Yeah. Yeah, yeah. But it’s a horizon that we should try to get closer, right?

Lewis:

Sure. Mm-hmm (affirmative). Understand.

Federico:

So, another thing that you mentioned is that you are involved in some code club for kids?

Lewis:

Yeah.

Federico:

Can you tell us a little bit about that experience?

Lewis:

Yeah. So, when I work for ASOS, they gave me a few hours every week, and I went off, and I taught kids to code in a local school in Camden, which was an amazing experience. Like kids have so much creativity, and they think in a completely different way. So, if you are teaching an adult how to do something like how I teach testers and developers how to do something, is completely different to how you approach it for children. So, yeah, it’s a really cool experience. And there’s one kid, he was autistic, and he was just amazing with patterns. And he came up with this rainbow design. I sent them all away and I said, “You need to make this picture out of CSS.” And then he just made a rainbow out of nowhere. It’s just like such a rewarding experience to see someone thrive in that environment. Because in other subjects, he may not be able to follow, but yeah, with that, he just went off, and his creativity took him to a place. Yeah, it’s really cool.

Federico:

That’s amazing. I can really relate to those experiences, teaching people, and trying to find what they make us thrive, and what really motivates them. It’s really important.

Lewis:

Yeah.

Federico:

And also you, as the teacher, learn much more than them, right?

Lewis:

Definitely, definitely.

Federico:

Trying to explain from different perspectives, especially for kids. I participated in a project where we taught testing to people with less resources in order to help them to break into technology, and trying to explain things that for you, it’s the day to day language.

Lewis:

Yeah.

Federico:

So you have to stop and explain basic terms. It also helps you to really understand what you are talking about.

Lewis:

Definitely.

Federico:

And to be more empathetic with, to be more empathetic with the rest of the people, understand their thinking process as well.

Lewis:

Definitely. Yeah. Yeah, for sure. And I think in education as well, I think programming is going to be part of education going forwards.

Federico:

Yeah.

Lewis:

And the UK is definitely a little bit behind some other European countries and especially in Asia. So, I mean, it is great to give these kids this opportunity and yeah. Hopefully, it’ll become part of the curriculum very soon.

Federico:

Yeah, for sure. My wife is a scientist, she’s doing, she’s a biochemist, and she’s doing some voluntary work for some institutions who try to motivate children, and kids, and young teenagers to get into STEM, right?

Lewis:

Yeah, yeah. Yeah.

Federico:

And she is really fascinated about how the curiosity of the small kids make a really difference in the way they approach a problem. Because they typically have some games or puzzles in order to motivate them to play and learn something related to science.

Lewis:

Yeah.

Federico:

And in those games, they learn a lot. You have to be patient because they take their time by exploring. But this is also part of the learning process, and to develop this critical thinking that we all need, especially in our jobs now and in the future, right?

Lewis:

Yeah, definitely. Yeah.

Federico:

So, it’s amazing that there are many, many places paying attention to teach programming and science to kids.

Lewis:

For sure.

Federico:

Lewis, a couple of final questions. I would like to ask you to recommend a book. It could be about anything, so for testing or any other topic, which would you like to recommend our audience?

Lewis:

So, I really recommend The Unicorn Project. I thought it was a really great read. It’s really easy read. I think it’s really good to understand the day to day of how software works. So, I recommend it for that reason.

Federico:

Amazing. Do you have any other recommendation or you want to invite our audience to anything else?

Lewis:

So, I have a podcast as well, How to get started with contract testing. So take a listen to that on my website, it’s pactman.co.uk. Also, on there, I have a few blog articles linked to my courses, and all that good stuff.

Federico:

Amazing. I will share the links to all those resources in the episode’s notes. And I want to thank you so much for your time. It was amazing to have a conversation about different topics, some more technical, some more related to life in general, which is also a very important part of ourselves. So, thank you so much, Lewis, it was a pleasure.

Lewis:

Thank you so much for having me. I really enjoyed it.

Federico:

See you. Bye.

Lewis:

Cheers. Bye.

286 / 462

Leave a Reply

Required fields are marked