AI software development is changing software engineering forever, but most AI tools produce code that drifts, hallucinates, and needs constant rework. What if test-driven development, refactoring, and product engineering discipline could be baked into every AI-generated line of code? Michele Brissoni, Alessandro Di Gioia, and Marco Consolaro have a combined 60+ years of experience — from Ferrari Formula One to Fortune 500 DevOps transformations to writing the award-winning book on TDD. They built nWave to answer that question.
Chapters
Resources
- Link with all research material used to build nWave: https://drive.google.com/file/d/1yvSDNwj-F1amEavoX3Qz4oRZfw-9XKF9/view
Transcript
9,511 words
AI is such a polarizing topic when it comes to software engineering. Like on one side you have engineers who think AI is just writing garbage. You know, it's, it's trained on legacy code. There's no craftmanship there, no discipline. It is just auto complete on steroids and on the other side. You have engineers who are having so much fun with it, they feel empowered and they really think it's the future. But there's a third group of people that nobody's really talking about, and these are software practitioners who spent decades teaching software craftsmanship, and they looked at all the things AI can do and thought, what if we don't just let it freestyle?
What if we take everything we know about good practices from product management, from Agile, from software engineering, and we force the AI to follow the same processes we've been using successfully all along? that's exactly what today guests built. So What if AI could deliver code so clean, so well tested, that the rework just disappears. Hey everyone. Welcome to the Product Engineers podcast. This is Pep, your host. Today's guests have a combined 60 plus years of software engineering experience. They used all of it to build a framework that forced the AI to write code the way a senior craftsman would. We have.
Micha Brioni, who is the founder of BrickX Consulting and a fraction CTO for Fortune 500 companies. He cut his Steve in behavioral engineering at Ferrari Formula One during the s Shoemaker era, invented the software Craftsmanship Dojo and led a DevOps transformation at IBM across 15,000 people. He also hosts the Forge of Unicorns podcast where he run over 80 episodes with the people behind 52 unicorn companies. We also gonna hear from Marco Con and Alessandro Deia, who are two software craftmen technical coaches and co-founders of Alco Academy.
Together with Pedro Santos, they co-authored the book Agile Technical Practices Distilled um, multi over winning book on TDD Refactoring and software design. They've been teaching outside in development and software craftsmanship at conferences like N-D-C-D-D-D, Europe and DevOps days four years. Michaela Alessandro, Marco have been building together and nWave a, opinionated open source agent, coding assistant framework that infuses every line of ai, AI code with two decades of engineering discipline. Want to know more about it? Let's get into it.
Michele Brissoni Welcome to the podcast, Michele, Alessandro, Marco. it's great to have you here. I'm, I'm so happy that I have the opportunity to interview about nnWave today. So, before getting into the, you know, what is nnWave and how can help software engineers in the era of ai, question for you, Michele, 'cause I know you've been quite involved in the development of this tool. Could you maybe take me back to that specific moment where when you realized, that AI coding tools were kind of making, the industry a bit worse rather than better? And what, what were you looking at? What was broken? Okay, great question because we jumped back off, I guess something like seven years.
The first tools that we saw were saying commercially, they were bringing AI into the software development lifecycle were in 2019. And so we were starting to experimenting with, uh, top nine and kite and, uh, and that tools, we realized that something was, uh, on the edge to change in software development. The tools were still brno, were still not mature as they are now. If the meter of maturity could be today cloud code, they were really something that wasn't even ai in my opinion. It was more, uh, pattern recognition. So it was more data mining or patterning code base. were providing you some ins about a buddy you should change this code this style to that style.
This was the moment where we realized, Okay, AI is coming to software, and since then we have started to understand, okay, how AI and machine learning and will change software development forever. as we know in 2023 we got charge GPT and everything got, uh, hyperbolic speed Since then. today we are discussing here about nnWave uh, we have spent last year with Alessandro building it. But we will go into the nitty gritty details about nnWave later with you. But that was the moment. And, uh, at the beginning I tell you honestly, pepper, we weren't impressed at all about, uh, these tools. were far behind from the literature of, uh, proper craft and proper ture or clean code.
But still was a interesting moment because it was the pivot of the industry.
Peppe So you said you were not impressed by this new technology at the beginning, what was that moment that really, that started to make you think differently about this? They said, okay, now things are actually changing.
Michele Brissoni the beginning Only with A GPT because it was the unit tumor available because we felt that, uh, okay, we are even going in the wrong direction, so it is even less accurate. And so at the beginning we were really skeptic, aware that, uh, it was a moment because this was a disruptive event in the industry. And so we started to explore about this technology with open mind, with really research and development mindset.
We have tried to do a autopsy of how code was built with this LLM a point that as I wrote in some old articles on my newsletter with Ali, I took even the idea to start to measure the amount of swearing I was shouting to LMS because they were drifting every time we were trying to do something in the wrong direction. So that we have start to develop early in 2024, roughly a system that now we know everybody's call the compacting system. So every time the LLM was starting to drift, were extracting the context, cleaning from the dirt, reinjecting the context on new chat and starting from almost scratch. This is where with Olive we start to understand, okay.
It's not yet on the right direction, but then finally arrives Cloud Coda, a lot of competition with other providers from Dipe and all the other all the other Gemini, all the others that we have on the market. And then we start to see improvement at speed of almost weekly cadence until last year. we got all the technical infrastructure to build what is inside the nnWave, thanks to our genius invention from Alessandro. But I let him discuss about this.
Peppe So we're gonna get soon to how nnWave works. I know that you, you all have a lot of experience in the industry, like more than 20 years building software, when you started being building nnWave, is there, um, one specific lesson that from your career that you really wanted to bring into nnWave and nWave that, you know, something that you wouldn't, would never skip
Marco Consolaro it's interesting because it reconnects also with the question before, right? The bottleneck is always upstream, right? The business people blame the developers because they take forever. The developers blame the business people because requirements are unclear. And then we are stuck in this situ, this situation. So you know how you unblock. Well, of course, first we say, let's be humble. We are, can improve the way we go, right? And so let's make the first step, let's improve as a team show them that we are able to move on and be better. At that point, the bottleneck is clear back in the business side of things. And know, eh, the idea here is I Aand Aand.
We cannot do something just for code. We need to do something that helps the entire software development life cycle. Because if we don't resolve the bottom upstream. matter that the AI is a craft because if you give them bad requirements, you know it is a bad product with amazing code
Peppe okay, so I guess maybe it's time to get a bit more practical about, anyway, so let's see how it works in, into practice. And I will ask this question to Alessandro because, um, I know it's been, he's been the, one of the early adopters so for someone that you know is listening and never worked with nnWave, if you could walk me through what happens from the moment you have like an idea for a new feature so from this moment to the moment, it's, it's deployed to, to production. So, how does the, the whole process looks like I.
Alessandro Di Gioia so thank you for, uh, asking this question. It's, it's going to be almost like a virtual tutorial, but brace yourself. Okay. So the idea is like Marco and Mike, uh, mentioned, it doesn't matter how good you are implementing something, if it's useless. Okay. And so what matters and why it matters, it's crucial. And, uh, this is very related to the history of nnWave because one of the first agent and commands that are implemented is the research command and the researcher agent. Okay. It was the real first agent. And the reason is because, uh, AI hallucinates and, uh, publicly available, um, information is unreliable. So you have two sources of un reliability that you have to handle.
so my idea was to create a command, which basically it's an instructure for the main agent, the one you interact with directly to set a, a set of rules for what a good research looks like. how to choose your sources, how to balance what you find. Okay. so the researcher, it's, uh, an agent specializing in researches, the research command is the prompt, if you want, that the main agent, uh, use as a template to instruct the subagent on, uh, a proper research.
Then there's another command that is very important, which is the review nw Review all the, all of the commands and agents start with NW so that you don't have, uh, uh, conflicts with other, uh, commands and agents or, uh, skills that you have installed in your systems. And, uh, the review command, it's, uh, it's, uh, one of the other crucial, uh, tools that you have to master at the beginning, whatever you're doing. reason is because the AI, again, hallucinates.
And so it can, even if you write everywhere in its memory, in its, uh, code MD, if you're using code or anywhere that it should not say something that is not uh, um, uh, true back backed by fact, will do because of context drifting. Okay? In fact, we can think of the AI memory as a U-shaped, so it remembers the system prompt. So something that was embedded by Tropic, for example, and then the last things you said, the thing in the middle become less important, and on top of that, it loses attention. At the end of a document. And so if you say, okay, find me these patterns, it will trigger O more often at the top and less often at the bottom.
So these are all things that you have to take into account where you're dealing with ai because when they say it's non-deterministic, it's true, what are the effects of this non-determinism? And so
Peppe So
Alessandro Di Gioia it's a way to say, well, where you're finding, uh, a piece of information, don't stop there. Find also you can counter evidence. So that would balance whatever information it will find. And when you are applying the review, we call this adversarial review. Okay. I don't like, well. I don't like
Peppe I don't like.
Alessandro Di Gioia stuff, even though I like kung fu practicing Kung fu. I'm a martial artist like Michaela. But the idea is that, uh, this comes, uh, if you want from some research on behavior engineering by Mike, but also from our experience in dealing with teams when we are dealing with, uh, you know, lack of trust. Okay, so a, a good team, if you read, uh, particular journey, five dysfunction of the team, it's a team that can keep each other accountable. If you can keep each other accountable, that's when you can trust each other. If you trust each other, you have a healthy environment. If you have a healthy environment, there's a cascade, a good effect like can't, stress enough how important they are.
these are very humane, uh, activities are crucial to translate into the machine because the machine can scale these activities. And so the review, it's basically another expert as the agent you used. With the same background and knowledge but with no context. So there's no biases the previous research. And in the review command, the prompt is actually mentioning, actually you can call that explicitly if you want, make a candle review. like use this specific style of reviewing to basically tear apart whatever the other agent found out. many, many times he finds the facts in precisions. Even lies not that often, but sometimes it happens.
So why this matters because in this way you can drop drastically the inaccuracies. And we did this way, way, way before a white paper that just came out that proved that this is actually, uh, a good strategy. So empirically, but also humanely, we find out. Yeah. You know what? If you, if you have an expert as you are that comes and have a look at your code or your decisions, they're going to find things that you won't find. This happens this whether you're using AI or not, and so that's a humane good practice that we brought into the, the, the code. Now, why this matters, it matters because this is the first step. So we have different nWaves, okay?
If you want to, so why we are using these nWaves instead of phases, okay? Because the idea is that what we are doing is human-centric, okay? Since it's human-centric, there's a continuous moving back and forth of the interaction. That's why it's nWaves. So let's say that, as you say, uh, you were saying you want to introduce a new feature, and I can't stress enough how end nWave expects you to develop in cycles, small repeatable cycles, no big spec upfront of the whole project that never worked, and it will never work. Okay. Why? Because software changes and your perception of the software changes over time. I. I want to state this clearly. Okay?
So we are not spec driven, we are beyond that. Okay? We are feature driven. Actually, I like what Andre Forger, one of our friends, uh, that you, it's an early adopter and nWave, uh, suggested, which is expectation driven. Okay? So we have expectations. How do you get these expectations? Nothing new under the sky. First nWave is called discuss. Okay? Actually, if you're starting really from scratch, there's a first a zero nWave that, it's called discover, That's for the discovery phase. You know what the discovery phase is? You have to, to do, uh, research and, uh, interviews. That's where that nWaves can help you.
But let's think that, well, you just want to introduce a new feature in our software. Okay? So you start with the discuss nWave. In the discuss nWave, it's basically a brainstorming where you. Interact with the AI and start explaining what the new feature is all about and the ai, which, uh, with this, uh, command will trigger the agent. Product owner will ask you some questions, okay? About the scope of this, if it's, you know, UI facing, if's a, if it's, if it's a backend, if it's cross concern, all these kind of things. Why? Because there's also part of the, uh, lin ux, uh, embedded in the product owner.
this is a real contribution from Mike straightaway to introduce this attitude into the, um, discussion phase to find out what are, the things that you want to implement. And, uh, if you also require, for example, a jobs to be done analysis, it will derive what is the value, what is the pain point? are the, you know, the pushes, the pulls and the friction of a new feature? And you can do that also retroactively. Oh, let's have a, let's have a discuss about the features we implemented in the past without, in nWave and find out what are the problems they are solving or if the problems they're solving are actually still under underserved.
The other part of this discuss phase is that it shows the, the user a whole emotional journey. And so it will create a graphical ask representation of a graph of how a person interacting with the new feature will, uh, will feel. And so again, you can, you can still, you can already think that, oh, I'm using a AI tool, the person, the needs of this person are so central that the first phase start with what are we doing this for? For whom? Okay, everything, everything starts from this. Now, there are situations where you don't need this. If you are bug fixing something or if you are quickly an MVP. You don't have to go all the ways, but it's up to you which one you want to skip.
Marco Consolaro Yeah, I will say business people, product owners, business analyst. Have a look on nnWave because you might find something for you as well in there.
Peppe so be before getting to the next nWave. Um, so you were speaking about emotional journeys, which I suppose they require some knowledge from, like, on who is the user and you know, who they are, like the, maybe the typical user persona, let's say. How does this work in practice? So do they do, do this course requires you to, uh, give this information?
Alessandro Di Gioia I let Mike answer this one because I see him boiling and, uh, this is, uh, he, his, his little con, his contribution to, to this, uh, agent. So go Mike, unleash.
Michele Brissoni baby. Yeah. Thank you Ali. So the product owner, Luna, is designed to work user centric and uh, is designed to create the user persona. to have the maps of your users understand that which kind of needs they have to create a that is emotionally compliant to what they need to achieve. In the enterprise version that uh, we have improved with more agents that is even an agent Chatto, is creating even the user experience with the user UI together so that the graphic aspect and the emotional aspect exactly helping people to do what you're supposed to do.
As Ali say that during of the first nWave in nnWave, we put all the research we have done in the last two decades about behavioral engineering since I was working. Thank you to my brother understanding out the Ferra F1 team in there of Schumacher. were working on the field and what I discovered was that wasn't only engineering mastery, but was also behavioral science behind it. Beral Science that also is confirmed is the secret source of Fabian Lai in now taking over a dressing and motor gp. And so you see two fields that are maybe parallel.
So Formula oh one and Moto gp, very to one or two software, both of them they use, I was a very large amount of software behind the scene and all the electronic, all the aerodynamic, a lot of stuff is based on software, all the simulation. And observed them, I understood how they were working. I synthesized the that they were doing without probably even knowing that this was behavioral science. And I start to study it. Then with Alan Marco, we experimented them in the dojo to announce training. With behavioral science to get more information retaining for students, more gamification, more gratification.
And this went mixed together with Linux since it was released in 2012 to today, what we know is science print. So all this together went inside Luna and we released open source to create need for software to be user centric, to join finally together product and technical people so that they work as a tandem, not as a silos that I provide you and over of the requirement implemented with ai because this is not how it is supposed to be. And so we knew working since the expedites in the early 2000, having a product owner remain in the middle that can filter conversation is suboptimal. you should have the customer on side, it'll be a lot better.
So we have tried to create a infrastructure with and nWave that facilitate this that helps product people after people to work together with the customer. And this is what we have built inside the product owner agent in a way that now the agent will ask you a lot of questions. So the other day I was working with some staff with Ali and I told Ali, give me a second. I have 50 questions that I have to reply to the product owner.
Alessandro Di Gioia I just want to mention that uh, there is an aspect, uh, in the product, uh, owner when, uh, dealing with the cast phase that uh, would also recommend some KPIs and they are going to be crucial for one of the following nWaves because are going to be implemented as part of the feature so that you can actually automatically create the infrastructure to measure the impact the behavior of the users as expected. it's not only about describing the feature and understanding better what the user needs are, but also being able to evaluate and measure that, uh, the feature actually is delivering the value you expect.
Peppe Okay, so the prototype comes?
Alessandro Di Gioia Exactly.
Michele Brissoni Alessandro explained how the discuss nWave is about understanding what you're building and for whom. Before writing a single line of code, the AI acts as a product owner asking you questions, mapping the user's emotional journey, even suggesting KPIs to measure whether the future actually works. Now the next nWave is where all of this gets translated into architecture. Let's get into it.
Alessandro Di Gioia So this is a crucial step. The next one, uh, I, uh, I would say it's one of the, the ones that you should rarely skip, and it's the design phase. Okay. We call it design, but it's basically all about micro and, uh, macro, uh, design. So the architecture in the large, the architecture in the small, and this is really, really important because it's where we are start, uh, translating the human needs into, uh, software solution. So the architect will, will ask you some questions, especially at the beginning, when, if you're starting from scratch the style. Of the architecture that you want on the, on the paradigm that you want to apply.
So if you're working in object oriented software, it's different from functional programming. And this becomes a, uh, a driving force for the future implementations. And, um, it's able to understand not only, uh, the local architecture, but also, you know, cloud and distributed architecture. And you can even extend its knowledge. Let's say, if you want something that is really, really, really specific to, to, I dunno, Google Cloud instead of Azure, then you can basically unleash the researcher, gather about, uh, patterns and knowledge of Google Cloud, maybe taking inspiration from the existing knowledge on Azure, uh, ask the builder to create a new skill, uh, for that thing.
The idea is that the architect is going to be. Not a high tower architect. Okay? This is the kind of architect, which is just an aspect of a technical craftsman that is dealing, uh, with product delivery in a multicultural team. Okay? So the idea is that we want to make architecture matter, but uh, we want to try avoiding, you know, these roles. Everyone should be able to understand and talk about architecture, of course, with different level of competence. And so this architect, this architecture apart, it's where it asks you, okay, do you, do you want to start small or do you know already that we have to handle 10,000 requests per second, per node, anything like this?
Because it changes very, very much the approach. And the Google thing is that. You can, you know, over-engineer as much as you want, which is good and bad at the same time. Why? Because our recommendation is to create a, a modular architecture that can be scaled gradually over time. And the, the agents will help you in doing that, especially if you say, okay, um, we don't know yet, so let's start small, but let's put in place an architecture that will be able to scale eventually. And so maybe the solution architect, we say, okay, let's start with a modular monolith that eventually once we have more information, we can split into something that is partially monolithic and distributed. Okay?
Instead of starting straight away with a, uh, ecosystem of microservices. But if that's what you want or need. The agent, it's capable to, uh, give you these, uh, these recommendation. Of course, the agent will also produce quite a lot of, uh, documentation, which, which is not, you know, just to burn more tokens, I would say. Okay. So that documentation, it's actually a snapshot, uh, in time of what is our, your understanding of the needs for, uh, your product. the architect will produce, uh, many documents, the architecture design records together with the, you know, uh, diagrams for you. So the C four diagrams, it's embedded by default.
You're gonna find out that at every feature is going to try to, and in, uh, I would say extend the design you have with the new feature. quite some time, uh. Or reminding the architect to be able to, uh, try to avoid, uh, for example, reinventing the wheel. So it will, it will try to look for open sources, projects that can help us speeding up the development because they're already in place. Try to, uh, extend the existing design. So not rewriting the same codes, just slightly different. On the other hand, it's also your job make sure that this happens. my recommendation is, remember, it's nWaves. Don't take any outcome at face value and especially, don't take the first version as correct.
At least give it a review, possibly more than one. Continue refining until, uh, you feel confident that that's the right direction. If you it to interpretation, assume it will be misunderstood just as it would in any human interaction with the machine. It's kinda worrying because we have a tendency of underestimate what it can do, and I can tell you that it's very creative exploiting, um, gray areas so that it works less and can burn more tokens. Okay. So it's a super powerful tool, but you have to be, you have to understand that it's a tool that has drawbacks too. Okay. So my recommendation, which is embedded in the name, is it's a nWave. oscillates back and forth.
Michele Brissoni Let me add something here to what Ali was saying, pepper this phase is for us also very critical and indeed we have two agents that does the design because we have the architect, but we have also the platform engineer that applies all the SRA workbook from Google and all the DevOps knowledge to being able to understand after the discuss phase if the infrastructure for the design made up from the architect is congruent with the best practices of cloud native of observability. So the KPI that we were looking as. Product need to be translated into the infrastructure so that we can observe them. all this is a phase as you see that has two agents with two reviews.
And this is very important to make, especially at the commencement of the project when it's greenfield or when you get some legacy code to create the baseline from both perspective. Because this is the part that, uh, is, uh, the one with, uh, the greater majority of creativity because we don't have test yet in place. It's not code. And this is one part that with other, we have tested, uh, with many angle, having two agents that, uh, they fight each other was a good balance. This is indeed the the most delicate phase when you start a new project because you can put it in the Right.
direction or slightly curve in the wrong one, and then it'll you to understand in the future ops, I need to go back and do some work. And this is why it's so important to interview at least two times here.
Peppe Right. So just to follow the follow up to this how did you make sure that the output of this, two design agents is balanced between, what's useful for the agents of the future and the developers of the future?
Michele Brissoni So with Ali, got two stuff going on as experiments for. Multiple months, last years and was one, we need to stop what we call test theater. And this is something that we will discuss when we will, uh, check the phase of delivering the code. The second data was to create a sort of behavioral guard range of the agents so that they cannot cheat. The idea was we need to being able to rely on the agent with a variability of their behavior. the expectation as Andrea Fortune created this new trend of expectation so that we expect from the payer that is Ali, or the agents that they behave with a certain degree of variability. And so.
Test after test, we were able to narrowing the behavior into a variance that is acceptable. And now indeed, these agents, they are behaving as a normal human being. Of course, it's a virtual normal human being. That means their stochastic nature is creating some variance in the output. But the guard rate that we have put with behavioral engineering to frame them are so strict that they cannot that much of variance. to be more specific, we treat the agents with prompts that they're telling them you have to do all of this, and we have created them as solid. So with this of solid, so with single responsibility, they have only one reason to exist and they have to do this.
Then Ali created that, thanks to the cloud triggers. Uh, deterministic execution system that is called this, that is obliging the orchestration of the agents being specific to some patterns that we call it contracts. So we are applying contract testing in how we invoke and some of the agents. So we know that the input has to be compliant to a prompt that is as a contract. Then the work is frame of behavioral and then the output needs to be compliant with the document. is the memory of what the agent did. All this memory are the context of the agents for the next nWaves.
In this way, we have normalized input, behaviors and output, and all of this is under this, so it cannot be exploit from ai. And AI tried to exploit it many times. With Alec, we found interesting patterns to a point that, uh, Alec was able to say, Okay. let's do the audit of what they do So that we use the audit of the exploit improve the gut itself. so for months we have worked with the Ian Alpha and the desk with the audit help us to understand that which New Guard relay to put in place. But this is really something that I would love Ali to go into the details because he's, little Babb, so I put the Be Science, but he put all the brain and the fingers on the keyboard to build it.
So after discuss and design, you've got clear requirements, a solid architecture and reviewers that challenge every decision all before writing a single line of code. What comes next is where and nWave actually starts building software. By the way, if you're finding this episode valuable, um, I would invite you to subscribe to the channel or follow me on your podcast platform so you don't miss future episodes. Now, let's get into the delivery nWave.
Alessandro Di Gioia So before the de the delivery phase, there are a couple of phases that I recommend you to look into. One is the DevOps phase, which is the one that puts in place very quickly. Uh, the, the continuous integration pipeline for you if you need to local and remote quality gates. It's also the one responsible for creating and designing the infrastructure. For the KPIs. Okay. Together with the architect, we call this platform architect. they complement each other in the idea of, uh, uh, having a, a full, uh, full fledged system. Then there's the next nWave, which is very, very important. And it's becoming even more important now with the new releases of a nWave, which is the distill phase.
So the distill phase is the real moment where you are moving from the humane world. Okay? So all the design, all the requirements if you want, are being translated into code, how not, uh, by writing code straight away. So the distilled phase is the phase where the agent is instructed to write the acceptance test that are going to fail. Until, uh, someone implements the logic to make them pass. So this is known as the double loop of test driven development or the acceptance, test driven development, but with the flavor of London School. And so from the outside, it's the outside in test driven development kind of of test driven development.
Why this matters, it matters because the acceptance tests are going to be written by one agent and some other agents are going to make them pass. So no cheating. Those are the expectations we have. These acceptance tests are going to be reviewed by the previous agents, so you have the acceptance test designer, which would say it's basically what we call the, quality engineer. So the quality engineer. It's an expert in the domain that takes all the requirements as before and translates the requirements into executable tests. Okay.
Then the product owner, the solution architect, and the platform architect are going to review this acceptance test to say, Hmm, yes, You have the qualities that we expect from these tests. No, they're testing the behavior. They are not testing the details. They are respecting the design mandates and the scope and all that.
Peppe So before any code is written, and nWave has already set up the CICD pipeline, the observability infrastructure, and a full suite of acceptance tests, these tests are designed to fail until someone implements the actual logic. Think of it like building the finish line before running the race. The AI knows exactly what done looks like. Now comes the delivery nWave where the AI finally writes the code, and this is where all that upfront discipline really pays off.
Alessandro Di Gioia The deliver nWave. It's when the magic happens. Why? Because that's when we are producing software and our hope, our ambition is to automate the vast majority of this as much as you can. This way you can only, you can focus only on reviewing the final result very quickly because AI burnout, it's a problem. Now that it's cheaper to code, you are doing it more, not less. And that takes, uh, you know, it's taxing, uh, on, uh, mental health. So I'll let Mike discuss about this a bit later because this is an important topic that he's, uh, know, being, investigating also by Mar Marcos pushing others.
I think people, uh, you have to also take a break sometime, otherwise there's no, there's no next. So what happens? Uh, yeah. So what happens in, uh, in the deliver, uh, nWave? The deliver nWave, it's a prompt. Okay. That is loaded by the main agent to instruct the subagent how to do the work. How does this work? So there's going to be the architect that is write, it's about to write the. Roadmap. The roadmap. It's basically the execution plan. Okay? So it's a JSON file, an empty file. So this is for machine eyes. If you want thirst, it's a JSON file where by step there are, I would say, atomic implementation steps for the subagent. Why they are atomic, because of context drift.
And so the main agent is instructed to invoke one new instance of a subagent. For each new step. Each new step. It's a round of inner loop test driven development. What does it mean? It means that each step has an acceptance test that fails. The job of the agent is to write unit tests that failed first. Then make them pass so that when they pass the acceptance test pass, okay. And so basically have a verification from the outside that values the outcome. Okay? Something useful for the user happens internally. There's this agent that writes all the unit tests required make that behavior happen. this happens, it's committed, and then a new instance is created.
But as Marco and Mike were saying before, how many times, uh, how many hours did you spend swearing at the ai that even if you are writing in stone, oh, please, uh, uh, use the, write the the test first, then make them pass. Uh, don't write the whole code in one goal. Don't, uh, respect these principles and so on and so forth. Eventually always end up with, sorry. You are absolutely right. I made a mess. Let me fix it. Making it even worse, like is known as we know already very well context drifting. That's when the desk so the deterministic execution system comes into play.
So, deterministic execution system, it's a, it's a set of hooks that cloud code, uh, the user to, you know, into and they are, uh, triggered by some events, for example, when you are invoking the subagent. And so what, how does this work? Okay. It's not secret because it's open source, so I'm gonna say it out loud and easily. what happens is this, the main agent is invoking the subagent with a prompt. That prompt is the execute command. You can even invoke it yourself when, invoking the subagent, the prompt has to have a specific format. If it doesn't have that format, the hook stops the agent and say, this doesn't work because you're missing this, this, and this section.
basically it's fighting context, drifting, reminding the ai what is the right way to invoke the subagent. The subagent has no context because it's a new instance every time, and so this allows us to make sure that the subagent does a good job because know, the U shape, it's not even getting in there. Everything. It's at the beginning of that U shape, and so it's, it gets a lot of attention. why the roadmap has to have small, many steps. Each step is going to be implemented by a fresh instance of a new agent, okay? And we make sure that this new agent is invoked in the right way because we have a algorithmic software system that intercepts the call and fixes it.
Of course, there are other checks in place as well, especially for, uh, you know, performance and, uh, compliance right now that we are going to expand for the enterprise offering, which are out auditing, you know, the decisions, uh, that were taken and, uh, you know, the execution with, uh, which parameters and so on. In this way, we want to, uh. We want to allow the usage of this tool in highly regulated context. But the basic idea is that we instructed the crafters, the software crafters with all the knowledge that we accumulated over the decades. As, as you know, Marco, Michaela, have been teaching this stuff for years, okay?
I don't want to look arrogant, but we have been into situations where excellence was the difference and it still is whether you are using AI or not. And so basically, and nWave and especially the software crafters over and nWave the culmination of decades of on the field, knowing what works better and what doesn't work that well. You can disagree with us. That's absolutely fine. at this moment, the only thing that I've seen working better than writing all that automation myself is having an AI doing that for me. And that's exactly why in nWave exists.
And then at the end of the delivery phase, there is a massive review phase where at the end of the delivery of a feature, you will still have a review of all the work that has been done, a refactoring. So we put in place what we call refactoring priority premise, which is a concept that we came up with in our tojo, which is a, the usual refactorings we all know, but done in a certain order because following this order allows for deeper refactoring to be done more easily. For example, first remove repetition before introducing a new type. Otherwise, you have to introduce the type all over the place, which is doable for humans.
It's doable for machines, but it's wasteful and sometimes you can, uh, lose a spot. Same thing for ai. So modular, well written code, it's not only for humans, okay? After this, uh, it's going to be committed and that's when, for example, you can have a look. the code as produced, I wouldn't recommend to have a look at the code as produced on each of these steps of the roadmap, it's a too small portion and it's going to break the rhythm.
Instead, I would recommend to have a look at the code once the feature is deemed to be complete, so that you can have a better understanding of how many files have been written, how many tests, and have a better understanding of what's the big picture of that feature. Because if you're doing it too often and too small, you lose the bigger context. If you don't do it often enough, for example, at the end of the feature, then you lose contact. With the, with the code base, which is also not helpful. Instead, you need to maintain a balance keep yourself sane, but also understanding what's going on.
And then at the end of this, depending on your configuration, it will try to run a round of mutation tests on the file that have been changed. Why this matters? I always recommend having mutation tests active in different formats. if you are, if you're working, let's say with C so things are very quick, you can have the mutation test run at the end of each feature. But it's time consuming. So the other recommendation I give is to have a nightly diff mutation test, which basically takes, all the files have been changed today and during the night runs the mutation testing against them.
Even if it takes a couple of hours, you will wake up the next morning with the missing blind spots in your tests. Okay, and then there's the last part where it's running a quick retrospectives. Okay? So it's going to look backwards at the implementation and, uh, uh, find out what went well, what, what, what went better, went bad, and what went worse.
Peppe So that's the full and nWave loop. And nWave starts by understanding what to build and for whom. Then it designs the architecture. Then it writes the tests that define what done looks like, and only then the AI starts writing code in the small discipline steps with. Importantly, fresh context every time At the end, it also runs a refractory session, runs mutation tests to catch blind spots, and even does a retrospective on its own work. It's basically 20 years of software craftsmanship automated. Now, the obvious question is, doesn't all of this makes you a bit slower? Thank you very much guys for explaining uh, how in nWave works end to end. It.
It's, I can definitely say you put a lot of thought into it and, uh, it seems like a, like a gold mine of all your experience packed into this, uh, cloud plugin for now. Right. Um. Uh, it, it makes me think about something that my, uh, professor of, uh, software engineer told me at university when he was teaching us, uh, object oriented programming. Uh, that OOP, it's like, uh, it's like, uh, giving our ourself a kick in the balls because it kind of puts us, gives us discipline, right? Uh, from, uh, like procedural programming.
And it could be more time consuming because you need to design everything and, um, and nWave in, in the same way, seems like a way to, to provide discipline to how software is built. Um, so I can imagine someone in the audience, uh, can think, well, okay, now we have all these practices that are enforced into the, into N nWave and all these guardrails that you put in place. Right? And some developers may think AI was supposed to make me to make me faster, but now I have all these things in place that could slow me down. Uh, how would you respond to them?
Alessandro Di Gioia Okay, let me use a, a metaphor. A ai, okay. It's like a train. not building guardrails. I'm building railways. Okay? A
Peppe I.
Alessandro Di Gioia without railways. It is only, you know, digging holes faster standing in there. Right? So the, the, it's how is it going to make you faster? So it's slower than not doing these practices, but there's no work or almost no work in what you're producing, which is a massive, massive, uh, return on investment because you know that once it's implemented by the ai, you at most have to put 20% of the effort, basically means that the thing that we have been seeing is that you can deliver a feature in a matter of one or two days instead of one or two weeks, if this is still not good enough for you. I'm, I'm want to, I want to see what you can do what with your, uh, uh.
You know, practices, but, uh, the thing that I've seen is that you want to automate more and go faster, you have to create an environment where automation is possible. mean, even in the past, in the old mines, if, if you don't build the railways to bring the the cart outside, you have to do that manually. And you can have many people doing that or have less people, but you have to adapt, if you call it discipline, I dunno, to me it's like you have to create an environment where automation is possible.
Marco Consolaro I would add something on this, right? Because it's, uh, it's not only the speed of ai, right? Uh, yeah. Uh, we are, uh, moving from, uh, walking railroad. Right. So do we really, uh, need the bullet train where we don't know where we are going, we hope that it goes in the right direction, or, uh, we can say, okay, let's take a inner city, but we are sure that we are going exactly where we want. Right? Which one would you choose here? The problem is, uh, that, uh, the main, the single main, uh, thing that slow down is rework. Okay. is the problem. We need to eliminate rework. Even before the ai, the goal was to eliminate the rework. Why do we do tests? Because we want to trust our code.
That's what we think it does. We need to ensure the ity of our system somehow, otherwise we cannot trust it. And, uh, it's the big problem. So here we trade off, uh, AI that make us with a little bit more in hour test tasks, but that, eh, limit any work that you have to do after we go to production. uh, is the goal. The goal is to have a quality that allows us to don't have bugs and to trust what's uh, produced. And, uh, you know, uh, the goal is also to give the human being a way to. Pinpoint the problems. You open the code of, uh, a nWave is like, oh wow, must be a craft of this. It's so clear. So, eh, understandable. So maintain that you a open window on what is going on inside.
It's not something that, uh, it's impossible to understand. And I'm, uh, I'm happy to wait a few minutes more to have that kind of, uh, outcome. Right. We are talking minutes versus days.
Peppe right.
Michele Brissoni Also, there are a few other consideration per year with Ali and Marco. I took the part also of, uh, data engineering to check what we were doing against the latest research on academic field, and not only. What we have built with the agents, uh, is also how we work with a lot of design thinking. When we diverge and converge and we go in antagonistic, review by design, also what we build. And in M nWave we have put all the research that are out there.
Indeed, I have shared on the other meetup, uh, document with all the research will provide you with as well so that everybody can read the gigantic biography that we have with all the research on behavioral science the fact that people are telling us M nWave is slow. Okay. slow compared to what? Slow compared to white coding. Thank you. And uh, is white coding a long run faster? And, uh, we know that is not because as Mark and D said. White coding is degrading with drifting and the work that you accumulate is something that you cannot even complete because of the nature of white coding.
with M nWave, there is a sensation at the beginning that is lower, but this is one shot, bingo is done and then you move on. Also with AnnWave, what we have done with other, because I'm never diverse, I am effect of dys less year. So reading all the massive amount of text that AI is prompting me is destroy my brain at the end of the day. Am Marco more than once pointed out to me and the, Hey guys, you should stop to Slack during the weekend at 4:00 AM So go to sleep or go outside to have a party instead of working is not healthy. And uh, we start to measure about, uh, how much are we working with ai?
And we have discovered some effect of rewarding with dopamine that, uh, is us awake with the brain spinning so fast that we are even not able to sleep. So there are practices that we put in place, and I wrote some time ago an article about that. That is the self combustion, uh, effect with AI that we kept in mind to create them with. So nWave is designed to create a pace that is sustainable. So the back and forth between agents and human is designed to have a sustainable way of working with AI that you cannot achieve with vibe coding and that you can achieve maybe with other frameworks, but the other frameworks, they don't have guardrails to save your brain long run.
And we don't want to burn out anybody. And so because it's something that we have built for others and for ourself, we are trying to use ourself as the Guinea pig the alpha nWave of releasing the new releases of M nWave to understand that are we moving in the right direction? Because we believe in all the ethics that should be regulating the software development as a field where people, they can put their and talent on the field without getting self combusted of hyper speed of ai. this is the final touch also that we are put into the product that will release open source.
Peppe Okay. Um, yeah. So, so before wrapping up, I'd like to ask you maybe a fun question related to what you just, uh, said, Michael. Uh, what do you do while N nWave is working? 'cause you may have all these agents doing the work, it could be more or less low. So what do you do in the meanwhile?
Michele Brissoni So, as Ali told you, me and Ali, we are two passionate martial artist. I have more than 46 years of martial art on my shoulders. And, uh, between them we've, uh, is doing stuff. I'm reading, multitasking, and doing, um, around 500 per piece a day.
Alessandro Di Gioia Okay. No, well I, um, so it depends, it depends on the situation. So usually while Lead Waiver is working, I have an another three or four, uh, instances working as well on other projects, obviously. And, um, when I manage to take a break, be between these three projects running con concurrently, because, um, um, I would say context switching, it's less taxing. If you can detach a little bit yourself, then I'm also, you know, investing that time, maybe sketching quickly, doing some drawing. So something that can, can recharge me as I am overlooking three or four projects. So basically using In nWave, it's like you becoming a principal engineer.
For three, four different teams that are constantly working. One thing that you can start doing if you really want to be extremely productive, but be careful, as I mentioned before, is as the deliver nWave starts, you start the discuss for the next feature. This way, you create a full pipeline that, you know, uh, can bring forward, uh, features continuously. I don't recommend pushing this too much because it's your mental health at stake. Okay?
On the other hand, if if you have to pressure to push for, you know, an important delivery or a, a demo that is coming, uh, very, very quickly, very soon, then you can optimize, uh, letting the machine doing the delivery phase and have a review at the end you are already, you know, uh, discussing researching for the next feature.
Marco Consolaro I, do multitasking. I just do one at a time. So I probably more patient than Alex. I even let, uh, tool go in, uh, not the mood. I click yes every time he ask me permit for things. So I have to stay more focused because I tend to forget the task quickly. But, uh, recently I start to watch some video. Yesterday was, uh, watching a lesson by Russell Ako about thinking, understanding, and learning. So. That's what I do.
Peppe YouTube and agents, that's our future. Awesome, awesome. Yeah. So we are at the end of this episode. Um, thank you so much for having explained to, to us what is N nWave and our works. And so I personally invite, I want to try it because I think it's the, the quality of the output is quite cool. Um, and yeah, there is also a Discord community, right, that you can join if you want to ask for questions to, uh, to these guys. And, um, uh, also like share your experience. Um, yeah. Thank you very much for, for joining. Yeah.
Alessandro Di Gioia remember, remember it's a, it's an open source project and it's free to use. So if you can also contribute or give feedback. So I appreciate you find an issue and you want to open it on GitHub. I try to, you know, fix and solve as much as I can, as quickly as I can. So if, uh, if there's an improvement, uh, you can, you want to, uh, share with others, feel free to, you know, create a pool request and then I'll embed it
Peppe Yeah.
Alessandro Di Gioia main track and, uh, give you recognition for that.
Peppe Awesome.
Alessandro Di Gioia thank you so much Peppe. Thank you
Peppe yeah,
Alessandro Di Gioia me.
Peppe yeah. And make sure to put all the links to reach, reach out to you and to the GI repository on the descriptions so people know where to find them. Yep. Thanks again. Bye. Bye.
Michele Brissoni Thank you. Bye. Joe.
