<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yunaz G. Ramadhan on Medium]]></title>
        <description><![CDATA[Stories by Yunaz G. Ramadhan on Medium]]></description>
        <link>https://medium.com/@yunaz.gilang?source=rss-da692aa6ec4b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*53xfxRYccRW9KEN51ObQuQ.png</url>
            <title>Stories by Yunaz G. Ramadhan on Medium</title>
            <link>https://medium.com/@yunaz.gilang?source=rss-da692aa6ec4b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 06:17:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yunaz.gilang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building ‘Base Steps’ in Automation Framework]]></title>
            <link>https://medium.com/bliblidotcom-techblog/building-base-steps-in-automation-framework-8500be87baa0?source=rss-da692aa6ec4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8500be87baa0</guid>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Yunaz G. Ramadhan]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 07:10:02 GMT</pubDate>
            <atom:updated>2026-04-10T07:10:02.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Laziness Led Me to Build ‘Base Steps’ in Our Automation Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQzgw1929y_gGtq3zfkmsw.png" /></figure><p>So, let me take you back to <strong>2019</strong>. First half of the year.</p><p>I was a <strong>junior QA at Blibli</strong>. I had been writing automation test scripts for more than six months at that point. And I started getting this… inexplicable feeling.</p><p><strong>Boredom.</strong></p><p>Now, don’t get me wrong. We already had a pretty solid automation framework. It worked. The tools were good. Everything was fine.</p><p>It’s just… the lazy side of me felt like writing automation scripts the “usual way” was kind of boring.</p><p>And here’s the thing — back then, <strong>AI wasn’t thriving like it is today</strong>. There was no Copilot. No ChatGPT. No Cursor. We had to write automation scripts <strong>manually</strong>.</p><p>Can you imagine that? Oh, the irony.</p><p>And by manually, I mean a slow, tedious, back-and-forth of typing and coding across multiple files.</p><h3>How We Used to Write Tests</h3><p>So let me give you some context.</p><p>We used <strong>Cucumber with Java</strong> as our automation framework. This was the era of <strong>BDD — Behavior Driven Development</strong>. The whole idea was to create fully human-readable reports from our automation scripts. Cucumber was famous, widely used, and we chose to use it too.</p><p>And honestly? It <em>is</em> pretty straightforward. Writing automation tests with Cucumber in the BDD way is not that hard.</p><p>Here’s what a typical test looks like:</p><pre>Feature: Member API</pre><pre>Scenario: Get member balance<br>  Given user prepares member id<br>  When user request member data<br>  Then member balance should be greater than 0</pre><p>Readable, right? Anyone can look at that and understand what’s going on.</p><p>But to make those few lines actually <em>work</em>, here’s what we had to do.</p><p><strong>First</strong>, create the .feature file — that&#39;s where you write the Feature, Scenario, and all the steps using Gherkin syntax.</p><p><strong>Second</strong>, write the steps themselves. They follow a simple pattern:</p><ul><li><strong>Given</strong> — set something up</li><li><strong>When</strong> — do something</li><li><strong>Then</strong> — check the result</li></ul><p><strong>Third</strong>, implement the step definitions. These are just Java classes that hold Cucumber annotations matching the steps in the feature file. Pretty straightforward if you think about it — this step connects to this method, that step connects to that method, and so on.</p><pre>@When(&quot;user request member data&quot;)<br>public void requestMemberData() {<br>    memberController.getMember();<br>}</pre><p><strong>Fourth</strong>, write the actual implementation of the logic. And this is where things branch out.</p><p>If you’re writing an <strong>API test</strong>, you need to create a Controller class, an interceptor class for building common request specs, a data class to hold data and retrieve it later for validation.</p><p>If you’re writing a <strong>UI test</strong>, you need to create a Page Object class — following the Page Object pattern — and handle all the interactions and validations with the web elements.</p><h3>The Problem</h3><p>Now, after writing test scripts for a while… you start to notice something.</p><p>It all feels <strong>repetitive</strong>.</p><p>That’s exactly what I was feeling back then.</p><p>And I can tell you — I’d estimate <strong>more than 60%</strong> of the Java code we wrote looked similar. Or at least <em>felt</em> similar.</p><p>Let me give you some real examples.</p><p><strong>You keep repeating the same code to prepare data.</strong> Say you want to prepare data A, B, and C from the feature file. You either create three separate steps and store the data from each one. Or you create one step and cram complex logic inside it.</p><p><strong>You keep repeating the same code just to open a web page.</strong> Want to open three different links? Three different steps. Or, again, one step with complex logic.</p><p><strong>You keep repeating similar code to validate things.</strong> Our approach was usually: do a thing, then validate. But after a while, you realize the things you’re validating are actually pretty similar. You see element A. You see element A contains text B. And so on.</p><h3>The Lazy Idea</h3><p>So one day, the lazy me had what I thought was an amazing idea.</p><p><em>Why should I write this step again? Why can’t I just reuse an existing step?</em></p><p>If you think about it, you can take all step definitions and group them into three categories:</p><ul><li><strong>Preparation</strong> (Given)</li><li><strong>Action</strong> (When)</li><li><strong>Validation</strong> (Then)</li></ul><p>So my idea was simple:</p><blockquote><em>What if there was a </em><strong><em>generic step</em></strong><em> that could handle all of my conditions — to prepare, to act, and to validate — dynamically, within our framework?</em></blockquote><p>Well… you know where this is going.</p><p>I started researching a viable implementation for that generic step. I called it the <strong>“Base Step”</strong>.</p><h3>The Irony</h3><p>Now here’s the funny part.</p><p>I started this whole thing because I was <strong>lazy</strong>. But I ended up forcing myself to do <strong>way more work</strong> than before.</p><p>Ironic, right?</p><p>But honestly? That’s what freed me from my boredom. Researching, trying to solve a complex problem — that’s what keeps my blood boiling. You know that ecstatic feeling when you solve some mystery? When something finally clicks? That’s exactly what it felt like.</p><p>So I used all my curiosity — and my stubbornness — as fuel.</p><h3>Hitting the Walls</h3><p>But here’s the thing. As motivated as I was… I was still a junior.</p><p>And there was no AI to help me.</p><p>So I hit a wall pretty quickly. Actually, not just one wall. <strong>Multiple walls.</strong></p><p>You see, <strong>Gherkin is logic-less by design</strong>. It’s meant to be simple text. But for what I wanted to achieve, I needed it to understand complex, dynamic syntax. I needed something that could transform a stupid, straightforward string into a logical process.</p><p>And we also needed to make it <strong>extendable</strong> — so it would feel more like a framework and less like just a utility tool.</p><h3>Building the Foundation</h3><p>So here we go. Let me walk you through the long journey of implementing Base Steps.</p><h3>DataHolder</h3><p>The first thing I built was a <strong>DataHolder</strong> pattern.</p><p>The goal? Have an instance that can scan all data in our project, and access or modify it by matching field names or JSON paths.</p><p>Something like this:</p><pre>class A {<br>  private String someFieldName;<br>}</pre><pre>class B {<br>  private A param;<br>}</pre><p>And then you can just call:</p><pre>dataHolder.get(&quot;$.param.someFieldName&quot;);</pre><p>That’s it. Dynamic data access across steps — no hardcoding.</p><h3>Command Logic</h3><p>Next, I created a <strong>CommandLogic</strong> pattern.</p><p>This enabled us to write dynamic commands directly in the feature file. Something like:</p><pre>And user prepare request data id with value &quot;uuid()&quot;</pre><p>The framework scans all registered command logic, matches the input string to the right command, and executes it to get the actual result. If no command is found, it just falls back to using the raw input.</p><p>We had things like uuid(), timestamp(), timetravel(1,YEAR) — small, but incredibly useful.</p><p>It is also easy to add new command logic on client side. Just create a java class and follow the command logic pattern, then the command executor will automatically pick it up. So, you can have any customized command like mycustom_command(a parameter)</p><h3>Validation Logic</h3><p>Then came <strong>ValidationLogic</strong>.</p><p>This enabled us to write complex validations directly in the feature file using data tables:</p><pre>And user do these validations<br>| actual                               | validation   | expected            |<br>| response($.memberData.value)         | NOT_EMPTY    | true                |<br>| response($.memberData.value._id)     | EQUAL        | request($.memberId) |<br>| response($.memberData.value.balance) | GREATER_THAN | 0                   |</pre><p>The framework transforms that data table into a list of validations, maps each one to its logic, and do soft assertion on them. If no matching validation is found, it throws an exception.</p><p>One step. Many checks.</p><p>Again, it is easy to create custom validation logic. Just a java class and implement the validation logic pattern. Then you can have it directly from the .feature file :</p><pre>And user do these validations<br>| actual                               | validation           | expected            |<br>| response($.memberData.value)         | CUSTOM_VALIDATION    | true                |</pre><h3>Data Transformer</h3><p>I also built a custom <strong>TransformerService</strong> — a converter that transforms Cucumber data tables into the objects our framework needs. This also plugs into CommandLogic, so dynamic commands work inside tables too.</p><h3>Page Finder</h3><p>For UI testing, I created a <strong>PageFinder</strong> pattern.</p><p>The idea is to populate all page objects and their fields, so you can access or interact with the page through its page name, or interact with web elements through the field name — or even a human-readable version of it.</p><p>So you have something like:</p><pre>class PageA {<br>  private By searchInput = By.id(&quot;search-input&quot;);<br>}</pre><p>And in the feature file, you just write:</p><pre>When user open page &quot;blibli&quot;<br>And user type value &quot;term&quot; into &quot;search input&quot;</pre><p>The framework figures out the rest.</p><h3>Actor Manager</h3><p>And finally, an <strong>ActorManager</strong> pattern — a hybrid approach mixing the Screenplay pattern with the Page Object pattern. This manages the active driver and handles all sorts of web element interactions during test execution.</p><p>That’s basically the barebone foundation we needed. There’s actually more under the hood, but I won’t go into all the details today.</p><h3>The Base Steps</h3><p>After we laid the foundation, the next step was to build the interiors and decorations — by that I mean, providing the predefined <strong>Base Steps</strong> themselves.</p><ul><li><strong>WebBaseSteps</strong> — for browser and UI tests</li><li><strong>ApiBaseSteps</strong> — for API tests</li><li><strong>KafkaBaseSteps</strong> — for message queue tests</li><li><strong>DatabaseBaseSteps</strong> — for database validations</li></ul><p>And so on.</p><h3>The Result</h3><p>At the end of the day… <strong>we did it.</strong></p><p>We had our own Base Steps system. I used it all the time. Writing automation scripts became so much easier and so much faster.</p><p>The lazy idea actually worked.</p><h3>Traditional</h3><pre>src/<br>├── main/java/.../<br>│   ├── api/controllers/           # controller classes<br>│   ├── data/                      # many data holder classes<br>│   ├── properties/<br>│   └── utils/<br>└── test/<br>    ├── java/.../steps/            # per feature step definition classes<br>    └── resources/<br>        └── features/              # feature files</pre><h3>With base-steps</h3><pre>src/<br>├── main/java/.../<br>│   ├── data/                      # 2 data classes (request + response)<br>│   ├── properties/<br>│   └── utils/<br>└── test/<br>    ├── java/.../steps/            # optional custom step definition classes<br>    └── resources/<br>        └── features/              # feature files</pre><h3>Effort Comparison</h3><p><strong>Where Tester Time Goes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2ws2cN-3YRRopvQLy3rUA.png" /></figure><p>By abstracting the repetitive prepare-call-validate pattern into a shared framework, base-steps <strong>eliminates ~70% of the boilerplate Java code</strong> and frees testers to focus on what actually matters</p><p>The result is not just fewer files — it is a <strong>shift in the nature of the work itself</strong>. Testers stop being boilerplate typists and start being quality engineers. They spend their energy where it creates the most value: thinking deeply about business logic, mapping out boundary conditions, and crafting scenarios that reflect how real users interact with the system.</p><h3>But…</h3><p>Later on, this solution did bring some drawbacks.</p><p>But maybe we’ll talk about that another time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8500be87baa0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bliblidotcom-techblog/building-base-steps-in-automation-framework-8500be87baa0">Building ‘Base Steps’ in Automation Framework</a> was originally published in <a href="https://medium.com/bliblidotcom-techblog">Blibli.com Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Parallelism Cut Down 2 hours into 2 minutes]]></title>
            <link>https://medium.com/bliblidotcom-techblog/how-parallelism-cut-down-2-hours-into-2-minutes-fd2133b4bd8e?source=rss-da692aa6ec4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd2133b4bd8e</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[parallelism]]></category>
            <category><![CDATA[testlink]]></category>
            <dc:creator><![CDATA[Yunaz G. Ramadhan]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 07:09:37 GMT</pubDate>
            <atom:updated>2026-04-10T07:09:37.944Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A fellow engineer’s complaint about a slow Testlink plugin sparked a deep dive into XML-RPC, parallelism, and the importance of revisiting what we build.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78TtkNsrDgNYOk-tyMdTzw.png" /></figure><p>Let me take you back to <strong>2020</strong>.</p><p>I was at the office, chit-chatting with the QA R&amp;D team at <strong>Blibli</strong>, when suddenly a fellow engineer walked in and started complaining.</p><p>He said that the <strong>Testlink plugin</strong> in our automation framework was <em>awfully slow</em>. His team’s automation pipeline took almost <strong>2 hours</strong> just to complete. He also pointed out that the plugin ran everything sequentially — and suggested that maybe we could implement some parallelism there.</p><p>Now, pardon me, but I was right there. And I couldn’t resist overhearing my fellow engineer’s problem.</p><p>In my mind: <em>“This is quite interesting.”</em></p><h3>Some Context</h3><p>For those of you who haven’t heard of it — <a href="https://testlink.org/">Testlink</a> is an open-source test case management system. At Blibli, we used Testlink to manage our test cases. And we had built our own <strong>Maven plugin</strong> to integrate our automation framework with it.</p><p>The plugin was stable. Everyone on the team used it. No one had ever complained before.</p><p>Except this fellow engineer.</p><h3>Down the Rabbit Hole</h3><p>On the way back home that day, I couldn’t stop thinking about it. Sure, I had used the plugin myself all this time. But I had <strong>almost zero knowledge</strong> about what it actually did under the hood.</p><p>That intrigued me.</p><p>So I searched for the plugin in our internal repository. Found it.</p><blockquote>Aha.. there you are. Let me take a closer look at you, if you don’t mind.</blockquote><p>I cloned it locally, and started digging through the codebase.</p><p>This was pretty challenging. I had to trace the flow step by step — how the plugin integrates with Testlink, how it writes automation scenarios as test cases. There was no AI to help me. No Copilot. No ChatGPT. So I did what any rookie programmer would do.</p><p><strong>Googling.</strong></p><p>I figured there would be some hints out there. After all, Testlink is a widely used open-source tool. I eventually ended up reading the Testlink API specification.</p><p>And here’s the thing — Testlink is built on top of <strong>PHP</strong>, and it uses <strong>XML-RPC</strong> rather than REST. That too was something new to me. So I had to learn a bit about that as well.</p><h3>I See What You Did Here</h3><p>After enough digging, I went back to the plugin with fresh eyes. Everything seemed normal at a glance.</p><p>But then I found something.</p><blockquote>I see what you did here…</blockquote><p>The plugin basically did this:</p><ol><li>Establish a valid connection to Testlink with an API key</li><li>Parse the Cucumber report file</li><li>Iterate through the Cucumber scenarios</li><li><strong>For each scenario</strong>, check against Testlink whether it’s new or existing</li><li>Update or insert the scenario as a test case</li><li>Add the execution result to that test case</li></ol><p>Yup. <strong>Sequentially.</strong> My fellow engineer was right.</p><p>For this kind of flow, there’s no reason it needs to run one by one. We can safely write test cases in parallel.</p><p>I also cloned the automation repository he was referring to. It had around <strong>480 scenarios</strong>. When I ran it locally — sure enough — the plugin took almost <strong>2 hours</strong> to complete.</p><p>Here’s the irony: the automation itself finished in under <strong>10 minutes</strong>. But the plugin to <em>report</em> the results to Testlink? That took <strong>over an hour</strong>.</p><h3>The Fix</h3><p>I thought — I can improve this.</p><p>So I changed the flow. You see, the bottleneck was checking each scenario one by one against Testlink to see if it already exists. That’s an API call per scenario. With XML-RPC. Over the network. <strong>480 times.</strong></p><p>Instead, I restructured the logic:</p><ol><li>Establish a valid connection to Testlink with an API key</li><li>Parse the Cucumber report file</li><li><strong>Populate all existing test cases from Testlink once</strong> — a single bulk fetch</li><li>Iterate through the Cucumber scenarios <strong>in parallel</strong></li><li>Programmatically determine whether each scenario is new or existing — locally, no network call</li><li>Update or insert the scenario as a test case</li><li>Add the execution result to that test case</li></ol><p>Two key changes: <strong>bulk fetch</strong> upfront, then <strong>parallel execution</strong> for the writes.</p><h3>The Result</h3><p>I ran the same automation again — 480 test cases.</p><p>Previous version: <strong>~6,900 seconds</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/0*VX0n0ETbRekqZZ3E.png" /></figure><p>New version: <strong>~120 seconds</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*1gFfUbx1OH1iSswK.png" /></figure><p>From nearly 2 hours to just 2 minutes.</p><p>I pushed the changes and informed the QA R&amp;D team. They reviewed it, released it, and everyone updated the plugin.</p><p><strong>Exponentially faster. Everyone happy.</strong></p><p>What a gain.</p><h3>The Takeaway</h3><p>Now, I didn’t write this to tell you to slap parallelism on everything. That’s not the point.</p><p>What I want to stress is this — as engineers, it’s important to <strong>revisit what we build</strong> and understand the full flow. Yes, our code might run well initially. But over time, when there’s more data, more variables, more scale — how well will it hold up?</p><p>That’s sometimes what we overlook.</p><p>The plugin worked fine for years. Nobody questioned it. Until someone had 480 test cases and suddenly it became a <strong>2-hour bottleneck</strong>.</p><p>The code didn’t change. The data did.</p><p>So every now and then, take a step back. Look at your tools. Look at your pipelines. Understand the flow. Because sometimes the biggest improvements come not from building something new — but from <strong>looking closer at what’s already there</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd2133b4bd8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bliblidotcom-techblog/how-parallelism-cut-down-2-hours-into-2-minutes-fd2133b4bd8e">How Parallelism Cut Down 2 hours into 2 minutes</a> was originally published in <a href="https://medium.com/bliblidotcom-techblog">Blibli.com Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[mitmproxy-grid: The Customized Proxy for Your Automation]]></title>
            <link>https://medium.com/bliblidotcom-techblog/mitmproxy-grid-the-customized-proxy-for-your-automation-24f4d20da2c7?source=rss-da692aa6ec4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/24f4d20da2c7</guid>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Yunaz G. Ramadhan]]></dc:creator>
            <pubDate>Thu, 12 Mar 2026 05:53:25 GMT</pubDate>
            <atom:updated>2026-03-12T05:53:25.622Z</atom:updated>
            <content:encoded><![CDATA[<h3>How a curiosity and the help of AI over the weekend led me to build and integrate mitmproxy-grid.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C7XBmfQMoZZWI58p7o7daQ.png" /></figure><p>Alright, let me introduce you to <a href="https://github.com/mitmproxy/mitmproxy">mitmproxy</a> — the successor of <a href="https://github.com/browserup/browserup-proxy">BrowserUp Proxy</a>.</p><p>Now, if you’re a software tester, you’ve probably come across proxies before. In our case, we use a proxy to <strong>intercept network traffic</strong> before it reaches the automated browser. This is incredibly useful. You can grab HAR files, intercept and filter network requests, capture tracker data — all kinds of things.</p><p>At <strong>Blibli</strong>, our automation framework has been using BrowserUp Proxy for a while. We had a standalone BrowserUp Proxy server that our automation tests could plug into.</p><p>And don’t get me wrong — BrowserUp was nice. Solid Java SDK. Supported both embedded and standalone modes, which was great for running tests locally.</p><p>But here’s the problem.</p><p><strong>The project is no longer maintained.</strong></p><p>It’s like driving an old car that’s no longer manufactured — and there’s no workshop left that can fix it.</p><p>BrowserUp has been <strong>archived</strong>. The creator themselves suggested migrating to mitmproxy. And mitmproxy has been around for quite some time. It’s actively maintained, well-documented, battle-tested.</p><p>But we just… never switched.</p><h3>Why We Didn’t Switch</h3><p>I get it. The main reason is simple.</p><p><strong>mitmproxy is built on Python.</strong> And there’s no official Java client SDK — at least not one that I’m aware of.</p><p>So the team’s stance was: “BrowserUp still works. Why bother?”</p><p>But I beg to differ.</p><p>I wanted to convince my colleagues that mitmproxy was the way forward.</p><p>Well… not <em>me</em> exactly.</p><p>I was going to let <strong>Cursor</strong> change our minds.</p><h3>A Weekend Experiment</h3><p>So here’s what happened. I had a free weekend recently — not that I’m always busy on weekends, but this time I had some genuine extra free time. And I thought to myself:</p><p><em>“Why don’t I open up Cursor and poke around this mitmproxy thing? Just to kill time… if you know what I mean.”</em></p><p>The conversation went something like this:</p><blockquote><strong><em>Me:</em></strong><em> Hi Cursor, I want you to install mitmproxy — actually, wait. Put it in Docker. Make it a docker-compose setup. And make it suitable for a lazy person like me, so I can start and stop it with two or three words.</em></blockquote><blockquote><strong><em>Cursor:</em></strong><em> Got it.</em></blockquote><blockquote><strong><em>Me:</em></strong><em> But here’s the thing. mitmproxy uses Python, and I don’t talk to snakes anymore. I want a Java client SDK. ASAP.</em></blockquote><blockquote><strong><em>Cursor:</em></strong><em> Say no more.</em></blockquote><p>That’s obviously not the actual prompt I used — but you get the gist.</p><p>After a weekend of back-and-forth prompting with my AI buddy, I had a <strong>final, testable product</strong>: a customized mitmproxy-grid with a Java client SDK.</p><h3>What I Built</h3><p>Let me walk you through the pieces.</p><p><strong>1. mitmproxy-grid</strong> — A customized mitmproxy running on Docker, complete with a dashboard UI to manage sessions and rules. It also exposes an OpenAPI specification.</p><p><strong>2. Java client SDK</strong> — An implementation generated from the mitmproxy-grid API spec. It lets you start sessions, extend sessions, create rules, delete rules, stop sessions — all from Java.</p><p><strong>3. Rules</strong> — Network interception rules that are configurable and unique per session. You can filter, throttle, modify requests, modify responses — whatever you need.</p><p><strong>4. Integration</strong> — Write automation scripts that use the client SDK to orchestrate the interception during test execution.</p><p>The result? A fully functional dashboard for monitoring the mitmproxy-grid:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*qROTNISmr0nxG-I8.jpg" /></figure><p>mitmproxy-grid dashboard : <a href="https://www.youtube.com/watch?v=QZejbp7mxV0">https://www.youtube.com/watch?v=QZejbp7mxV0</a></p><h3>Demo 1: Replace an API Response</h3><p>Let’s test a simple use case. We’ll <strong>replace the entire response body</strong> of a REST API call.</p><p>The scenario: hit the Blibli search API with a nonsense query that returns no results, then use a proxy rule to swap the response with valid data — and watch the page suddenly show products.</p><pre>@Proxy<br>Scenario: Intercept and change response from non-existing search result api<br>  Given Yunaz using chrome in desktop with mitmproxy proxy<br>  When he disable proxy cache<br>  And he open &quot;blibli&quot; page<br>  Then he is in &quot;blibli&quot; page<br>  When he enter value &quot;non-existing-product-query-shouldnot-return-result&quot; on &quot;search input field&quot;<br>  And he click the &quot;search button&quot;<br>  And he wait until &quot;search info no result&quot; is visible<br>  Then he see that<br>    | actual                        | validation    | expectation         |<br>    | textof(search info no result) | CONTAINS_TEXT | Produknya belum ada |<br>  When he create proxy rule from &quot;blibli/change search result&quot;<br>  And he refresh page<br>  And he click the &quot;close location permission prompt&quot;<br>  And he wait until &quot;search result products&quot; is visible<br>  Then he see that<br>    | actual                                  | validation   | expectation |<br>    | sizeof(findall(search result products)) | GREATER_THAN | 1           |</pre><p>The blibli/change search result is just a JSON file containing the rule:</p><pre>{<br>  &quot;enabled&quot;: true,<br>  &quot;match&quot;: {<br>    &quot;method&quot;: &quot;GET&quot;,<br>    &quot;urlContains&quot;: &quot;https://www.blibli.com/backend/search/products?searchTerm=&quot;,<br>    &quot;responseContentType&quot;: &quot;application/json&quot;<br>  },<br>  &quot;action&quot;: {<br>    &quot;modifyResponse&quot;: {<br>      &quot;statusCode&quot;: 200,<br>      &quot;headers&quot;: {<br>        &quot;set&quot;: {<br>          &quot;Content-Type&quot;: &quot;application/json&quot;<br>        }<br>      },<br>      &quot;body&quot;: {<br>        &quot;code&quot;: 200,<br>        &quot;status&quot;: &quot;OK&quot;,<br>        &quot;data&quot;: &quot;&lt;omitted&gt;&quot;<br>      }<br>    }<br>  }<br>}</pre><p>And here it is in action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*l37Z7W_1hxW66-2g.jpg" /></figure><p>Replace REST API response : <a href="https://www.youtube.com/watch?v=-k2wp5TtlIE">https://www.youtube.com/watch?v=-k2wp5TtlIE</a></p><h3>Demo 2: Replace Images on a Website</h3><p>Now let’s do something a bit sillier. We’ll <strong>intercept image requests</strong> and replace them with our own local image.</p><p>The scenario: open a GitHub profile, then swap out the avatar image with whatever we want.</p><pre>@Proxy<br>Scenario: Intercept and change github user profile picture<br>  Given Yunaz using chrome in desktop with mitmproxy proxy<br>  When he disable proxy cache<br>  And he open &quot;github&quot; page<br>  Then he is in &quot;github&quot; page<br>  And he click the &quot;search bar&quot;<br>  And he enter value &quot;user:ygrip&quot; on &quot;input search field&quot;<br>  And he wait until &quot;profile card&quot; is visible<br>  Then he see that<br>    | actual               | validation    | expectation           |<br>    | textof(profile card) | CONTAINS_TEXT | Yunaz Gilang Ramadhan |<br>  When he create proxy rule from &quot;github/change profile picture&quot;<br>  And he refresh page<br>  And he wait until &quot;profile card&quot; is visible<br>  Then he see that<br>    | actual               | validation    | expectation           |<br>    | textof(profile card) | CONTAINS_TEXT | Yunaz Gilang Ramadhan |</pre><p>The github/change profile picture rule intercepts avatar URLs and replaces the response body with a local image:</p><pre>{<br>  &quot;enabled&quot;: true,<br>  &quot;match&quot;: {<br>    &quot;method&quot;: &quot;GET&quot;,<br>    &quot;urlContains&quot;: &quot;avatars.githubusercontent.com&quot;,<br>    &quot;responseContentType&quot;: &quot;image/&quot;<br>  },<br>  &quot;action&quot;: {<br>    &quot;modifyResponse&quot;: {<br>      &quot;statusCode&quot;: 200,<br>      &quot;headers&quot;: {<br>        &quot;set&quot;: { &quot;Content-Type&quot;: &quot;image/png&quot; }<br>      }<br>    }<br>  },<br>  &quot;responseBodyFile&quot;: &quot;github/images/replacement-avatar.png&quot;<br>}</pre><p>Here’s the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*ZuWXzWdnwJ1soKpA.jpg" /></figure><p>Replace image of a website : <a href="https://www.youtube.com/watch?v=RfHrZpKVzSA">https://www.youtube.com/watch?v=RfHrZpKVzSA</a></p><h3>Why This Matters</h3><p>From these two examples alone, you can see that mitmproxy is a <strong>viable and very powerful</strong> proxy utility for test automation.</p><p>So what can we actually gain from this?</p><ul><li><strong>Avoid flaky tests</strong> by using intercepted, predictable data instead of relying on live backends.</li><li><strong>Test negative flows easily</strong> by intercepting responses and returning whatever error you need.</li><li><strong>Test edge cases</strong> like invalid images, unexpected content types, or unusual payload sizes.</li><li>And honestly — the list goes on.</li></ul><h3>Closing Thoughts</h3><p>All of this came from a lazy weekend, a cup of curiosity, and an AI coding assistant.</p><p>The old proxy is dead. The new one is better. And with the right tools, the migration doesn’t have to be painful.</p><p>If you’re still hanging on to BrowserUp — or any archived dependency for that matter — maybe it’s time to open up your IDE and just… start poking around. You might be surprised how far a weekend can take you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24f4d20da2c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bliblidotcom-techblog/mitmproxy-grid-the-customized-proxy-for-your-automation-24f4d20da2c7">mitmproxy-grid: The Customized Proxy for Your Automation</a> was originally published in <a href="https://medium.com/bliblidotcom-techblog">Blibli.com Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviving Ideas with Cursor: Custom Cucumber JUnit 5]]></title>
            <link>https://medium.com/bliblidotcom-techblog/reviving-ideas-with-cursor-custom-cucumber-junit-5-ebd29472d2dd?source=rss-da692aa6ec4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebd29472d2dd</guid>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[junit]]></category>
            <dc:creator><![CDATA[Yunaz G. Ramadhan]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 11:38:49 GMT</pubDate>
            <atom:updated>2025-07-11T11:38:49.902Z</atom:updated>
            <content:encoded><![CDATA[<h4>How AI Helped Me Build Smarter Test Execution and Benchmark a Customized JUnit5 Engine</h4><p>I didn’t expect a casual chat with a colleague to reignite an old project I had quietly given up on. He mentioned using <a href="https://cursor.com/?from=home"><strong>Cursor</strong></a> to boost his test automation productivity. I was intrigued.</p><p>Sure, I’d used AI before — for fun tasks like naming a baby, answering trivia, or generating images. But using AI for actual engineering? I hadn’t crossed that line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAK985w9xuy02D74E3s91A.png" /></figure><p>Until I did try <a href="https://cursor.com/?from=home">Cursor</a> and <a href="https://www.anthropic.com/claude/sonnet">Claude</a>.</p><h3>The Problem: Why Standard Cucumber-JUnit5 Didn’t Cut It</h3><p>At <a href="https://www.blibli.com/"><strong>Blibli</strong></a>, we rely on an internal automation test framework called <strong>Badak</strong>, built on top of <a href="https://cucumber.io/docs/installation/java/">Cucumber-JVM</a> and <a href="https://junit.org/junit4/">JUnit4</a>. In 2024, I initiated an implementation of <a href="https://junit.org/">JUnit5</a> on Badak framework for better modularity and parallelism.</p><p>That’s where I hit a wall.</p><p>The default <a href="https://junit.org/">JUnit5</a>+<a href="https://cucumber.io/docs/installation/java/">Cucumber-JVM</a> setup didn’t match our needs:</p><ul><li>No step-level notifications</li><li>No built-in support to order scenarios in parallel runs</li><li>Weak rerun capabilities for flaky tests</li></ul><p>I built a prototype module, badak-junit5, to bring these features in. But I couldn’t crack two big blockers:</p><ol><li>Custom execution order of scenarios in parallel</li><li>Reliable rerun mechanism without spawning separate JVMs</li></ol><p>The project stalled.</p><h3>Enter Cursor: An AI Sidekick</h3><p>Revisiting badak-junit5 with <a href="https://cursor.com/?from=home"><strong>Cursor</strong></a><strong> + </strong><a href="https://www.anthropic.com/claude/sonnet"><strong>Claude</strong></a><strong> c</strong>hanged everything. I won’t dive into the technical details — What matters is how <a href="https://cursor.com/?from=home">Cursor</a> helped me relearn and achieve what I couldn’t do months ago.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkjkjEU3lpuPNAnX9pW_Og.png" /><figcaption>timeline of badak-junit5</figcaption></figure><p>Using <a href="https://cursor.com/?from=home">Cursor</a> 1.1 with <a href="https://www.anthropic.com/claude/sonnet">claude-4-sonnet</a> , I finished the badak-junit5 within 3 days (technically it is ~24 hours in total) which had stumped me for months. Here’s how Cursor made it possible.</p><h3>Custom Scenario Ordering</h3><p><em>The first win? Configurable execution order.</em></p><p>By default, <a href="https://cucumber.io/docs/installation/java/">Cucumber-JVM</a> with <a href="https://junit.org/">JUnit5</a> will sort features and scenarios based on the test display name alphabetically.</p><p>This limited control over scenario order is inefficient. Suppose two scenarios in the test suite are slow while the rest are fast. Ideally, you’d run the slow ones in parallel. But without proper ordering, they may run at different times, leading to suboptimal execution time.</p><p>I want to add capability on the badak-junit5 to sort based on feature level tags as well as scenario level tags : @Order=1, @Order=2, etc. (lower order value will be executed first).</p><h4><strong>Getting AI Assistance</strong></h4><p>I needed the assistance of <a href="https://cursor.com/?from=home">Cursor</a> to :</p><ul><li>Focus on badak-junit5 module</li><li>Learn how ForkJoinPoolHierarchicalTestExecutorService works</li><li>Suggest how to customize the order of scenarios execution</li></ul><p>Long story short, <a href="https://cursor.com/?from=home">Cursor</a> easily complicate the solution. <a href="https://cursor.com/?from=home">Cursor</a> was suggesting to implement virtual features which collect all scenarios with the same order into one new virtual feature:</p><pre>1. Critical Virtual Feature<br> ├── [1] Database Setup (from Feature A) ─┐<br> ├── [1] API Setup (from Feature B)      ─┤ Same order = Can run in parallel<br> ├── [2] Cache Warmup (from Feature C)   ─┘<br> └── [5] Auth Check (from Feature D)<br>2. Regular Feature A<br> ├── [10] Regular Test 1 ─┐<br> ├── [10] Regular Test 2 ─┤ Same order = Can run in parallel<br> └── [20] Cleanup Test   ─┘<br>3. Regular Feature B<br> └── [50] Final Integration Test</pre><p>That doesn’t look half bad. But when you have hundreds of scenarios and you want to order most of them, the virtual feature will look messy.</p><h4>Finding the Right Solution</h4><p>Eventually, I landed on a simple, elegant solution:</p><ul><li>Sort <strong>features</strong> by @Order tag, fallback to exclusive resource and alphabet</li><li>Sort <strong>scenarios</strong> within features the same way</li></ul><p>This avoided the need for “virtual features” entirely. Simple to use. Simple to implement.</p><p>I gave clearer context and requirements in the prompt, and Voila! <a href="https://cursor.com/?from=home">Cursor</a> was able to create a custom scenario order mechanism as expected.</p><h4>Final Execution Order</h4><pre>@Order=1<br>Feature: Database Setup<br>  @Order=1<br>  Scenario: Create database schema<br><br>  @Order=2<br>  Scenario: Insert seed data<br><br>@Order=2<br>Feature: Authentication<br>  @Order=1<br>  Scenario: Setup auth service<br><br>  @Order=2<br>  Scenario: Test login functionality<br><br>@Order=2<br>Feature: User Management  <br>  @Order=1<br>  Scenario: Setup user service<br><br>  @Order=2<br>  Scenario: Test user operations<br><br>@Order=5<br>Feature: Integration Tests<br>  @Order=1<br>  Scenario: End-to-end user flow<br><br>  @Order=1<br>  Scenario: End-to-end admin flow</pre><p><strong>Execution Order:</strong></p><ol><li><strong>Database Setup</strong> (@Order=1) <br>- runs first and completes fully</li><li><strong>Authentication</strong> and <strong>User Management</strong> (@Order=2)<br> - run in parallel<br> - Within each feature, setup scenarios (@Order=1) run before test scenarios (@Order=2)</li><li><strong>Integration Tests</strong> (@Order=5) <br>- runs after all setup is complete <br>- Both end-to-end scenarios run in parallel</li></ol><h3>Smarter Rerun Strategies</h3><p><em>It never fails to amaze me,</em></p><p>The previous iteration already had a rerun mechanism. But it was still not optimal and not robust enough.</p><p>I wanted a rerun system that:</p><ul><li>Retries failed scenarios up to N times</li><li>Merges results cleanly without duplication</li><li>Supports both immediate and deferred retry strategies</li></ul><p>Cursor reviewed my earlier approach and proposed:</p><ul><li>IMMEDIATE mode: retry failed test on the spot (my original method)</li><li>DEFERRED mode: collect failures, rerun at end of test suite</li><li>COMBINE mode: do both</li><li>NONE mode: skip reruns</li></ul><h4>Debugging AI-Generated Code</h4><p>As I tried to test the implementation made by <a href="https://cursor.com/?from=home">Cursor</a>. I realized the implementation of DEFERRED rerun needed a fix—Cursor’s first version didn’t actually rerun tests. But with better prompting, it learned to:</p><ul><li>Spin up new contexts for each rerun</li><li>Store results in cucumber.json, cucumber-1.json, ...</li><li>Aggregate and report final outcomes</li></ul><p>Result: a robust rerun system that handles flakiness with elegance.</p><pre>Phase 1 - Original Execution:<br>├── Scenario A: PASS ✓<br>├── Scenario B: FAIL ✗ (recorded for rerun)<br>├── Scenario C: PASS ✓<br>└── Scenario D: FAIL ✗ (recorded for rerun)<br>Phase 2 - Deferred Rerun:<br>├── Attempt 1 (parallel): Retry B, D in parallel<br>│   ├── Scenario B: PASS ✓ (flaky test fixed)<br>│   └── Scenario D: FAIL ✗ (still failing)<br>└── Attempt 2 (sequential): Retry D sequentially<br>    └── Scenario D: PASS ✓ (fixed by sequential execution)<br>Final Results: All scenarios pass</pre><h3>Performance Showdown: JUnit4 vs JUnit5</h3><p><em>Gotta pump those numbers up,</em></p><p>With badak-junit5 now completed, I benchmarked it against our <a href="https://junit.org/junit4/">JUnit4</a> baseline.</p><h4>Test Configuration</h4><ul><li><strong>Test Scenarios</strong>: 122 scenarios per run</li><li><strong>Iterations</strong>: 10 runs each framework</li><li><strong>Test Date</strong>: July 10, 2025</li><li><strong>Environment</strong>: Darwin 24.5.0 (macOS)</li><li><strong>Command</strong>: mvn -o failsafe:integration-test -q -P {junit4|junit5} --log-file {framework}-log.log</li></ul><h4>Setting Up the Comparison</h4><p>Separate the runner classes</p><p>Inside BadakJunit4Tests:</p><pre>package com.gdn.qa.api.module;<br><br>import io.cucumber.junit.Cucumber;<br>import io.cucumber.junit.CucumberOptions;<br>import io.cucumber.spring.SpringFactory;<br>import org.junit.runner.RunWith;<br><br>import static io.cucumber.junit.CucumberOptions.SnippetType.CAMELCASE;<br><br>@RunWith(Cucumber.class)<br>@CucumberOptions(objectFactory = SpringFactory.class, stepNotifications = true, monochrome = true, snippets = CAMELCASE,<br>    features = &quot;src/test/resources/features/&quot;,<br>    tags = &quot;(@Sanity) and not (@Manual or @Deprecated or @Bug)&quot;)<br>public class BadakJunit4Tests {<br><br>}</pre><p>Inside BadakJunit5Tests:</p><pre>package com.gdn.qa.api.module;<br><br>import com.gdn.qa.automation.core.suites.TestSuite;<br><br>@TestSuite<br>public class BadakJunit5Tests {<br><br>}</pre><p>Adding junit-platform.properties to the automation project:</p><pre>cucumber.publish.quiet=true<br>cucumber.publish.enabled=false<br>cucumber.snippet-type=camelcase<br>cucumber.step.notifications.enabled=false<br>cucumber.filter.skipped.scenarios=true<br>cucumber.rerun.strategy=DEFERRED<br>cucumber.max.retry.failed.scenarios=2<br>cucumber.execution.parallel.enabled=true<br>cucumber.execution.parallel.config.strategy=fixed<br>cucumber.execution.parallel.config.fixed.parallelism=4<br>cucumber.object-factory=io.cucumber.spring.SpringFactory<br>cucumber.filter.tags=(@Sanity) and not (@Deprecated or @Ignored or @Bug or @Manual)<br>cucumber.features=src/test/resources/features/</pre><p><strong>Configuring </strong><strong>pom.xml to set profiles:</strong></p><pre>...<br>&lt;profiles&gt;<br>        &lt;profile&gt;<br>            &lt;id&gt;junit5&lt;/id&gt;<br>            &lt;build&gt;<br>                &lt;plugins&gt;<br>                    &lt;plugin&gt;<br>                        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>                        &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;<br>                        &lt;version&gt;${failsafe.version}&lt;/version&gt;<br>                        &lt;dependencies&gt;<br>                            &lt;dependency&gt;<br>                                &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br>                                &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;<br>                                &lt;version&gt;${junit-5.version}&lt;/version&gt;<br>                            &lt;/dependency&gt;<br>                        &lt;/dependencies&gt;<br>                        &lt;executions&gt;<br>                            &lt;execution&gt;<br>                                &lt;goals&gt;<br>                                    &lt;goal&gt;integration-test&lt;/goal&gt;<br>                                    &lt;goal&gt;verify&lt;/goal&gt;<br>                                &lt;/goals&gt;<br>                            &lt;/execution&gt;<br>                        &lt;/executions&gt;<br>                        &lt;configuration&gt;<br>                            &lt;failIfNoTests&gt;false&lt;/failIfNoTests&gt;<br>                            &lt;argLine&gt;${jvm.options}&lt;/argLine&gt;<br>                            &lt;includes&gt;<br>                                &lt;include&gt;**BadakJunit5Tests.java&lt;/include&gt;<br>                            &lt;/includes&gt;<br>                            &lt;systemPropertyVariables&gt;<br>                                &lt;spring.config.location&gt;${spring.config.location}<br>                                &lt;/spring.config.location&gt;<br>                            &lt;/systemPropertyVariables&gt;<br>                            &lt;useUnlimitedThreads&gt;false&lt;/useUnlimitedThreads&gt;<br>                        &lt;/configuration&gt;<br>                    &lt;/plugin&gt;<br>                &lt;/plugins&gt;<br>            &lt;/build&gt;<br>        &lt;/profile&gt;<br>        &lt;profile&gt;<br>            &lt;id&gt;junit4&lt;/id&gt;<br>            &lt;activation&gt;<br>                &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;<br>            &lt;/activation&gt;<br>            &lt;build&gt;<br>                &lt;plugins&gt;<br>                    &lt;plugin&gt;<br>                        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>                        &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;<br>                        &lt;version&gt;${failsafe.version}&lt;/version&gt;<br>                        &lt;dependencies&gt;<br>                            &lt;dependency&gt;<br>                                &lt;groupId&gt;org.apache.maven.surefire&lt;/groupId&gt;<br>                                &lt;artifactId&gt;surefire-junit47&lt;/artifactId&gt;<br>                                &lt;version&gt;${failsafe.version}&lt;/version&gt;<br>                            &lt;/dependency&gt;<br>                        &lt;/dependencies&gt;<br>                        &lt;executions&gt;<br>                            &lt;execution&gt;<br>                                &lt;goals&gt;<br>                                    &lt;goal&gt;integration-test&lt;/goal&gt;<br>                                    &lt;goal&gt;verify&lt;/goal&gt;<br>                                &lt;/goals&gt;<br>                            &lt;/execution&gt;<br>                        &lt;/executions&gt;<br>                        &lt;configuration&gt;<br>                            &lt;failIfNoTests&gt;false&lt;/failIfNoTests&gt;<br>                            &lt;argLine&gt;${jvm.options}&lt;/argLine&gt;<br>                            &lt;includes&gt;<br>                                &lt;include&gt;**BadakJunit4Tests.java&lt;/include&gt;<br>                            &lt;/includes&gt;<br>                            &lt;systemPropertyVariables&gt;<br>                                &lt;spring.config.location&gt;${spring.config.location}<br>                                &lt;/spring.config.location&gt;<br>                            &lt;/systemPropertyVariables&gt;<br>                            &lt;useUnlimitedThreads&gt;false&lt;/useUnlimitedThreads&gt;<br>                        &lt;/configuration&gt;<br>                    &lt;/plugin&gt;<br>                    &lt;plugin&gt;<br>                        &lt;groupId&gt;com.gdn.qa.util&lt;/groupId&gt;<br>                        &lt;artifactId&gt;custom-reporter-maven-plugin&lt;/artifactId&gt;<br>                        &lt;version&gt;${custom.reporter.plugin}&lt;/version&gt;<br>                        &lt;configuration&gt;<br>                            &lt;skip&gt;false&lt;/skip&gt;<br>                        &lt;/configuration&gt;<br>                        &lt;executions&gt;<br>                            &lt;execution&gt;<br>                                &lt;id&gt;merge-cucumber&lt;/id&gt;<br>                                &lt;phase&gt;${custom-reporter.execution.phase}&lt;/phase&gt;<br>                                &lt;configuration&gt;<br>                                    &lt;targetLocation&gt;/target/destination/&lt;/targetLocation&gt;<br>                                    &lt;reportName&gt;cucumber.json&lt;/reportName&gt;<br>                                &lt;/configuration&gt;<br>                                &lt;goals&gt;<br>                                    &lt;goal&gt;merge-cucumber&lt;/goal&gt;<br>                                &lt;/goals&gt;<br>                            &lt;/execution&gt;<br>                        &lt;/executions&gt;<br>                    &lt;/plugin&gt;<br>                &lt;/plugins&gt;<br>            &lt;/build&gt;<br>        &lt;/profile&gt;<br>    &lt;/profiles&gt;<br>...</pre><h3>Automated Performance Testing with AI</h3><p>Cursor even helped automate the whole benchmarking process — from execution to summary chart generation.</p><pre>okay i want you to learn this current project structure, the goal is, to compare the performance when using junit4 vs junit5 under same automation project to achieve it, i need to do series of tasks<br>so under the project directory you will find comparison.txt<br>inside it, there is junit4 and junit5 shell command.<br>what i want you to do is:<br>1. execute the export command on comparison.txt on your bash shell so it will have desired output format for time command<br>2. create a background task that repeats 10 times for:<br>   a. inside comparison.txt, grep the command for junit4, run it<br>   b. after successful run it will overwrite the file under junit4 folder, i want you to grep the key statistic from summary.html inside the junit4 folder, then append it (historically) to new junit4-summary.txt under the project directory<br>3. create a background task that repeats 10 times for:<br>   a. inside comparison.txt, grep the command for junit5, run it<br>   b. after successful run it will overwrite the file under junit5 folder, i want you to grep the key statistic from summary.html inside the junit5 folder, then append it (historically) to new junit5-summary.txt under the project directory<br>4. after the background task is finished, i want you to analyze the output on junit4-summary.txt and junit5-summary.txt and generate the statistic chart comparison about both performance metrics create report file summary-metrics.md<br>5. lastly i want you to analyze the output on junit4-time.txt and junit5-time.txt and generate the statistic chart comparison about both performance metrics create report file performance-metrics.md</pre><p>It amazed me that from the above prompt , <a href="https://cursor.com/?from=home">Cursor</a> was able to generate scripts and to-dos for collecting data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*eMB3MIjBywKW2p1ZjEo75A.png" /><figcaption>to-dos to compare junit4 vs junit5 performance</figcaption></figure><p>Generated script for <a href="https://junit.org/junit4/">JUnit4</a> tests and metrics collection:</p><pre>#!/bin/zsh<br><br>if [[ `uname` == Darwin ]]; then<br>    MAX_MEMORY_UNITS=KB<br>else<br>    MAX_MEMORY_UNITS=MB<br>fi<br><br>export TIMEFMT=&#39;%J   &#39;$&#39;\n&#39;\<br>&#39;%U  user %S system %P cpu %*E total&#39;$&#39;\n&#39;\<br>&#39;avg shared (code):         %X KB&#39;$&#39;\n&#39;\<br>&#39;avg unshared (data/stack): %D KB&#39;$&#39;\n&#39;\<br>&#39;total (sum):               %K KB&#39;$&#39;\n&#39;\<br>&#39;max memory:                %M &#39;$MAX_MEMORY_UNITS&#39;&#39;$&#39;&#39;<br><br>truncate -s 0 junit4-summary.txt<br>truncate -s 0 junit4-time.txt<br><br>for i in {1..10}<br>do<br>    echo &quot;=== JUnit4 Test Run $i ===&quot; | tee -a junit4-summary.txt<br>    echo &quot;Starting JUnit4 run $i at $(date)&quot;<br><br>    echo &quot;=== JUnit4 Test Run $i Time Metrics ===&quot; &gt;&gt; junit4-time.txt<br>    echo &quot;Date: $(date)&quot; &gt;&gt; junit4-time.txt<br><br>    mvn clean package test-compile -T 1C -q -P junit4 &amp;&amp;\<br>    { time mvn -o failsafe:integration-test -q -P junit4 --log-file junit4-log.log ; } 2&gt;&gt; junit4-time.txt &amp;&amp;\<br>    mvn custom-reporter:merge-cucumber -q -Dtarget-location=target/destination/ -Dreport-name=cucumber.json --log-file junit4-log.log &amp;&amp;\<br>    mvn custom-reporter:aggregate-summary -q -Dtarget-location=target/destination/ --log-file junit4-log.log &amp;&amp;\<br>    mvn custom-reporter:cucumber-summary -q --log-file junit4-log.log &amp;&amp;\<br>    rm -rf junit4 &amp;&amp;\<br>    mv target/destination/ junit4/<br>    <br>    if [ $? -eq 0 ]; then<br>        echo &quot;JUnit4 run $i completed successfully&quot;<br><br>        if [ -f &quot;junit4/summary.html&quot; ]; then<br>            echo &quot;Run $i Statistics:&quot; &gt;&gt; junit4-summary.txt<br>            echo &quot;Date: $(date)&quot; &gt;&gt; junit4-summary.txt<br>            <br>            TOTAL_SCENARIOS=$(grep -A 10 &quot;Total Scenarios&quot; junit4/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Total Scenarios: $TOTAL_SCENARIOS&quot; &gt;&gt; junit4-summary.txt<br>            <br>            TOTAL_EXECUTION_TIME=$(grep -A 10 &quot;Total Execution Time&quot; junit4/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Total Execution Time: $TOTAL_EXECUTION_TIME&quot; &gt;&gt; junit4-summary.txt<br>            <br>            ALL_SCENARIOS_DURATION=$(grep -A 10 &quot;All Scenarios Duration&quot; junit4/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;All Scenarios Duration: $ALL_SCENARIOS_DURATION&quot; &gt;&gt; junit4-summary.txt<br>            <br>            AVG_SCENARIO_DURATION=$(grep -A 10 &quot;Avg. Scenario Duration&quot; junit4/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Avg. Scenario Duration: $AVG_SCENARIO_DURATION&quot; &gt;&gt; junit4-summary.txt<br>            <br>            echo &quot;---&quot; &gt;&gt; junit4-summary.txt<br>        fi<br>    else<br>        echo &quot;JUnit4 run $i failed&quot; | tee -a junit4-summary.txt<br>    fi<br>    <br>    echo &quot;---&quot; &gt;&gt; junit4-time.txt<br>    echo &quot;&quot; &gt;&gt; junit4-time.txt<br>    <br>    echo &quot;Completed JUnit4 run $i at $(date)&quot;<br>    echo &quot;&quot;<br>done<br><br>echo &quot;All JUnit4 tests completed!&quot; </pre><p>Generated script for <a href="https://junit.org/">JUnit5</a> tests and metrics collection:</p><pre>#!/bin/zsh<br><br>if [[ `uname` == Darwin ]]; then<br>    MAX_MEMORY_UNITS=KB<br>else<br>    MAX_MEMORY_UNITS=MB<br>fi<br><br>export TIMEFMT=&#39;%J   &#39;$&#39;\n&#39;\<br>&#39;%U  user %S system %P cpu %*E total&#39;$&#39;\n&#39;\<br>&#39;avg shared (code):         %X KB&#39;$&#39;\n&#39;\<br>&#39;avg unshared (data/stack): %D KB&#39;$&#39;\n&#39;\<br>&#39;total (sum):               %K KB&#39;$&#39;\n&#39;\<br>&#39;max memory:                %M &#39;$MAX_MEMORY_UNITS&#39;&#39;$&#39;&#39;<br><br>truncate -s 0 junit5-summary.txt<br>truncate -s 0 junit5-time.txt<br><br>for i in {1..10}<br>do<br>    echo &quot;=== JUnit5 Test Run $i ===&quot; | tee -a junit5-summary.txt<br>    echo &quot;Starting JUnit5 run $i at $(date)&quot;<br>    <br>    echo &quot;=== JUnit5 Test Run $i Time Metrics ===&quot; &gt;&gt; junit5-time.txt<br>    echo &quot;Date: $(date)&quot; &gt;&gt; junit5-time.txt<br>    <br>    mvn clean package test-compile -T 1C -q -P junit4 &amp;&amp;\<br>    { time mvn -o failsafe:integration-test -q -P junit5 --log-file junit5-log.log ; } 2&gt;&gt; junit5-time.txt &amp;&amp;\<br>    rm -rf junit5 &amp;&amp;\<br>    mv target/destination/ junit5/<br>    <br>    if [ $? -eq 0 ]; then<br>        echo &quot;JUnit5 run $i completed successfully&quot;<br>    <br>        if [ -f &quot;junit5/summary.html&quot; ]; then<br>            echo &quot;Run $i Statistics:&quot; &gt;&gt; junit5-summary.txt<br>            echo &quot;Date: $(date)&quot; &gt;&gt; junit5-summary.txt<br>            <br>            TOTAL_SCENARIOS=$(grep -A 10 &quot;Total Scenarios&quot; junit5/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Total Scenarios: $TOTAL_SCENARIOS&quot; &gt;&gt; junit5-summary.txt<br>            <br>            TOTAL_EXECUTION_TIME=$(grep -A 10 &quot;Total Execution Time&quot; junit5/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Total Execution Time: $TOTAL_EXECUTION_TIME&quot; &gt;&gt; junit5-summary.txt<br>            <br>            ALL_SCENARIOS_DURATION=$(grep -A 10 &quot;All Scenarios Duration&quot; junit5/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;All Scenarios Duration: $ALL_SCENARIOS_DURATION&quot; &gt;&gt; junit5-summary.txt<br>            <br>            AVG_SCENARIO_DURATION=$(grep -A 10 &quot;Avg. Scenario Duration&quot; junit5/summary.html | grep -E &quot;&lt;span&gt;[^&lt;]*&lt;/span&gt;&quot; | sed -n &#39;2p&#39; | sed &#39;s/&lt;[^&gt;]*&gt;//g&#39; | sed &#39;s/^[[:space:]]*//&#39; | sed &#39;s/[[:space:]]*$//&#39;)<br>            echo &quot;Avg. Scenario Duration: $AVG_SCENARIO_DURATION&quot; &gt;&gt; junit5-summary.txt<br>            <br>            echo &quot;---&quot; &gt;&gt; junit5-summary.txt<br>        fi<br>    else<br>        echo &quot;JUnit5 run $i failed&quot; | tee -a junit5-summary.txt<br>    fi<br>    <br>    echo &quot;---&quot; &gt;&gt; junit5-time.txt<br>    echo &quot;&quot; &gt;&gt; junit5-time.txt<br>    <br>    echo &quot;Completed JUnit5 run $i at $(date)&quot;<br>    echo &quot;&quot;<br>done<br><br>echo &quot;All JUnit5 tests completed!&quot; </pre><h3>Sample Metrics Collected</h3><ul><li><a href="https://junit.org/junit4/"><strong>JUnit4</strong></a><strong> summary:</strong></li></ul><pre>=== JUnit4 Test Run 1 ===<br>Run 1 Statistics:<br>Date: Thu Jul 10 01:08:39 WIB 2025<br>Total Scenarios: 122<br>Total Execution Time: 1m 59s 551ms<br>All Scenarios Duration: 1m 49s 357ms<br>Avg. Scenario Duration: 896ms<br>---</pre><ul><li><a href="https://junit.org/junit4/"><strong>JUnit4</strong></a><strong> test time:</strong></li></ul><pre>=== JUnit4 Test Run 1 Time Metrics ===<br>Date: Thu Jul 10 01:05:40 WIB 2025<br>mvn -o failsafe:integration-test -q -P junit4 --log-file junit4-log.log   <br>51.47s  user 9.10s system 44% cpu 2:16.38 total<br>avg shared (code):         0 KB<br>avg unshared (data/stack): 0 KB<br>total (sum):               0 KB<br>max memory:                537292 KB<br>---</pre><ul><li><a href="https://junit.org/"><strong>JUnit5</strong></a><strong> summary:</strong></li></ul><pre>=== JUnit5 Test Run 1 ===<br>Run 1 Statistics:<br>Date: Thu Jul 10 01:39:38 WIB 2025<br>Total Scenarios: 122<br>Total Execution Time: 45s 397ms<br>All Scenarios Duration: 1m 54s 916ms<br>Avg. Scenario Duration: 941ms<br>---</pre><ul><li><a href="https://junit.org/"><strong>JUnit5</strong></a><strong> test time:</strong></li></ul><pre>=== JUnit5 Test Run 1 Time Metrics ===<br>Date: Thu Jul 10 01:38:11 WIB 2025<br>mvn -o failsafe:integration-test -q -P junit5 --log-file junit5-log.log   <br>50.76s  user 8.28s system 93% cpu 1:03.20 total<br>avg shared (code):         0 KB<br>avg unshared (data/stack): 0 KB<br>total (sum):               0 KB<br>max memory:                859536 KB<br>---</pre><h3>JUnit4 Performance Analysis (10 Runs)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzBnrhQTnRxo3TldyM8kfg.png" /></figure><h4>JUnit4 Performance Characteristics</h4><ul><li><strong>Test Execution</strong>: 1m 45s — 2m 2s scenarios duration</li><li><strong>Average Scenario Duration</strong>: 894ms (moderate consistency ±13%)</li><li><strong>System Resource Usage</strong>: Low CPU utilization (42% avg)</li><li><strong>Memory Efficiency</strong>: Conservative usage (537–695 MB)</li><li><strong>Performance Issues</strong>: 2 outlier runs with degraded performance</li></ul><h3>JUnit5 Performance Analysis (10 Runs)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NnJn9tv4XwjZh7rTYZJZ2Q.png" /></figure><h4>JUnit5 Performance Characteristics</h4><ul><li><strong>Test Execution</strong>: 1m 48s — 1m 59s scenarios duration</li><li><strong>Average Scenario Duration</strong>: 924ms (good consistency ±5%)</li><li><strong>System Resource Usage</strong>: High CPU utilization (89% avg)</li><li><strong>Memory Intensive</strong>: Higher usage (799–978 MB)</li><li><strong>Performance Stability</strong>: Minimal variance, no significant outliers</li></ul><h3>Results</h3><p><a href="https://junit.org/"><strong>JUnit5</strong></a><strong> wins across the board:</strong></p><ul><li><strong>Execution time</strong>: 52–58% faster</li><li><strong>CPU usage</strong>: 89% vs 42%</li><li><strong>Memory</strong>: 43% more, but well worth the speed gain</li><li><strong>Consistency</strong>: Minimal variance</li></ul><h3>Lessons Learned from Pair Programming with AI</h3><p>This experience taught me a few things:</p><ol><li><strong>AI thrives on good context<br></strong>The better your prompt, the better the result</li><li><strong>Ask AI to summarize its own solution<br></strong>Helps spot flaws and understand complex changes</li><li><strong>Beware of overengineering<br>- </strong>Cursor sometimes proposed convoluted solutions<br>- Simplify your requirements to steer it right</li><li><strong>Manual review is still essential<br></strong>AI helps, but doesn’t replace your judgment</li></ol><p>Most importantly, <strong>AI gives you momentum.</strong> When you don’t know where to start or what to ask, it lets you try, fail, and learn rapidly.</p><h3>Final Thoughts</h3><p>Using <a href="https://cursor.com/?from=home"><strong>Cursor</strong></a> felt like cheating—in the best way. It handled 75% of the work while I reviewed, refined, and wrapped up. I learned a ton and finished faster than ever.</p><p>Got a dusty side project or a stubborn bug? Let AI take a swing. You might just revive an old idea—and make it better than ever.</p><p><strong>Here’s to continuous improvement—and beyond.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebd29472d2dd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bliblidotcom-techblog/reviving-ideas-with-cursor-custom-cucumber-junit-5-ebd29472d2dd">Reviving Ideas with Cursor: Custom Cucumber JUnit 5</a> was originally published in <a href="https://medium.com/bliblidotcom-techblog">Blibli.com Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>