<?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 Allen Tuh on Medium]]></title>
        <description><![CDATA[Stories by Allen Tuh on Medium]]></description>
        <link>https://medium.com/@allentcm?source=rss-dd00de98ad5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-HrRuExc67kOoQQT.</url>
            <title>Stories by Allen Tuh on Medium</title>
            <link>https://medium.com/@allentcm?source=rss-dd00de98ad5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:57:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@allentcm/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[Why I Switched from MCP to CLI]]></title>
            <link>https://medium.com/@allentcm/why-i-switched-from-mcp-to-cli-23a2deec4a18?source=rss-dd00de98ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/23a2deec4a18</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[oclif]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Allen Tuh]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 00:39:25 GMT</pubDate>
            <atom:updated>2026-03-17T07:57:11.601Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>After months wrestling with bloated context windows and flaky protocol servers, I went back to basics — and my AI coding agent finally started working the way I wanted.</blockquote><p>I was the MCP evangelist in my team. I set up the Atlassian MCP server, the Playwright MCP, the Figma MCP and much more. Then I started actually using them with Claude Code on a real project.</p><p>I keep hitting the limit on Claude Pro plan with just a few round of prompting. I check the token counter and found out that all <strong>the MCP servers have took up almost 40% to 50% of the context window before the agent did a single useful thing!</strong></p><p>That was the moment I uninstalled everything and opened a terminal.</p><h3>The MCP promise vs. the MCP reality</h3><p>Model Context Protocol arrived in late 2024 with enormous backing. Every major AI provider endorsed it. The pitch was clean: one standard protocol, any AI model, any tool. Build an MCP server for your database and every AI client could query it. No more per-client glue code.</p><p>In theory, beautiful. In practice, the seams show quickly.</p><blockquote>What actually happens when MCP loads<br>A standard Atlassian MCP server dumps its entire tool schema into your context window on initialization — all 73 tools, their parameter descriptions, authentication flows, state management instructions. Your agent hasn’t done anything yet, and roughly 40% of your context budget is already gone.</blockquote><p>The deeper problem is architectural. MCP asks AI models to operate through an abstraction layer they were never trained on. Claude, GPT-4, Gemini — these models have been trained on billions of lines of terminal interactions. Stack Overflow answers, GitHub READMEs, documentation, tutorials — all of it is saturated with shell commands. They know git, gh, docker, kubectl as fluently as a senior engineer who&#39;s been at the terminal for a decade.</p><p><strong>MCP schemas? Zero training data. The model is improvising every time.</strong></p><h3>Why CLI wins for developer workflows</h3><p><strong>Self-documenting by design.</strong> Every CLI tool ships with --help and man pages. The agent can explore what a command does, drill into subcommands, and discover options - all without an external schema definition. No MCP server to maintain, no schema to keep in sync.</p><p><strong>Composability built over 50 years.</strong> Unix pipes. Output routing. Chaining. Parallel execution with &amp;&amp; and ||. MCP is designing in 2025-2026 what Unix figured out in the 1970s and spent five decades debugging. CLI composability carries the reliability of a v50 system. MCP composability is v0.1.</p><p><strong>LLMs just know this stuff.</strong> The model has seen find . -name &quot;*.ts&quot; | xargs grep &quot;import&quot; ten thousand times. It improvises novel combinations because the composability grammar is embedded in its weights. When it hits an error, it knows how to parse stderr, adjust flags, and retry. That fluency simply doesn&#39;t exist for MCP tool chains.</p><blockquote>“Tool results and definitions can sometimes consume 50,000+ tokens before an agent reads a request… At Anthropic, we’ve seen tool definitions consume 134K tokens before optimization.” — <a href="https://www.anthropic.com/engineering/advanced-tool-use">Anthropic Engineering Blog</a></blockquote><blockquote>“Previously, the Projects toolset, as with other now-consolidated toolsets, used a significant portion of the context window for the tools list. As a result, we’ve reduced token usage by around 23,000 tokens (50%).” — <a href="https://github.blog/changelog/2026-01-28-github-mcp-server-new-projects-tools-oauth-scope-filtering-and-new-features">GitHub Changelog</a></blockquote><blockquote><a href="https://x.com/steipete/status/2007876353463660757?s=20">“MCP were a mistake. Bash is better.</a>” — Peter Steinberger, creator of OpenClaw</blockquote><h3>Introducing Sidekick</h3><p>This brings me to a project I’ve been using heavily: Sidekick (sdkck). It’s an open-source agentic CLI built to give AI coding agents like Claude Code a clean, composable, extensible interface to the tools they need — without the MCP overhead.</p><p><a href="https://github.com/hesedcasa/sdkck">GitHub - hesedcasa/sdkck: Agentic CLI that provides multiple tools via plugins</a></p><p>What makes Sidekick interesting isn’t just what it does — it’s how it fits into AI-first workflows. Because it’s a standard CLI, Claude Code and other agents can discover its capabilities naturally:</p><pre># Agent discovers available commands<br>sdkck --help<br># Search for specific functionality<br>sdkck search &quot;create pr&quot;<br>sdkck search &quot;jira&quot; -d<br>sdkck search &quot;update issue&quot; --details</pre><p>The search command is the key insight. Instead of dumping your entire tool catalogue into context, an agent can query for exactly what it needs in the moment. This is context efficiency by design.</p><h3>Using Sidekick with Claude Code</h3><p>Here’s how to set this up. First, install Sidekick and any plugins your workflow needs:</p><pre># Install Sidekick globally<br>npm install -g sdkck <br># Install plugins (community or your own)<br>sdkck plugins add myplugin<br>sdkck plugins add someuser/someplugin<br># Verify installation<br>sdkck version</pre><p>Then document it in your CLAUDE.md at the project root. This is the equivalent of an MCP server config - except it costs zero tokens at load time:</p><pre># CLAUDE.md <br>## Available CLI Tools<br>sdkck is installed and available. Use it for task and issue management.<br><br>### Discovery<br>sdkck search &quot;&lt;query&gt;&quot;    # find relevant commands<br>sdkck search &quot;&lt;query&gt;&quot; -d # detailed help for each result<br>sdkck --help              # full command list<br><br>### Workflow<br>Always search before assuming a command exists.<br>Prefer composing sdkck commands with standard Unix pipes.</pre><p>When Claude Code encounters a task, it searches first, then acts. Here’s what that looks like in practice:</p><pre># Claude Code working on a feature branch<br><br># 1. Search for relevant commands <br>sdkck search &quot;create pr&quot; --details <br><br># 2. Compose with existing tools<br>gh pr create --title &quot;feat: add auth&quot; --body &quot; $( cat PR_TEMPLATE.md) &quot;<br><br># 3. Chain with other commands naturally<br>sdkck search &quot;jira&quot; | head -5</pre><h3>Extending Sidekick with plugins</h3><p>The plugin system is where Sidekick becomes genuinely powerful. You can build and link your own tools for development:</p><pre># Install a plugin from a github url.<br>sdkck plugins install https://github.com/someuser/someplugin <br><br># Inspect what got installed<br>sdkck plugins inspect my-jira-plugin <br><br># List all installed plugins<br>sdkck plugins <br><br># Keep plugins updated<br>sdkck plugins update</pre><p>For other coding agents — Cursor, Copilot, Kiro, OpenClaw — the integration pattern is the same: document <strong>Sidekick</strong> in whatever context file the agent reads (AGENT.md, .cursorrules, agent instructions), and let the agent discover capabilities through sdkck search rather than preloading schemas.</p><h3>The Honest Nuance</h3><p>I want to be fair here: MCP isn’t bad. It has a legitimate use case, and writing it off entirely would be intellectually dishonest.</p><p>For 80–90% of developer-facing use cases — building features, running tests, managing git, automating your own workflows — CLI is the faster, cheaper, more reliable path. For multi-tenant products where your agent acts on behalf of customers inside their organizations, MCP’s governance model earns its overhead.</p><p>The smartest teams in 2026 aren’t picking sides. They’re using CLI for development workflows and MCP for customer-facing compliance-sensitive features. But if you’re a developer automating your own stack, there’s no reason to carry MCP’s weight.</p><h3>Getting Started</h3><p>If you want to try this approach today:</p><p>Detail guide can be found <a href="https://dev.to/allentcm/getting-started-with-sidekick-sdkck-a-complete-setup-guide-460m">here</a></p><pre># Install Sidekick<br>npm install -g sdkck<br><br># Explore what&#39;s available<br>sdkck commands<br>sdkck search &quot;anything&quot; <br><br># In your project root<br>echo &quot;sdkck is available. Use &#39;sdkck search &lt;query&gt;&#39; to find commands.&quot; &gt;&gt; CLAUDE.md</pre><p>That’s it. No JSON config. No SSE server. No schema dumped into your context. Just a tool your agent can pick up and use.</p><p>The Unix philosophy — small, composable tools that do one thing well — has proven remarkably durable. Fifty years later, it turns out it’s also the best interface we’ve built for AI agents. Not because we planned it that way. Because we already spent fifty years making it work.</p><p><em>Originally published at </em><a href="https://dev.to/allentcm/why-i-switched-from-mcp-to-cli-3ifb"><em>https://dev.to</em></a><em> on March 17, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23a2deec4a18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Local Coding Assistant with Continue & Ollama]]></title>
            <link>https://medium.com/@allentcm/setup-local-coding-assistant-with-continue-ollama-294e0a152c3b?source=rss-dd00de98ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/294e0a152c3b</guid>
            <dc:creator><![CDATA[Allen Tuh]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 08:02:53 GMT</pubDate>
            <atom:updated>2024-06-13T08:02:53.223Z</atom:updated>
            <content:encoded><![CDATA[<p>In the ever-evolving landscape of software development, having a robust coding assistant can significantly boost your productivity. While cloud-based solutions like GitHub Copilot are popular, local coding assistants are gaining traction due to their enhanced privacy, security, and offline functionality. In this guide, we’ll walk you through the process of setting up a local coding assistant using Continue and Ollama in VSCode.</p><h3>Why use Continue?</h3><p>Among the numerous VSCode extensions for local coding assistance, <strong>Continue</strong> stands out for its full local functionality when paired with Ollama. This ensures enhanced privacy and security while providing a powerful coding assistant experience.</p><h3>Set Up Ollama</h3><p><strong>Download Ollama</strong>: Visit the <a href="https://ollama.com/">Ollama website</a> and download the installer for your operating system.</p><p><strong>Install Ollama</strong>: Follow the installation instructions provided on the website. Once installed, Ollam will auto-start and you should be able to see this cute little lama in the menu bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*SzOfqc4nJOb-vPX5TMzXTA.png" /></figure><p><strong>Download Models</strong>: For our local coding assistant setup, we’ll use the llama3 model for chatting and the starcoder2:3b model for auto-completion.</p><p>Open the terminal and type in the command to pull the required model.</p><pre>ollama pull llama3<br>ollama pull starcoder2:3b</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*TwfkJgKH-_QkAK57RzMhnA.png" /></figure><h3>Setup Continue in VSCode</h3><p><strong>Install Continue:</strong> Go to the <a href="https://marketplace.visualstudio.com/items?itemName=Continue.continue">Continue extension page</a> on the Visual Studio Marketplace and install it.</p><p><strong>Configure Continue:</strong> In VSCode, press CMD + SHIFT + P (or CTRL + SHIFT + P on Windows/Linux) and select Continue: Open config.json.</p><p>Fill in the config file with the following data:</p><pre>{<br>  &quot;models&quot;: [<br>    {<br>      &quot;title&quot;: &quot;Llama 3&quot;,<br>      &quot;provider&quot;: &quot;ollama&quot;,<br>      &quot;model&quot;: &quot;llama3&quot;<br>    },<br>    {<br>      &quot;title&quot;: &quot;Ollama&quot;,<br>      &quot;provider&quot;: &quot;ollama&quot;,<br>      &quot;model&quot;: &quot;AUTODETECT&quot;<br>    }<br>  ],<br>  &quot;customCommands&quot;: [<br>    {<br>      &quot;name&quot;: &quot;test&quot;,<br>      &quot;prompt&quot;: &quot;{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don&#39;t edit any file.&quot;,<br>      &quot;description&quot;: &quot;Write unit tests for highlighted code&quot;<br>    }<br>  ],<br>  &quot;tabAutocompleteModel&quot;: {<br>    &quot;title&quot;: &quot;Starcoder 3b&quot;,<br>    &quot;provider&quot;: &quot;ollama&quot;,<br>    &quot;model&quot;: &quot;starcoder2:3b&quot;<br>  },<br>  &quot;embeddingsProvider&quot;: {<br>    &quot;provider&quot;: &quot;transformers.js&quot;<br>  },<br>  &quot;allowAnonymousTelemetry&quot;: false<br>}</pre><h3>Let the Fun begin</h3><p><strong>Add Code to Chat:</strong> Highlight the code and press CMD + L (or CTRL + L on Windows/Linux). The code will be added to the chat interface where you can perform commands such as creating a test case, explaining, optimizing, and more.</p><p><a href="https://drive.google.com/file/d/1WHP21k41pkIKL6NeGOmOpPHqE1lpLHRg/view?usp=drivesdk">https://drive.google.com/file/d/1WHP21k41pkIKL6NeGOmOpPHqE1lpLHRg/view?usp=drivesdk</a></p><p><strong>Inline Code Edit:</strong> Highlight the code and press CMD + I (or CTRL + I on Windows/Linux) to execute commands directly on the selected code.</p><p><a href="https://drive.google.com/file/d/1nlRmv5_bFCWYRwjz8TXf2YrkW6yZC2IR/view?usp=drivesdk">https://drive.google.com/file/d/1nlRmv5_bFCWYRwjz8TXf2YrkW6yZC2IR/view?usp=drivesdk</a></p><p>For additional functionalities and detailed usage, refer to the <a href="https://marketplace.visualstudio.com/items?itemName=Continue.continue">Continue extension page</a> on the Visual Studio Marketplace.</p><h3>References:</h3><ol><li>Continue: <a href="https://marketplace.visualstudio.com/items?itemName=Continue.continue">https://marketplace.visualstudio.com/items?itemName=Continue.continue</a></li><li>Ollama: <a href="https://ollama.com/">https://ollama.com/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=294e0a152c3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I switched from Copilot to Local Coding Assistant]]></title>
            <link>https://medium.com/@allentcm/why-i-switched-from-copilot-to-local-coding-assistant-edb22090050f?source=rss-dd00de98ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/edb22090050f</guid>
            <dc:creator><![CDATA[Allen Tuh]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 03:08:34 GMT</pubDate>
            <atom:updated>2024-06-13T03:09:55.653Z</atom:updated>
            <content:encoded><![CDATA[<p>As developers, we’re always on the lookout for tools that enhance our productivity and make our coding journey smoother. Recently, AI-powered coding assistants have gained popularity, with GitHub Copilot being one of the most well-known. However, there’s a growing interest in local coding assistants for several compelling reasons. In this article, we’ll delve into the advantages of local coding assistance, comparing it with GitHub Copilot in terms of privacy, security, offline mode, and cost.</p><h3>Privacy: Keeping Your Code Confidential</h3><p>One of the major concerns for developers using cloud-based coding assistants like GitHub Copilot is privacy. Copilot sends your code to the cloud for processing, which means that potentially sensitive or proprietary code is transmitted over the internet. Despite assurances of data security, this can be a significant risk, especially for organizations with strict data protection policies.</p><p>Local coding assistants, on the other hand, operate entirely on your local machine. This means that your code never leaves your development environment, ensuring maximum privacy. You retain full control over your code, which is particularly important for companies handling sensitive data or proprietary software.</p><h3>Security: Reducing Exposure to Vulnerabilities</h3><p>Security is another critical consideration when choosing a coding assistant. GitHub Copilot relies on cloud services, which introduces a layer of potential vulnerability. Any cloud-based service can be a target for cyberattacks, and the transmission of code to and from the cloud increases the risk of interception or unauthorized access.</p><p>Local coding assistants mitigate these risks by performing all operations locally. This not only reduces the attack surface but also eliminates the need for an internet connection during development, providing an additional layer of security. Developers can work with peace of mind, knowing that their code is not exposed to external threats.</p><h3>Offline Mode: Coding Without Boundaries</h3><p>One of the standout features of local coding assistants is their ability to function offline. GitHub Copilot requires an internet connection to access its cloud-based models, which can be a limitation in environments with poor connectivity or during travel.</p><p>Local coding assistants are designed to work entirely offline, leveraging the power of your local hardware. This makes them incredibly versatile, allowing you to code in any environment, whether you’re on a plane, in a remote area, or simply experiencing internet outages. The ability to work without reliance on an internet connection ensures uninterrupted productivity.</p><h3>Cost: Savings with Local Solutions</h3><p>Cost is always a factor when choosing tools for development. GitHub Copilot operates on a subscription model, typically costing $10 per month or $100 per year. For individual developers or small teams, this might be a reasonable expense, but for larger organizations, the costs can add up quickly.</p><p>Local coding assistants often come with a one-time purchase fee or a more affordable subscription model. Since they do not rely on cloud infrastructure, their operational costs are lower, which translates to savings for the end user. Additionally, some open-source local coding assistants are available for free, providing a cost-effective alternative without compromising on functionality.</p><h3>Conclusion</h3><p>Local coding assistants offer a range of advantages over cloud-based solutions like GitHub Copilot. They provide enhanced privacy and security by keeping your code on your local machine, ensure uninterrupted productivity with offline mode, integrate efficiently with development environments like VSCode, and often come at a lower cost.</p><p>For developers and organizations prioritizing privacy, security, and cost-effectiveness, local coding assistants are an excellent choice. As AI technology continues to evolve, the capabilities of local coding assistants are only expected to improve, making them a valuable tool in any developer’s toolkit.</p><h3>References:</h3><ol><li>Copilot: <a href="https://github.com/features/copilot">https://github.com/features/copilot</a></li><li>Cody: <a href="https://sourcegraph.com/compare">https://sourcegraph.com/compare</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edb22090050f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BDD Made Easy: Testing Laravel Projects with Codeception and Gherkin]]></title>
            <link>https://medium.com/@allentcm/bdd-made-easy-testing-laravel-projects-with-codeception-and-gherkin-b92a2da4167a?source=rss-dd00de98ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b92a2da4167a</guid>
            <dc:creator><![CDATA[Allen Tuh]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 00:44:20 GMT</pubDate>
            <atom:updated>2024-01-08T00:44:20.257Z</atom:updated>
            <content:encoded><![CDATA[<p>Behavior-driven development (BDD) is a powerful methodology that focuses on defining the behavior of a system through the use of descriptive language. By using BDD, developers can write tests that are more readable and understandable to non-technical stakeholders, which can help to improve collaboration and communication within a development team. In this article, we’ll explore how to implement BDD with Codeception in a Laravel project, along with some sample code to help you get started.</p><h3>Setup Codeception in Laravel</h3><p>Before we can start writing BDD tests with Codeception, we first need to set up our Laravel project to work with the framework. To do this, we’ll need to install Codeception using Composer. Here’s how:</p><pre>composer require codeception/codeception codeception/module-laravel --dev</pre><p>Once Codeception is installed, we can generate a new test suite for our Laravel project using the following command:</p><pre>php vendor/bin/codecept bootstrap</pre><p>This will create a new tests directory in our Laravel project, along with some sample test files. You can checkout the Git repository for the example here: <a href="https://github.com/allentcm/example-app/tree/main">https://github.com/allentcm/example-app/tree/main</a></p><h3>Building Skeleton for Test Case</h3><p>Before you write a BDD test case, you need to create a simple story for your test case. This is like building a skeleton for your test case. To learn more about how to write a simple story please refer to <a href="https://codeception.com/docs/BDD">https://codeception.com/docs/BDD</a>. Let&#39;s use the below example as our story:</p><pre>As a customer I want to buy several products<br>I put first product with $500 price to my cart<br>And then another one with $700 price<br>And then another one with $1000 price<br>When I go to checkout process<br>I should see that total number of products I want to buy is 3<br>And my order amount is $2200</pre><p>We will use the Functional Test Suite for this example. Please refer to the Codeception documentation (<a href="https://codeception.com/docs/GettingStarted">https://codeception.com/docs/GettingStarted</a>) for more details about the test suites. Let’s create our first test case:</p><pre>php vendor/bin/codecept g:feature Functional checkout</pre><p>Codeception will create a new template for our test case as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AS8-kzlF7VCcPp0bHB1Bw.png" /></figure><p>Let’s fill up our test case with the story:</p><pre>Feature: checkout<br>  In order to buy products<br>  As a customer<br>  I want to be able to buy several products<br><br>  Background:<br>    Given I login as &quot;Test User&quot;<br><br>  Scenario: try checkout<br>    Given I add product with $500 price in my cart<br>    And I add product with $700 price in my cart<br>    And I add product with $1000 price in my cart<br>    When I checkout<br>    Then I should see that total number of products is 3<br>    And my order amount is $2200</pre><h3>Adding Meat to Test Case</h3><p>Use the below command to run your first test case:</p><p><a href="https://app.warp.dev/block/embed/ye7FTtp5XNnnZRXjjaaq7S">A block has been shared!</a></p><p>You will notice that the test is incomplete because we have not defined the actual code of the steps used in the test case, which is the meat for our test case. Codeception comes with a useful command to create code templates for all undefined steps in all feature files of this suite.</p><p><a href="https://app.warp.dev/block/pLw1lQQdz8lDJpVIAJPSGs">A block has been shared!</a></p><p>Copy and paste all the snippets into the FunctionalTester class (tests/Support/FunctionalTester.php). Fill out all the code accordingly and rerun the test:</p><pre>class FunctionalTester extends \Codeception\Actor<br>{<br>    use _generated\FunctionalTesterActions;<br><br>    protected User $user;<br>    protected string $token;<br><br>    /**<br>     * @Given I login as :name<br>     */<br>    public function iLoginAs(string $name): void<br>    {<br>        $this-&gt;user = User::where([&#39;name&#39; =&gt; $name])-&gt;first();<br><br>        $this-&gt;token = $this-&gt;user-&gt;createToken(&#39;test&#39;)-&gt;plainTextToken;<br>    }<br><br>    /**<br>     * @Given I add product with $:price price in my cart<br>     */<br>    public function iAddProductWithPriceInMyCart(string $price): void<br>    {<br>        $product = Product::where([&#39;price&#39; =&gt; $price])-&gt;first();<br><br>        $this-&gt;user-&gt;cart-&gt;products()-&gt;save($product);<br>    }<br><br>   /**<br>    * @When I checkout<br>    */<br>    public function iCheckout()<br>    {<br>        <br>    }<br><br>    /**<br>     * @Then I should see that total number of products is :num<br>     */<br>    public function iShouldSeeThatTotalNumberOfProductsIs(string $num): void<br>    {<br>        $this-&gt;assertEquals($num, $this-&gt;user-&gt;cart-&gt;products()-&gt;count());<br>    }<br><br>   /**<br>    * @Then my order amount is $:total<br>    */<br>    public function myOrderAmountIs(string $total): void<br>    {<br>        $this-&gt;assertEquals($total, $this-&gt;user-&gt;cart-&gt;products()-&gt;sum(&#39;price&#39;));<br>    }<br>}</pre><p><a href="https://app.warp.dev/block/ShIRhRx8kTQ9u4qCxYTfzK">A block has been shared!</a></p><h3>Simplify Test Case</h3><p>Codeception lets you create easy-to-understand test cases with these additional features. They also help you to write less code:</p><h4>A. Background</h4><p>If several scenarios start with the same steps, like always needing to be logged in as an administrator for the dashboard, you can use the Background section to avoid repeating those steps in each scenario, e.g.:</p><pre>Feature: checkout<br>  In order to buy products<br>  As a customer<br>  I want to be able to buy several products<br><br>  Background:<br>    Given I login as &quot;Test User&quot;</pre><h4>B. Tables</h4><p>Using tables for repeating data in scenarios makes them clearer. Instead of multiple steps like “I add product with $500 price in my cart,” a single step with multiple values is more concise, e.g.:</p><pre>Scenario: try checkout with table<br>    Given I have products in my cart<br>      | price |<br>      | 700   |<br>      | 900   |<br>    When I checkout<br>    Then I should see that total number of products is 2<br>    And my order amount is $1600</pre><pre>/**<br> * @Given I have products in my cart<br> */<br>public function iHaveProductsInMyCart(TableNode $products)<br>{<br>    foreach ($products-&gt;getRows() as $index =&gt; $row) {<br>        if ($index === 0) { // first row to define fields<br>            continue;<br>        }<br><br>        $product = Product::where([&#39;price&#39; =&gt; $row[0]])-&gt;first();<br><br>        $this-&gt;user-&gt;cart-&gt;products()-&gt;save($product);<br>    }<br>}</pre><h4>C. Examples</h4><p>If scenarios have similar logic but different data, we can use a Scenario Outline. It’s like a basic scenario but with placeholders filled from a table. Each set of values from the table is executed as a separate test, e.g.:</p><pre>  Scenario Outline: order discount<br>    Given I add product with $&lt;price&gt; price in my cart<br>    And I add promo code &quot;&lt;promo_code&gt;&quot; to my cart<br>    When I checkout<br>    And my order amount is $&lt;total&gt;<br><br>    Examples:<br>      | price | promo_code | total |<br>      | 500   | 10%OFF     | 450   |<br>      | 700   | 50%OFF     | 350   |<br>      | 1200  | 80%OFF     | 240   |</pre><h3>Run Test Case with Ease</h3><h4>A. Run the entire test suit:</h4><pre>php vendor/bin/codecept run Functional</pre><h4>B. Run the specific feature file:</h4><pre>php vendor/bin/codecept run Functional checkout.feature</pre><h4>C. Run the specific scenario in a feature file:</h4><pre>php vendor/bin/codecept run Functional checkout.feature:&quot;try checkout with table&quot;</pre><h3>Conclusion</h3><p>In conclusion, Behavior-driven development (BDD) provides a robust methodology for defining a system’s behavior through expressive language. This approach, implemented with tools like Codeception in Laravel projects, not only enhances test readability for developers but also facilitates better understanding for non-technical stakeholders. By creating clear scenarios, setting up code structures, and utilizing advanced features like Background, Tables, and Examples, BDD promotes collaboration and ensures effective communication within development teams. Embracing these practices can lead to more efficient testing and a smoother development process. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b92a2da4167a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Use Snippets In iTerm2 To Boost My Productivity as a Software Engineer]]></title>
            <link>https://medium.com/@allentcm/how-i-use-snippets-in-iterm2-to-boost-my-productivity-as-a-software-engineer-ce18e3b498f9?source=rss-dd00de98ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce18e3b498f9</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Allen Tuh]]></dc:creator>
            <pubDate>Thu, 22 Dec 2022 14:23:58 GMT</pubDate>
            <atom:updated>2022-12-22T14:28:34.429Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are an experienced software engineer, you probably are using tools like iTerm2, Terminal, or Command Prompt as part of your daily work routine. While nothing wrong using them as is, there is a much smarter way to get the job done quicker, using iTerm2 Snippets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WWs4Fc1T5g1-IPL6VXZqBg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/es/@ikukevk?utm_source=medium&amp;utm_medium=referral">Kevin Ku</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>What is a Snippet?</strong></h3><p>A snippet is a saved bit of text that can be pasted quickly when you click on it. The text can be anything from a paragraph to a command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*Cch8YBFIqCBhkKulVOjQAg.png" /><figcaption>Snippets in iTerm2</figcaption></figure><p>Here are some examples of how using Snippets can help with your productivity:</p><h4>Limited brain RAM capacity</h4><p>Are you frustrated having to to go back to StackOverflow just to copy-paste the same command over and over again, just because you cannot remember the exact command? Since Snippets holds all of my commands, all I need to do is just browse through the snippets dropdown menu and click on the snippet name that I want to execute. Just be sure to use a name that is easy to remember though. This shaves off 25% of my time on StackOverflow :D</p><h4>Quick easy access to all common commands</h4><p>Do you save all your useful commands all over the place e.g. Notes, Google Drive, Slack, paper and etc? With snippets, I can quickly execute any command I need instantly with a single click. Snippets are my one-stop store for all my useful commands.</p><h4>Avoid executing the wrong command</h4><p>Each time we type or copy-paste a command in the terminal, we are prone to make mistakes. This is a serious matter if you are especially dealing with the production environment. Thus, making these critical commands into snippets will guarantee that when you click on one of them, it is going to execute the exact command you intended. No more silly mistakes and typo errors, yeah!</p><h4>Reduce repetitive typing</h4><p>In my daily work routine, I find myself typing the same command multiple times, like when running Codeception test cases. With Snippets, I simply click on the Codeception command without much typing. This enables me to have more time to focus on producing better code.</p><h4>Sharing is caring</h4><p>More often than not, the snippets collection you have is likely useful to others as well. Why not share your collection with them? iTerm2 enables you to export and import your snippets collection easily. Find out how to below.</p><h3><strong>How to enable Snippet to the status bar</strong></h3><ol><li>Go to iTerm2 &gt; Preferences …</li><li>Go to the <strong>Profiles</strong> tab and select the <strong>Session</strong> tab.</li><li>Check the <strong>Status bar enabled</strong></li><li>Click on the <strong>Configure Status Bar</strong> button.</li><li>Drag the <strong>Snippet…</strong> into the Active Components and click OK.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUfKgcpHxu-dxJpUTZHg4Q.png" /><figcaption>Check the Status bar enabled</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMNV2GoPDZikzs39FF_i8Q.png" /><figcaption>Drag the Snippet… into the Active Components and click OK</figcaption></figure><h3><strong>How to add a Snippet</strong></h3><ol><li>Click on the <strong>Send Snippet…</strong></li><li>Click on the <strong>Edit Snippet…</strong></li><li>Click on the “<strong>+”</strong> button and add your Snippet with a name and the actual command.</li><li>Click <strong>OK</strong> to save the Snippet. You will see your new Snippet in the Send Snippet… drop-down menu.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*8dYV6mpR0bOy6dBjvjZhow.png" /><figcaption>Click on the Send Snippet…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*BkOWJT-plHcj7vXBMc2K1w.png" /><figcaption>Click on the Edit Snippet…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLkz8PMml6DydtpHTqsKJA.png" /><figcaption>Add a new Snippet and click OK to save it</figcaption></figure><h3><strong>How to export and import snippets collection</strong></h3><ol><li>Click on the <strong>Send Snippet…</strong></li><li>Click on the <strong>Edit Snippet…</strong></li><li>To export, select all the snippets then click on the export icon.</li><li>To import, click the import icon and select the snippets collection file that has the .it2snippets extension (i.e.: snippets.it2snippets).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJzYUekzsuKE7hKCfS43cQ.png" /><figcaption>Export snippets collection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*Vbmcz1rPAfcGmrVH8yIGXw.png" /><figcaption>Import snippets collection</figcaption></figure><h3><strong>How to use Snippet from iTem2</strong></h3><ol><li>Open the iTerm2</li><li>Click on the <strong>Send Snippet…</strong> and you will see a dropdown menu.</li><li>Click on the snippet name for the command you want to execute.</li><li>Then you will see the command is pasted on iTerm2 and executed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*TK13MOMGpKOOtwRTyuoy1g.gif" /><figcaption>Execute snippet in iTerm2</figcaption></figure><h3><strong>Sample of useful Snippets</strong></h3><p>Here are some examples of the more commonly used snippets as polled by my peers.</p><h4>Access MySQL</h4><pre>mysql -uroot -p&#39;your_password&#39; </pre><h4>Enable logging in MySQL</h4><pre>SET GLOBAL general_log=1;<br>SHOW VARIABLES LIKE &#39;%general%&#39;;<br>exit</pre><h4>Access MongoDB</h4><pre>mongo -umy_app -p&#39;your_password&#39; --ssl --host &#39;documentdb-myproject-test.cluster-c2kexzo0yxou.ap-southeast-1.docdb.amazonaws.com&#39; --sslCAFile rds-combined-ca-bundle.pem</pre><h4>Navigate to another directory</h4><pre>cd /var/www/destination/folder</pre><h4>Turn on NGROK</h4><pre>ngrok http -host-header=rewrite api-local.myapp.com:80</pre><h4>Start JMeter</h4><pre>bash /Users/johndoe/Downloads/jmeter/bin/jmeter.sh</pre><h4>Running JMeter report</h4><pre>rm /Users/johndoe/Desktop/jmeterResult.csv<br>rm -r /Users/johndoe/Desktop/jmeterReport<br>bash /Users/johndoe/Downloads/jmeter/bin/jmeter.sh -n -t /Users/johndoe/Downloads/jmeter/bin/examples/YourTestPlan.jmx -l /Users/johndoe/Desktop/jmeterResult.csv -e -o /Users/johndoe/Desktop/jmeterReport</pre><h4>Running Codeception (for Laravel)</h4><pre>vendor/bin/codecept run</pre><h4>Add a new feature for BDD Codeception (for Laravel)</h4><pre>php vendor/bin/codecept g:feature functional </pre><h4>Generate Snippets for BDD Codeception (for Laravel)</h4><pre>php vendor/bin/codecept gherkin:snippets functional</pre><h4>Turn on database logging for the reader node (for Laravel)</h4><pre>DB::connection(&#39;mysql_read&#39;)-&gt;enableQueryLog();</pre><h4>Get the logging records from the reader node (for Laravel)</h4><pre>DB::connection(&#39;mysql_read&#39;)-&gt;getQueryLog();</pre><p>So have you used Snippets with your iTerm2? Do you find mine useful? Share with me some of the powerful Snippets you have on your set up!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce18e3b498f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>