<?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 Nahel Lachgar on Medium]]></title>
        <description><![CDATA[Stories by Nahel Lachgar on Medium]]></description>
        <link>https://medium.com/@nahellachgar?source=rss-6d32e7826675------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ildzZUVpBDiaKSEwZTLmww.jpeg</url>
            <title>Stories by Nahel Lachgar on Medium</title>
            <link>https://medium.com/@nahellachgar?source=rss-6d32e7826675------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:32:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nahellachgar/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[Software testing can be a waste of time]]></title>
            <link>https://nahellachgar.medium.com/software-testing-can-be-a-waste-of-time-64d7b8e8512a?source=rss-6d32e7826675------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d7b8e8512a</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nahel Lachgar]]></dc:creator>
            <pubDate>Tue, 16 May 2023 11:10:11 GMT</pubDate>
            <atom:updated>2023-05-16T11:23:37.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_D8LTSYpeTAHFVtjayIj_g.png" /></figure><p>Writing tests can be a waste of time and may not seem very useful …</p><p>When done poorly.</p><p>However, when done correctly, it saves time, prevents many difficulties, and becomes essential for ensuring quality.</p><p>Many companies write tests with the only goal of achieving a test coverage (60%, 80%, 100%…), like a grade on an exam.</p><p>They end up testing every (im)possible and imaginable case, which is not the objective.</p><p>For exemple :<br>❌ Testing HTML elements (such as verifying if a button contains the text “Cancel” or “Home” in a header…)</p><p>❌ Testing a scenario where a function without parameters is called with arguments (or any other behavior that cannot occur)</p><p><strong>Testing all improbable cases or the entire DOM is a waste of time.</strong></p><p><strong>The goal of testing is to ensure reliable application behavior in realistic scenarios.</strong></p><p>Testing has several important benefits:</p><p>✅ Speeding up development and increasing efficiency with Test-Driven Development (TDD).</p><p>✅ Properly implementing business logic through Behavior-Driven Development (BDD).</p><p>✅ Ensuring that the developed software aligns with expectations.</p><p>✅ Preventing bugs and security vulnerabilities.</p><p>✅ Deploying to production without stress or pressure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64d7b8e8512a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Architecture : choose the right one]]></title>
            <link>https://nahellachgar.medium.com/flutter-architecture-choose-the-right-one-ced20f78ea30?source=rss-6d32e7826675------2</link>
            <guid isPermaLink="false">https://medium.com/p/ced20f78ea30</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Nahel Lachgar]]></dc:creator>
            <pubDate>Sun, 07 May 2023 13:00:09 GMT</pubDate>
            <atom:updated>2023-10-16T14:12:20.302Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Flutter logo" src="https://cdn-images-1.medium.com/max/1024/0*WCHeErunw9xfXT7Y.png" /></figure><h3>Flutter Architecture : choose the right one</h3><p>When you develop an application with Flutter, you have to choose a structure for your project, and the two main choices are <strong>Layer-first</strong> and <strong>Feature-first</strong>.</p><h3>Why and how to choose an architecture ?</h3><p>Before going into details, let’s explain the importance of software architecture.</p><p>The goals of good architecture are:</p><ul><li>Allowing a developer to integrate and take over the project easily</li><li>Having an application that is easy to test, maintain, and evolve</li></ul><p>In both cases, we use the <strong>SoC</strong> principle (Separation of Concerns) which aims to divide the application into several isolated layers, each being responsible for a different part of the application (a different concern). I divide my applications into four layers:</p><ul><li>The <strong>Presentation</strong> layer manages the display of widgets</li><li>The <strong>Domain</strong> layer handles entities and business logic</li><li>The <strong>Data</strong> or <strong>Infra</strong> layer interacts with external data sources (databases, APIs, services such as Firebase …)</li><li>The <strong>Application</strong> layer connects the Presentation layer with the others layers through services</li></ul><h4>The Layer-first structure</h4><p>As an example, let’s take a very basic blog application with three features: authentication, articles, and comments.<br>In the Layer-first structure (features inside layers), we will architect our project like this:</p><figure><img alt="Layer-first Structure" src="https://cdn-images-1.medium.com/max/364/1*HlLqCAxiwjemIBF5qfQeXg.png" /><figcaption>Layer-first Structure</figcaption></figure><h3>Drawbacks of this approach</h3><ul><li>If we want to add a feature, we will have to create sub-folders in the four folders representing a layer.</li><li>The same goes for modifying or removing a feature. We will have to search for all corresponding files scattered throughout the code.</li><li>When opening the application, we don’t immediately see what it is about (in this case, a blog).</li><li>A developer joining the project will have to navigate through folders to understand each feature and the global functioning of the application, risking getting lost or wasting time.</li><li>If we add many features, the four folders will become too cluttered, and it will be difficult to have clarity.</li></ul><h3>The Feature-first Structure</h3><p>The same app with a Feature-first structure (layers inside features) would look like this:</p><figure><img alt="Feature-first Structure" src="https://cdn-images-1.medium.com/max/363/1*gGI8ApNu9ePmM_aHg46uzg.png" /><figcaption>Feature-first Structure</figcaption></figure><h3>Why use this structure ?</h3><ul><li>We can see immediately that it is a blog-type application with three features. A developer joining the project can easily make it evolve.</li><li>We can easily add, modify or remove features.</li><li>Regardless of the number of features, each folder will contain only four sub-folders.</li><li>Tests will be much easier to set up because they are also grouped by features.</li><li>To make the application evolve, we only need to create a new folder for a new feature.</li></ul><h3>Conclusion</h3><p>The Feature-first structure allows us to see our application not as a monolith but as several independent features that we can add, modify, or remove without disturbing the others.</p><p>This approach is therefore the one to favor in order to respect the SoC principle and within a Clean Architecture to build a scalable and easy-to-maintain, test, and evolve application.</p><p>Don’t hesitate to follow me on <a href="https://linkedin.com/in/nahellachgar">Linkedin</a> and <a href="https://github.com/NahelLachgar">Github</a></p><p>My website : <a href="http://ajensi.io/">ajensi.io</a> (soon in english)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ced20f78ea30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>