To Mock or Not to Mock - That's the Question

Rate this content
Bookmark

To mock or not to mock, that is the question. Whether 'tis nobler for the code of the programmers to engage with spies and stubs in outrageous tests, or to take the real components against a sea of timeouts, and enduring, to validate their code: to commit, to push.

This talk has been presented at React Advanced Conference 2021, check out the latest edition of this React Conference.

FAQ

The SDC, or Software Development Center, is a facility established by Volkswagen in 2018 located in the middle of Lisbon, Portugal. It was the first software development center Volkswagen opened outside of Germany.

The SDC uses extreme programming, an agile framework that facilitates the production and delivery of high-quality software quickly. They also engage in practices like test-driven development and pair programming.

Teams at the SDC are balanced and composed of designers, product managers, and developers. Designers focus on user interaction, product managers translate user needs into actionable plans, and developers handle the technological feasibility of projects.

Atomic design is an approach to designing a coherent system through a hierarchy of components, from simple atoms to complex templates. At the SDC, atomic design is adapted to include atoms (simple components like buttons), molecules (combinations of atoms), and organisms (larger component groups), with custom adjustments to fit specific project needs.

The SDC has a basic library system consisting of two bookshelves, managed through a scratch pad where employees write down the book they take and scratch it off upon return. There are plans to modernize this system using technology solutions.

The SDC minimizes the need for traditional code reviews by using pair programming, where two developers work together on the same code at one workstation, continuously reviewing each other's work in real time.

Test-driven development (TDD) at the SDC involves writing tests before coding to guide development. The process helps ensure that the software functions as intended and facilitates immediate feedback and error correction.

Rita Castro
Rita Castro
25 min
25 Oct, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk discusses the SDC's approach to software development using agile methodologies and extreme programming. It highlights the benefits of pair programming and the use of atomic design in React components. The importance of test-driven development and the React testing library is emphasized, along with the implementation of code, navigation, and form validation using Formik and Yup. The talk also touches on the abstraction layers in software development and the testing of user journeys and accessibility in the BookKeeper app.

1. Introduction to SDC and Agile Development

Short description:

In this talk, we will try to answer the question of whether to mock or not to mock. I am Rita, a geek at heart, living in Lisbon and working at the SDC. The SDC is a software development center established in 2018. We develop products using extreme programming, an agile framework based on communication, simplicity, feedback, courage, and respect. We work in balanced teams, including designers, product managers, and developers. We do test-driven development.

♪ Hi, welcome to this talk. In it, we will try to answer a question, which is, to mock or not to mock? Let's get started.

My name is Rita. I am a geek at heart. I live in Lisbon with my beautiful family. My kid is almost three years old, so he's a bit of a fool plate. But whenever I'm not busying around my family, I'll probably be playing, or I will be at the SDC, the place where I work. I work with these amazing people. And at the moment, I'm part of Team Falcon, and things are slowly starting to get back to normal here at the office.

Where is the office? So, it's a software development center here in Lisbon, and it is right in the middle of the city. It was established in 2018. It was the first software development center that Volkswagen opened outside of Germany. And so far, things have been going very, very smoothly.

What do we do here? So, we develop products using extreme programming. In a nutshell, it is an agile framework that allows us to produce and to deliver high-quality software at a very fast pace with a good quality of life for us, the developers, or for the whole development team. It was created by Kent Beck in 1996. So, it's somewhat old, but the core values that it is based on, they still stand. So, communication, simplicity, feedback, courage, and respect. These five pillars, they are also engraved within the SDC spirit. So, it is a perfect match.

What else can I tell you about the SDC? So, we work in balanced teams, which means that a team is composed of designers, product managers, and us, developers. A team, let me put also some stress in this, a product team, because the team is bigger than just the product teams. The designers, what do they do? So, they keep tabs with the users. They explore, they do the research, they investigate possible avenues to solve the users' problems. The product managers, they will translate these user needs into stories, and they will also keep tabs with the business and see if a product is or isn't viable to be developed by the business point of view. And us, the developers, we will take care of the feasibility in terms of technology. We will be the ones responsible for seeing if something can be integrated with legacy systems, if something can be done using cutting edge technology. If it is technology, that's our realm. In the middle of these three very different roles, that's actually where the magic happens and where good products come to be.

So, what do we do and how do we do it? So, us developers, we do test-driven development.

2. Pair Programming Benefits

Short description:

In pair programming, two developers work together on the same code simultaneously. This practice allows for real-time code review and immediate problem-solving, eliminating roadblocks and fostering efficient collaboration.

Which means first we write some tests, we run the tests, we're expecting to see the tests fail. But the tests pass, the tests pass. No, they shouldn't be passing. Maybe there was a bug in the test, most likely. So, to minimize this type of situations, we also engage in pair programming. Which means that you always get two sets of eyes looking at the same code. We got one computer, two keyboards, two mice, two screens, and that's how we develop. There is no need for code reviews because the code is being reviewed live as you go. You don't get roadblocked because if you do get roadblocked there will be someone there with you. You will be able to express your thoughts, engage in a conversation very quick and efficiently, you'll be able to unblock the train of thought that you have. So it works really well, I have to admit. And I couldn't see myself doing it any other way around.