<?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 Nabila Khansa on Medium]]></title>
        <description><![CDATA[Stories by Nabila Khansa on Medium]]></description>
        <link>https://medium.com/@kanziebub?source=rss-99e30b0f0dac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3mioPb1ebHfRSbeZ</url>
            <title>Stories by Nabila Khansa on Medium</title>
            <link>https://medium.com/@kanziebub?source=rss-99e30b0f0dac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:18:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kanziebub/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[Migrating Trained PyTorch Model to Rust]]></title>
            <link>https://blog.gopenai.com/migrating-trained-pytorch-model-to-rust-a51869e8a51c?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/a51869e8a51c</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 08:54:38 GMT</pubDate>
            <atom:updated>2024-09-18T10:39:33.312Z</atom:updated>
            <content:encoded><![CDATA[<p>This tutorial will guide you through migrating a trained PyTorch model to Rust using the tch-rs crate—a Rust binding for PyTorch’s C++ API.</p><h4>Why Rust for Machine Learning?</h4><p>Rust offers blazing-fast performance, memory safety, and control over hardware resources. Pairing it with a robust deep learning library like PyTorch opens the door to efficient inference pipelines. Whether you’re deploying your models in production or simply experimenting, this tutorial has you covered.</p><blockquote>The goal of the tch crate is to provide some thin wrappers around the C++ PyTorch api (a.k.a. libtorch). It aims at staying as close as possible to the original C++ api. More idiomatic rust bindings could then be developed on top of this.</blockquote><blockquote>— <a href="https://github.com/LaurentMazare/tch-rs">https://github.com/LaurentMazare/tch-rs</a></blockquote><h3>Step 1: Save the Model in a Rust-Accessible Format</h3><p>First, we need to save the model in a format that Rust can handle using tch-rs.</p><pre>import torch<br><br>model.eval()<br>example_input = torch.rand(1, 3, 224, 224)  <br>              # Replace with an appropriate input for your model<br>traced_model = torch.jit.trace(model, example_input)<br>traced_model.save(&quot;model.pt&quot;)</pre><p>If you previously saved your model in .pth format (like I did with my custom UNet), here’s how you can convert it:</p><pre>import torch<br>from unet import UNet<br><br>model = UNet()<br>model.load_state_dict(torch.load(&quot;best_model.pth&quot;))<br>model.eval()<br><br>example_input = torch.rand(1, 3, 224, 224)<br>traced_model = torch.jit.trace(model, example_input)<br>traced_model.save(&quot;best_model.pt&quot;)<br></pre><p>Here’s a peek at the UNet structure. 💡</p><pre>import torch<br>import torch.nn as nn<br><br>class UNet(nn.Module):<br>    def __init__(self, input_channels=3, output_channels=1):<br>        super(UNet, self).__init__()<br>    <br>        ...<br>    <br>    def forward(self, x):<br>        ...</pre><h3>Step 2: Set Up Libtorch 🛠️</h3><p>We need to install libtorch, the core C++ library that powers PyTorch. Run the following commands to download it:</p><pre>wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.4.0%2Bcpu.zip</pre><p>or</p><pre>curl -O https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.4.0%2Bcpu.zip</pre><h4><strong>Extract </strong><strong>libtorch</strong></h4><p>Next, unzip the package:</p><pre>unzip libtorch-cxx11-abi-shared-with-deps-2.4.0+cpu.zip</pre><h4><strong>Set Environment Variables</strong></h4><p>Don’t forget to set the environment variables so that your system knows where to find libtorch:</p><pre>export LIBTORCH=/path/to/libtorch<br>export LD_LIBRARY_PATH=/path/to/libtorch/lib:$LD_LIBRARY_PATH</pre><p>Then, to check if the variables are properly set, you can run:</p><pre>echo $LIBTORCH<br>echo $LD_LIBRARY_PATH</pre><h3>Step 3: Create a Rust Project 🚀</h3><p>Let’s now begin setting up a fresh project in Rust!</p><h4><strong>Installing Rust with bash</strong></h4><p>First, install Rust if you haven’t already:</p><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh</pre><pre>source $HOME/.cargo/env</pre><pre>rustc --version</pre><h4>Initialize Rust Project</h4><p>Now create your Rust project:</p><pre>cargo new rust_unet_inference<br>cd rust_unet_inference</pre><p>Your project structure should look something like this:</p><pre>rust_unet_inference/<br>├── Cargo.toml<br>└── src<br>    └── main.rs</pre><ul><li><strong>Cargo.toml</strong>: configuration file for your project, containing metadata and dependencies.</li><li><strong>src/main.rs</strong>: main source file for your Rust program.</li></ul><p>Next, let’s add the tch crate (the Rust binding for PyTorch) to the Cargo.toml file:</p><pre>[package]<br>name = &quot;rust_unet_inference&quot;<br>version = &quot;0.1.0&quot;<br>edition = &quot;2021&quot;<br><br>[dependencies]<br>tch = &quot;0.17.0&quot;  # Add tch-rs for PyTorch support in Rust</pre><ul><li><strong>[package]</strong>: metadata about your project (name, version, Rust edition).</li><li><strong>[dependencies]</strong>: a list of libraries (called &quot;crates&quot; in Rust) your project depends on. To add a dependency, specify its name and version under the [dependencies] section.</li></ul><h3>Step 4: Create a Dummy Rust Program</h3><p>Let’s test our setup with a simple Rust program that loads a model and performs a dummy inference on randomized input.</p><p>Update your main.rs to look something like this:</p><pre>use tch::{CModule, Tensor};<br><br>fn main() -&gt; Result&lt;(), Box&lt;dyn std::error::Error&gt;&gt; {<br>    // Load PyTorch model<br>    let model = CModule::load(&quot;best_model.pt&quot;)?;<br>    // Create dummy input tensor for inference<br>    let input = Tensor::randn(&amp;[1, 3, 224, 224], (tch::Kind::Float, tch::Device::Cpu));<br>    // Inference<br>    let output = model.forward_ts(&amp;[input])?;<br>    println!(&quot;Inference output: {:?}&quot;, output);<br>    <br>    Ok(())<br>}</pre><h4>Rebuild and Run Program</h4><p>After writing the code, build and run the project:</p><pre>cargo build<br>cargo run</pre><p>Expected output:</p><pre>Inference output: Tensor[[1, 1, 224, 224], Float]</pre><p>Congrats! You’ve just completed your first Rust-based inference. 🎉</p><p>Links:</p><ul><li><a href="https://github.com/LaurentMazare/tch-rs">https://github.com/LaurentMazare/tch-rs</a></li><li><a href="https://docs.rs/tch/latest/tch/">https://docs.rs/tch/latest/tch/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a51869e8a51c" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/migrating-trained-pytorch-model-to-rust-a51869e8a51c">Migrating Trained PyTorch Model to Rust</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Whale Not For Gacha: Docker]]></title>
            <link>https://kanziebub.medium.com/docker-a-whale-not-for-gacha-306f92c0f037?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/306f92c0f037</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Mon, 13 Jun 2022 14:28:34 GMT</pubDate>
            <atom:updated>2022-06-13T14:30:13.768Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Docker?</strong></p><p>Docker is a free and open platform for building, delivering, and operating apps. Docker allows you to decouple your apps from your infrastructure, allowing you to swiftly release software. You can manage your infrastructure the same way you control your applications with Docker. You may drastically minimize the time between writing code and executing it in production by leveraging Docker’s approaches for shipping, testing, and deploying code quickly.</p><p>Docker allows you to build and run an application in a container, which is a loosely isolated environment. Because of the isolation and security, you can operate multiple containers on the same host at the same time. Containers are small and include everything needed to operate an application, so you don’t have to rely on what’s already on the host. While you’re working, you can quickly share containers and ensure that everyone gets the same container that operates the same way.</p><blockquote><strong>Container</strong></blockquote><blockquote>A container is a runnable instance of an image. Using the Docker API or CLI, you can create, start, stop, move, or destroy a container. You can attach storage to a container, connect it to one or more networks, or even construct a new image based on its existing state.</blockquote><blockquote>A container is often well separated from other containers and its host machine by default. You have control over how isolated a container’s network, storage, and other underlying subsystems are from other containers and the host machine.</blockquote><p><strong>Why Docker?</strong></p><ul><li>Your applications will be delivered quickly and consistently.</li><li>Scalable and responsive deployment.</li><li>Increases the number of workloads that can be run on the same hardware.</li></ul><p><strong>The Docker Desktop</strong></p><p>Docker Desktop is a simple-to-use application for building and sharing containerized applications and microservices on your Mac or Windows computer. Docker Desktop includes Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper, as well as the Docker daemon (dockerd).</p><p><strong>Developing Badaso LMS</strong></p><p>These were the steps taken to setup Badaso LMS Frontend package to start development using Docker to view the result. badaso-lms-demo is a demo repository our team used as an app that uses the packages we’re developing. In its packages folder we have badaso-lms-theme and lms-module</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*tgyoGCiWjRAC6-EpjeY9cQ.png" /><figcaption>badaso-lms-demo/package/badaso/</figcaption></figure><p>[1] git pull origin staging in the badaso-lms-theme folder</p><p>[2] git pull origin staging in the badaso-lms-demo folder</p><p>[3] composer install in the badaso-lms-theme folder</p><p>[4] composer install in the badaso-lms-demo folder</p><p>[5] yarn install in the badaso-lms-demo folder</p><ul><li><strong>IF </strong>yarn doesn’t exist in your computer, make sure you have npm to run npm install --global yarn</li><li><strong>IF</strong> you don’t have npm installed, install NPM: GSGS from google</li><li>Try again to run yarn install</li><li><strong>IF </strong>asked to choose a vuetify-loader version, choose version 1.7.3</li></ul><p>[6] delete this from badaso-lms-demo/routes/web.php:</p><pre>Route::get(&#39;/&#39;, function () { <br>    return view(&#39;welcome&#39;);<br>});</pre><p>[7] docker-compose up OR docker compose up in the badaso-lms-demo folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*EJ-Fx6kYhds8dbw_B0-geg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AyhL5sKVdIX0iFKr1TUyYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*GK_ZtoGyvw4J8-vApgW0MQ.png" /></figure><p>[8] npx mix watch --hot in the badaso-lms-demo folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*0AXDTnZLhV7wCRXYBB8FoQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*fwOoIlnFIPVD_g_QhnXSSg.png" /></figure><p>[9] open <a href="http://localhost/">http://localhost/</a></p><ul><li><strong>IF </strong>you see a Class “Inertia\Middleware&quot; not found error, run composer require inertiajs/inertia-laravelin the badaso-lms-demo folder</li><li>Try again to open <a href="http://localhost/">http://localhost/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvK0hkf5ZIFVNeloTobFkw.png" /></figure><p><strong>Equality in Development</strong></p><p>Thanks to Docker, every member of our development team gets to develop Badaso in their local environment using the same setup without installing requirements individually. No member of the team will face special case issues.</p><blockquote>“That works in your computer? How come it doesn’t work in mine?” — said <strong>no one</strong> in our team.</blockquote><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>References</strong></p><ul><li><a href="https://docs.docker.com/get-started/overview/">Docker overview</a></li><li><a href="https://docs.docker.com/get-started/"></a></li><li><a href="https://docs.docker.com/language/nodejs/develop/">Use containers for development</a></li><li><a href="https://www.avibeweb.com/company/blog/docker/">Docker - Streamlining Web Development</a></li></ul><p><strong>Repositories</strong></p><ul><li><a href="https://github.com/nofamex/badaso-lms-demo">GitHub - nofamex/badaso-lms-demo: Badasa LMS Demo</a></li><li><a href="https://github.com/uasoft-indonesia/badaso-ilma-theme">GitHub - uasoft-indonesia/badaso-ilma-theme: ilma theme is official free theme for badaso LMS module</a></li><li><a href="https://github.com/uasoft-indonesia/badaso-lms-module">GitHub - uasoft-indonesia/badaso-lms-module: Build LMS with badaso</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=306f92c0f037" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Didn’t Know It’d Be This Hard: People Person]]></title>
            <link>https://kanziebub.medium.com/i-didnt-know-it-d-be-this-hard-people-person-8aaa4590fdab?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aaa4590fdab</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Thu, 12 May 2022 20:59:42 GMT</pubDate>
            <atom:updated>2022-05-12T21:54:11.261Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d4SgPwa-P2deLwYf" /><figcaption>Members of ILMA</figcaption></figure><p><strong>August 2021</strong>:<em> </em>It began in our fifth semester, before we had even taken the Software Engineering (RPL) course. During the holidays, one of my current teammates, Fathan, and I collaborated on a freelancing project. I opted to take our RPL course with Fathan because of our previous experience working together. We ended up collaborating with another pair, Ilma and Nopal. Dion joined the group as the deadline for submitting our teams approached.</p><p><strong>January 2022</strong>: The five of us had an excellent understanding of each other’s strengths, limitations, and potential at this stage. We had intended to continue taking PPL with this group. Unexpectedly, an announcement was made announcing that each team should consist of 7 individuals. Ilma invited Aldi and Darren to round out our team to seven people.</p><p>The majority of us had over a half-year to bond, but that doesn’t imply it was an effortless process. To ultimately discover the sweet spot where our team could properly synchronize, it took a lot of understanding, acceptance, and calendar matching. We had some silly misunderstandings in the beginning and I’m not sure if we even started out <em>loving </em>working with each other. However, we put effort into detangling one other’s personalities, despite our inability to figure out whether someone is lying or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xfwLPHHXQqqmPLE5JfHiXw.png" /><figcaption>ILMA without Ilma</figcaption></figure><p>This is an image taken from the first sprint when we decided to go to our campus to set up for developing Badaso LMS. Before we could make any progress, we were suddenly asked if we wanted to help shoot a tutorial video for conducting offline exams. We said yes and managed to have fun while earning a box of free lunch before going back to setting up. After such a refreshing start, we made quite the progress, then decided to go spend the evening eating BBQs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDTATtEgd5S3u7LDhIdVmA.png" /><figcaption>Eating K-BBQs after a good day of hard work</figcaption></figure><p>Other than that one meet up, we mostly spend meetings and daily standup on Discord. Not only on scheduled meetings, we often spend time on Discord whenever we got stuck or found a bug that seems impossible to figure out on our own. Discord has made communication with one another much more efficient and coordinated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*W30PEL-ogVfTTI8kiMBdUQ.png" /></figure><p>The <em>fathan-pls-help</em> voice channel exists because when any of us don’t know how to do something, Fathan usually knows how :). Also, these are the voice channels for our formal meetings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*LZlExV_NAwHsKXP5_cOVyw.png" /><figcaption>ILMA Discord voice channels</figcaption></figure><p>I have tried reading a bunch of articles and posts on what makes a great team, but at the end of the day every single person mix differently, and I am simply happy to be a part of this amazing team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aaa4590fdab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[More Untapped Power: Design Pattern]]></title>
            <link>https://kanziebub.medium.com/design-pattern-a6216ee0710c?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6216ee0710c</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Thu, 12 May 2022 19:06:31 GMT</pubDate>
            <atom:updated>2022-05-12T19:21:02.532Z</atom:updated>
            <content:encoded><![CDATA[<p>Design patterns are conventional solutions to common challenges in software development. They’re similar to schematic outlines that you can tweak to tackle a reoccurring design issue in your code. For a design pattern to be effective, it needs to solve a problem in theory and proven to work in practice.</p><p>Design Patterns are generally grouped into 3:</p><p>[1] Creational Design Pattern: promotes the flexibility and reusability of existing code</p><p>[2] Structural Design Pattern: illustrates how to combine elements and classes into larger structures while keeping flexibility and efficiency in mind</p><p>[3] Behavioral Design Pattern: focuses on the interaction and responsibility of objects</p><p><em>“Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice</em>”</p><p>— Christopher Alexander</p><p><strong>Design Patterns in Badaso LMS</strong></p><p>Badaso LMS currently has some design patterns implemented that I have noticed: Singleton, Facade, and Factory. Here’s a little peak on how each of them works and an example of my implementation on the Factory Method.</p><p><strong>1| Singleton</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*PI0Ca9TiKYapBkIT" /></figure><p><strong>Q</strong>: What is Singleton Pattern?</p><p><strong>A</strong>: The Singleton Pattern is a Creational Pattern that lets you create an instance and only that instance is created. That single instance will be accessible globally, but there won’t be another one like it.</p><p><strong>Q</strong>: When is it useful?</p><p><strong>A</strong>: When you only need one instance for multiple processes to work and any more creation of such instance will only slow the system.</p><p><strong>2| Facade Pattern</strong></p><p><strong>Q</strong>: What is Facade Pattern?</p><p><strong>A</strong>: The Facade Pattern is a Structural Pattern that provides a more user-friendly interface to a complex library, framework, or set of classes.</p><p><strong>Q</strong>: When is it useful?</p><p><strong>A</strong>: When you require a simple but limited interface to a complicated subsystem or/and when you want to divide a subsystem into layers.</p><p><strong>3| Factory Method</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/0*sBx9bkaHTAwXBbQw" /></figure><p><strong>Q</strong>: What is Factory Method?</p><p><strong>A</strong>: The Factory Method is a Creational Design Pattern which provides a superclass with an interface for producing things while allowing subclasses to change the type of objects created.</p><p><strong>Q</strong>: When is it useful?</p><p><strong>A</strong>: The Factory Method separates the code that builds the product from the code that uses it. As a result, it is easier to extend the product without messing with the rest of the code. All you have to do is build a new creator subclass and override the factory function.</p><p><strong>Q</strong>: My implementation in Badaso LMS?</p><p><strong>A</strong>: In Badaso LMS, the Factory method is used for testing. The way we use it is by extending the existing factory class provided by Laravel. This is an example of an implementation I did in the previous sprint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*w6emqJWrxVl_mOen6FmB6Q.png" /><figcaption>MaterialCommentFactory.php</figcaption></figure><p>The MaterialCommentFactory extension of Factory was made to aid unit testing by creating <em>fake</em> MaterialComment objects, here’s a few example of how I used it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*oHNx_ntRDzcOuU5V405LzQ.png" /><figcaption>MaterialCommentApiTest.php 166–187</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*dkVnyLQyuZH2XlPRvQTGLQ.png" /><figcaption>MaterialCommentApiTest.php 189–203</figcaption></figure><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>Without Design Patterns?</strong></p><p><strong>References</strong></p><p><a href="https://sourcemaking.com/design_patterns">https://sourcemaking.com/design_patterns</a></p><p><a href="https://refactoring.guru/design-patterns">https://refactoring.guru/design-patterns</a></p><p>Attached illustrations were made by me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6216ee0710c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modification, Improvement: Code Optimization and Scalability]]></title>
            <link>https://kanziebub.medium.com/modification-improvement-code-optimization-and-scalability-9e04a7be04ba?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e04a7be04ba</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Thu, 12 May 2022 18:23:28 GMT</pubDate>
            <atom:updated>2022-05-12T18:23:28.990Z</atom:updated>
            <content:encoded><![CDATA[<p>When developing a program, we tend to test its acceptance on a smaller scale, forgetting that on a larger scale it might not run as smoothly despite being functionally correct.</p><p><strong>What is Scalability?</strong></p><p>Something is called scalable when it works similarly at a larger scale as it does on a small scale. If it takes a minute for me to read a paragraph but an hour for me to read a book, that means I am not scalable. Also, if a scanner scans a page in a minute and a book in two minutes, that suggests the scanner is more scalable than I am. The ability of a software to scale is referred to as scalability, a highly scalable software would operate well on both a small and a large collection.</p><p><strong>Code Optimization</strong></p><p>Optimization is the process of making something that already exists more efficient while performing the same tasks. This can mean that the same operation will take less time to process, a reduction in the amount of memory required, or simply that less disk space is required. Making trade-offs, such as requiring more memory in exchange for faster processing, is a common part of optimization.</p><p><strong>Scalability and Code Optimization in Badaso LMS</strong></p><p>This is an example of a Badaso LMS optimization I performed, optimizing a multiple query function to retrieve needed data in a single query. It’s not perfect, but it’s the best I could do given the time constraints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/0*l_XfQWXdjcMT_3n-" /><figcaption><strong>Figure 1.</strong> Original Code</figcaption></figure><p>This was the original code I wrote in the first sprint. Back then I was still a total noob and did not have enough knowledge on the programming language as this is my first project with PHP and Laravel. I brute forced my way to make sure the code works, returning the needed data without bothering about code efficiency. I had no idea how to join tables, so I simply took data from one table, loop that data to get data from another table with what I already had,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*aO3JuOK5DmCZgHwZ" /><figcaption><strong>Figure 2.</strong> Code Review</figcaption></figure><p>Obviously, knowing that I made quite a mess, I did not just let it be. I made a refactoring branch to first move the function from CourseUserController to CourseController. In the process, my friend Aldi noticed the smelly code. As he said, the loop weights down heavily on the code performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*ndTdI8lD9u6HEi-p" /><figcaption><strong>Figure 3.</strong> Code Optimization</figcaption></figure><p>After hours of fumbling around the internet, I… still could not comprehend the syntax and how to make it make sense. Fortunately for me, my friend Dion is a lot smarter than me and taught me how he did a simple join tables for his code. I improvised on that and came up with this modified version of my original code.</p><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>Reference</strong></p><p><em>What does “scalability” mean?</em> Stack Overflow. Retrieved April 12, 2022, from <a href="https://stackoverflow.com/questions/9420014/what-does-scalability-mean">https://stackoverflow.com/questions/9420014/what-does-scalability-mean</a></p><p>Difference between Optimization and Scalability? Stack Overflow. Retrieved April 12, 2022, from <a href="https://softwareengineering.stackexchange.com/questions/232487/difference-between-optimization-and-scalability">https://softwareengineering.stackexchange.com/questions/232487/difference-between-optimization-and-scalability</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e04a7be04ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do Your Best with the Right Equipment: Software Development]]></title>
            <link>https://kanziebub.medium.com/do-your-best-with-the-right-equipment-software-development-54189fac4cf7?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/54189fac4cf7</guid>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 10:40:53 GMT</pubDate>
            <atom:updated>2022-04-12T10:40:53.740Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s society, software items are essential for our day-to-day life. Software product development is a difficult task, and in order to stay competitive in today’s environment, rapid software product development is required. It is no longer sufficient to rely on standard software development tools such as the waterfall model, spiral model, and others.</p><p><strong>Agile Methodology</strong></p><p>A methodology is a set of processes, norms, and methods for a specific discipline. Agile values and principles, on the other hand, specifically avoid prescribing any specific methodologies or procedures. Agile values and principles do not attempt to dictate how a team should operate. Instead, they concentrate on assisting team members in thinking and interacting in ways that promote agility. Agility is defined as the ability to adapt and improve your work methods on a continuous basis.</p><p>Agile methodology adheres to the many steps of the SDLC, which follow varied practices for managing software products. Agile procedures are known for encouraging teamwork and discipline management. It is followed by regular examination and modification in supporting sectors in order to keep products up to date with rapidly changing business needs. Some examples of agile practices are SCRUM, XP, Crystal, Pragmatic Programming, Feature Driven Development, DSDM, XBreed.</p><p><strong>Agile Manifesto</strong></p><p>When developers plan to practice agile development, they tend to refer to the manifesto:</p><p><em>“We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:</em></p><p><strong><em>Individuals and interactions</em></strong><em> over processes and tools</em></p><p><strong><em>Working software</em></strong><em> over comprehensive documentation</em></p><p><strong><em>Customer collaboration</em></strong><em> over contract negotiation</em></p><p><strong><em>Responding to change</em></strong><em> over following a plan</em></p><p><em>That is, while there is value in the items on the right, we value the items on the left more”</em></p><p>Many developers embraced the rise of agile approaches with enthusiasm, but it also drew criticism. At least two approaches to agile development can be shown, both with potentially distinct outcomes: There are developers who employ agile methods because they believe in the manifesto’s values and principles, and there are developers who use it because it is considered best practice. The agile manifesto seems to promise a more successful manner of producing software by “simply” adhering to the original values and principles. As a result, the manifesto is unique. Some developers saw the manifesto as the “Holy Grail” for successful software development, while others saw it as a marketing ploy to sell intuitive development behaviour within the software industry.</p><p><strong>SCRUM</strong></p><p>Scrum is an agile strategy that employs an incremental and iterative approach to manage complex work and produce complex software solutions with often changing business requirements. Scrum is applied through meetings. The main scrum events are the sprint planning, the daily scrum, the sprint review, the sprint retrospective, and the sprint itself.</p><p><strong>Roles in SCRUM</strong></p><p>1. Product Owner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/0*FqgMimmfsSTR73Tx" /></figure><p>The product owner has complete control over how the product should look and what features it should have. They are the customers’ and stakeholders’ voices. They manage and prioritize the product backlog while avoiding competing objectives, clarifying instructions, and cultivating stakeholder confidence.</p><p>The product owner has the authority to decide what should and should not be included in the product. Their goal is to make the product as valuable as possible. To be effective, the product owner must have a broad understanding of the business, the customer, and the market in order to be equipped to make crucial decisions for the team.</p><p>2. Scrum Master</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/0*bEYggNcGD0mZqEa0" /></figure><p>The scrum master is a servant-leader who holds the scrum team responsible for the working agreements, scrum values, and scrum frameworks in order to help them perform at their best. They assist the development team by coaching them on self-organization, enhancing team relations and motivation, facilitating scrum events as requested or required, removing roadblocks to the team’s progress, and safeguarding the team from both internal and external interruptions.</p><p>The scrum master is in charge of determining the most effective method for managing product backlogs. They also assist the product owner in understanding and communicating values, as well as planning work with the team to produce the highest level of customer value. The scrum master serves as a change agent, assisting the entire organization in understanding scrum and building a scrum-friendly workplace.</p><p>3. Development Team</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/0*Oro6sBG68T-4tOcD" /></figure><p>The term “developer” refers to anybody involved in the creation of a product, not just engineers. The development team is a self-organizing, cross-functional body that is given the authority to govern its own work. No one has the power to tell the development team how to convert a product backlog into the desired value. The development team, which consists of three to nine members, is preferably co-located and long-lived.</p><p><strong>Scrum Application in Badaso LMS</strong></p><p>Sized to an ideal scrum team, ILMA consists of 7 members, excluding the product owner, with Ilma as the scrum master. At the very start, before any sprints have begun, our product owner identified the requirements of the project and listed them as product backlogs. Each backlog item is categorized into an epic and contains information that includes the user story, description, acceptance criteria, sprint timeline, priority criteria, assignee(s), and story point.</p><p>Every sprint, our scrum master posts backlog items that are to be implemented in that sprint on a project management software. For this purpose, we use GitHub projects so that their completion can be directly linked to the merging of a specified branch. For each sprint, every member of the development team is responsible for the implementation of at least one backlog item, the delegated amount depends on the completion target of that sprint and the story point of the backlog item. In the development process of Badaso LMS, each sprint cycle has a span of three weeks, with an end goal of completing the project in four sprints, totalling twelve weeks of development.</p><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p>“<em>This should be enough.</em>”</p><p>— William Benson</p><p><strong>References</strong></p><p>Hema, V., Thota, S., Kumar, S. N., Padmaja, C., C Bala, R. K., &amp; Mahender, K. (2020). Scrum: An Effective Software Development Agile Tool. IOP Conference Series.Materials Science and Engineering, 981(2) Doi: 10.1088/1757–899X/981/2/022060</p><p>Hohl, P., Klünder, J., Arie, v. B., Lockard, R., Gifford, J., Münch, J., Stupperich, M., &amp; Schneider, K. (2018). Back to the future: origins and directions of the “Agile Manifesto” — views of the originators. Journal of Software Engineering Research and Development, 6(1), 1–27. Doi: 10.1186/s40411–018–0059-z</p><p>Mark Shead. What is Agile Methodology? <em>Youtube</em>. <a href="https://www.youtube.com/watch?v=ZZ_vnqvW4DQ&amp;ab_channel=MarkShead">https://www.youtube.com/watch?v=ZZ_vnqvW4DQ&amp;ab_channel=MarkShead</a></p><p>OeLean. Agile Scrum Roles and Responsibilities: Product Owner, Scrum Master, Development Team. <em>Youtube</em>. <a href="https://www.youtube.com/watch?v=j7T1m2Amc40&amp;ab_channel=OeLean">https://www.youtube.com/watch?v=j7T1m2Amc40&amp;ab_channel=OeLean</a></p><p>Illustrations included are official game assets of the game Eternal Return.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54189fac4cf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Target in Sight: User-Centered Design]]></title>
            <link>https://kanziebub.medium.com/target-in-sight-user-centered-design-1fa7cd481068?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fa7cd481068</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 10:38:52 GMT</pubDate>
            <atom:updated>2022-04-12T10:40:24.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/454/0*Er7NOm-pKJgwBYvh" /></figure><p><strong>What is User-Centered Design?</strong></p><p>User-centered design (UCD) is an iterative design method in which designers pay close attention to users and their demands at every stage of the process. UCD design teams employ a combination of research and design methodologies to incorporate customers throughout the design process, resulting in highly useable and accessible products for them.</p><p><strong>UCD Process</strong></p><ol><li>Specifying the context of use: Determining who will use the product, what it will be used for, and under what conditions it will be used.</li><li>Specifying user requirements: Identifying any business or user goals that must be satisfied for the product to succeed.</li><li>Creating design solutions: This step can be completed in stages, starting with a rough concept and then progressing to a finished design.</li><li>Evaluating the design against the requirements: Ideally done through usability testing with real users, it is as important as quality testing.</li></ol><p><strong>What is a Persona?</strong></p><p>Personas are fictionalized versions of real people. It is a representation of a specific group of people who have similar characteristics, such as behavior, needs, objectives, abilities, and attitudes. Personas allow you to bring your users to life and better understand their issues. Designers can make informed judgments about product features, navigation, interactions, visual design, and much more with this knowledge. Creating a persona for our product is the first step in applying UCD to our project.</p><p><strong>Making a Persona</strong></p><p>To make a persona, you must first have a strong grasp of your target audience (the individuals who will use your product) in order to construct a proper persona. This is crucial because if you don’t understand your target audience, you’ll probably wind up giving them the wrong solution.</p><p>To create a persona, we must first determine what information is required to construct that persona. Personal information such as their name, image, age, where they reside, what they do for a living, and their gender are usually included in a realistic persona. There is also a brief description of who they are, their aim in utilizing the product, their annoyance with using the product, and their incentive for using the product.</p><p>The next step is to create a template or form for the persona. Platforms like PhotoShop, Canva, and Figma can be used for this. Canva and Figma, for example, provide a default template so that all you have to do is fill out the details for your persona. You can also get free templates online.</p><p>As previously stated, it is critical that you understand your target audience. Conducting interviews with at least three potential users is one approach to do this. This is done to confirm our assumptions about the user’s needs. The results of the interviews will confirm or refute our assumptions about our customers. Other than that, relevant information gathered during the interview will be used to create our persona.</p><p><strong>Persona in Badaso LMS</strong></p><p>These are personas made to aid the development process of Badaso LMS. The first persona (figure 1) is a representation of the teacher sub-role and the second persona (figure 2) is a representation of the student sub-role, both of which are part of the customer user role. The existence of these personas helps in visualizing how users would interact with Badaso LMS and what they require.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ttGHVyNyH_Juirhr" /></figure><p><strong>Figure 1.</strong> Badaso LMS Teacher Persona</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tXs4DY8rRzf5BThn" /></figure><p><strong>Figure 2.</strong> Badaso LMS Student Persona</p><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>References</strong></p><p><em>What is user centered design?</em> The Interaction Design Foundation. (n.d.). Retrieved April 12, 2022, from <a href="https://www.interaction-design.org/literature/topics/user-centered-design">https://www.interaction-design.org/literature/topics/user-centered-design</a></p><p>Department of Health and Human Services. (2017, April 3). <em>User-Centered Design Basics</em>. User-Centered Design Basics | Usability.gov. Retrieved April 12, 2022, from <a href="https://www.usability.gov/what-and-why/user-centered-design.html">https://www.usability.gov/what-and-why/user-centered-design.html</a></p><p>Illustrations included are official game assets of the game Eternal Return.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fa7cd481068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Somebody Called for a Cleaner: Refactoring]]></title>
            <link>https://kanziebub.medium.com/somebody-called-for-a-cleaner-refactoring-14705f5504bf?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/14705f5504bf</guid>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Tue, 22 Mar 2022 04:42:54 GMT</pubDate>
            <atom:updated>2022-03-22T18:57:03.611Z</atom:updated>
            <content:encoded><![CDATA[<p>I have previously posted about test-driven development and clean code, tied to both and also as crucial in software development is refactoring. Refactoring is the practice of altering a software system in a way that improves its internal structure while leaving the code’s external behaviour unchanged. It’s a method of cleaning up code that reduces the risks of introducing bugs. In essence, refactoring is the process of enhancing the design of code after it has been written. Refactoring is not something that is delegated for you to do, it is simply expected of you, it is vital to the development process.</p><p>Refactoring is not always needed to achieve clean code, because some geniuses out there just write their code cleanly the first time, but its goal is to have a cleaner code. However, refactoring has its risks, as it brings changes to a proper working code it may introduce bugs. While clean code lets you know of the problems in your code, making the change to get rid of that problem is what you have to overcome in refactoring. This is where tests show their importance, including TDD as a method to test your code. Having tests gives you clear constraints on what breaks the code and how to make sure it works the same externally.</p><p>“<em>Refactoring changes the programs in small steps. If you make a mistake, it is easy to find the bug.</em>”</p><p>— Martin Fowler</p><p><strong>Refactoring in Badaso LMS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*lJ2mRb6HqwmuPiqv" /></figure><p>In the development of Badaso LMS, we have done small refactors here and there to pass the pipeline, and with Aldi around, we usually clean up more than what it takes to simply pass the pipeline. Here are some refactoring examples that we have done in Badaso LMS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*flcr3ldX_i_sRUeA" /></figure><p>I have never used Vue previously nor am I familiar with front-end development and did not know that the standard is to use 2 spaces indentation for all .vue and .js files. Going forward, this was very helpful feedback as I will still be writing on .vue and .js files for the next sprints, and it would definitely be useful to keep in mind for future projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/0*EhuJOCtCnQO-na1g" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*FfGuaTDSbevkMnRd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/0*e3-KGWtLanYO5jB4" /></figure><p>What happened here was that I had a rough time getting used to our back-end stack which is Laravel (PHP), but I didn’t want to just sit anxiously trying to get a good grasp of it and stunt my overall progress. Hence, I decided to start developing the front-end part of my feature first. Since I did not have any data from any API to work with yet, I hard-coded information to fill text spaces. This required me to rework those text spaces to then be filled with proper data from the API I later made. It may look like I had to work twice, but working with the front-end first gave me a good picture of exactly what information I need and gave me a better idea of how I should implement the API.</p><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>References</strong></p><p>Fowler, M., &amp; Beck, K. (2019). <em>Refactoring: Improving the design of existing code</em>. Addison-Wesley.</p><p><em>Refactoring home page</em>. Refactoring. (n.d.). Retrieved March 22, 2022, from <a href="https://refactoring.com/">https://refactoring.com/</a></p><p>Luke illustration is a snippet from the game Eternal Return and was taken from Steam <a href="https://ristek.link/luke-model-snippet">https://ristek.link/luke-model-snippet</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14705f5504bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s Take Out the Trash: Writing Cleaner Code]]></title>
            <link>https://kanziebub.medium.com/lets-take-out-the-trash-writing-cleaner-code-3177fa94f9d3?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/3177fa94f9d3</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[eternal-return]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Tue, 22 Mar 2022 02:42:34 GMT</pubDate>
            <atom:updated>2022-03-22T02:42:34.466Z</atom:updated>
            <content:encoded><![CDATA[<p>Clean code plays a major role in the understandability of a code, along with that so does its readability, changeability, extensibility and maintainability. There are numerous examples of poor code taking organizations down or reducing a decent product into a disaster. Clean code is vital for building a successful maintainable product, especially when you are part of a developer team. You should always think about the next person who will maintain your code.</p><p>First thing first, always follow the standard conventions agreed by the team. The team should be speaking the same language, each member should be able to work with code written by any other member of the team. Next is to keep the code as simple as possible, pretend the person maintaining your code is stupid if you must. Reduce complexity wherever possible.</p><p><em>“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”</em></p><p>— Martin Fowler</p><h4><strong>Some Tips and Examples</strong></h4><ul><li>Consistency is key. If you do anything one way, be sure you do everything else the same way.</li></ul><p>Bad</p><pre>$room-number; // kebab-case is used<br>$roomName;    // camelCase is used</pre><p>Good</p><pre>$course-name;<br>$course-teacher;</pre><ul><li>Variable names should speak for themselves.</li></ul><p>Bad</p><pre>$x; //stores user id<br>$y; //stores course id<br>$z; // stores user’s role in course</pre><p>Good</p><pre>$userId;<br>$courseId;<br>$userRoleInCourse;</pre><ul><li>Boundary conditions should be encapsulated, all their processing should be put in one location as they are hard to keep track of.</li></ul><p>Bad</p><pre>if (studentId + 1 &lt; numberOfStudents) {...}</pre><p>Good</p><pre>nextStudent = studentId + 1;<br>if (nextStudent &lt; numberOfStudents) {...}</pre><ul><li>Dedicated value objects are preferred over primitive types.</li></ul><p>Bad</p><pre>var_dump(“false” == false)</pre><p>Good</p><pre>var_dump((bool) “false”)</pre><ul><li>Reduce logical dependencies, do not write methods that rely on something else in the same class to perform successfully.</li></ul><p>Bad</p><pre>$tag; //default is null<br>method setTag(tagValue) {…}<br>method compareTags(otherTag) {…}</pre><p>Good</p><pre>method compareTags(tag, otherTag) {…}</pre><ul><li>Avoid negative conditionals.</li></ul><p>Bad</p><pre>if !(a &gt; b) {…}</pre><p>Good</p><pre>If (a &lt;= b) {…}</pre><ul><li>When a line of code is no longer needed, do not comment it out, simply remove it.</li></ul><h4><strong>Clean Code in Badaso LMS</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*GrGr6FDu8zEND0Lm" /></figure><p>In the development of Badaso LMS, our development team use two tools for maintaining code quality: StyleCI and SonarQube. StyleCI is a continuous integration tool that enforces your code style preferences automatically. What made it convenient to have is that not only does it point out code smellss, it also show you how to fix them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*wwOJ1x_hFcA2bpAr" /></figure><p>On the other hand, StyleCI is not perfect, and some code smells may pass the check. With that in mind, even when a branch’s pipeline is already green (passed StyleCI and SonarQube) a code review should be done and only when a feature branch has at least 2 approvals from members who are not the author of the code can that branch be merged into staging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*JjAZwEHyaCQchcMi" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*q-jVVRc4wwdeln5C" /></figure><p>By that commit, I have passed both StyleCI code smell check and SonarQube coverage check. However, I was soon enlightened on how tools will never beat a human being.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*X3YQIk5E-tFmyZ_R" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*reLW4eAQs8FiP-jo" /></figure><p>Apparently, this is why code review is important. Without it I would have merged a branch that had still contained code smells. I am truly grateful that I have been blessed by team members who truly care about the quality of the code, not just having it look good in the report. This sprint taught me a lot and I am excited to learn more.</p><p><em>“Are we debugging in a panic, poring over code that we thought worked? Are customers leaving in droves and managers breathing down our necks? How can we make sure we wind up behind the right door when the going gets tough? The answer is craftsmanship.”</em></p><p>— Robert C. Martin</p><p><strong>References</strong></p><p>Martin, Robert C. Clean Code: A Handbook of Agile Software Craftsmanship. Upper Saddle River, NJ: Prentice Hall, 2009. Summarized by wojteklu in <a href="https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29">https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29</a></p><p>Butterfly. (2021, December 8). Clean, high quality code: A guide on how to become a better programmer. Butterfly. Retrieved March 22, 2022, from <a href="https://www.butterfly.com.au/think-pieces/clean-high-quality-code-a-guide-on-how-to-become-a-better-programmer/">https://www.butterfly.com.au/think-pieces/clean-high-quality-code-a-guide-on-how-to-become-a-better-programmer/</a></p><p>Gefroh, J. (2018, September 8). <em>Why consistency is one of the top indicators of good code</em>. Medium. Retrieved March 22, 2022, from <a href="https://jgefroh.medium.com/why-consistency-is-one-of-the-top-indicators-of-good-code-352ba5d62020">https://jgefroh.medium.com/why-consistency-is-one-of-the-top-indicators-of-good-code-352ba5d62020</a></p><p>mohabdelaziz95, M. A. E. (n.d.). <em>Value objects — your savior from primitive obsession</em>. github. Retrieved March 22, 2022, from <a href="https://mohabdelaziz95.github.io/blog/2021/value-objects">https://mohabdelaziz95.github.io/blog/2021/value-objects</a></p><p>Luke illustration was taken then edited from luke.exe (timestamp: 5.19) <a href="https://www.youtube.com/watch?v=4s1KVaZ5bUE&amp;ab_channel=RedPopsicle">https://www.youtube.com/watch?v=4s1KVaZ5bUE&amp;ab_channel=RedPopsicle</a>. Image can be found in <a href="https://ristek.link/luke-exe">https://ristek.link/luke-exe</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3177fa94f9d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Birth Control for Bugs: Test-Driven Development]]></title>
            <link>https://kanziebub.medium.com/birth-control-for-bugs-test-driven-development-41fd93857cc?source=rss-99e30b0f0dac------2</link>
            <guid isPermaLink="false">https://medium.com/p/41fd93857cc</guid>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Nabila Khansa]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 02:23:49 GMT</pubDate>
            <atom:updated>2022-03-21T02:23:49.039Z</atom:updated>
            <content:encoded><![CDATA[<p>Development is hard, not only does it take time and effort, the programming aspect has so many components where things can go wrong. We’re human, we’re bound to make mistakes, that is why coding bugs exist. Adding to that, working in a team means there will be multiple people making these mistakes, creating a bigger and messier mistake. In spite of that, development doesn’t have to be hard, it could be <em>less</em> hard. Something I was taught about around last year was a development method called <em>test-driven development</em>, and honestly, it made my life harder, but more than that, it made development easier, especially when working in teams.</p><p><strong>What is Test-Driven Development?</strong></p><p>Test-driven development, or TDD for short, is a software development method where programmers write automated test cases before writing any code. This method keeps track of software development by frequently testing it against all test cases. The development approach, created by U.S. software developer Kent Beck, outlines and tests how a code will function by developing test cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/0*MYZa4U2orelahDA9" /></figure><p>The creation of failing tests for a piece of functionality under development is the first step in the development process. These tests are nothing but requirement conditions that must go through testing to be accepted. Writing the tests first forces proper thinking of what to expect in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/0*MsbItHhTl_7k7P5_" /></figure><p>Then, a simple code is written to implement that functionality to pass the failing test. Because a tiny piece of code is written at a time to pass the tests, this helps avoid code duplication. This process generates a detailed specification and confirmatory testing for the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*s4vQjGQT-bnwshVo" /></figure><p>Once that is done, that code is refactored to meet a set standard. The unit tests created initially are straightforward and serve as documentation for the code. Hence, other programmers can regard the tests as usage examples of how the code is supposed to work because TDD use cases are written as tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*8r8CD1uBJJh3FbZU" /></figure><p>Q: When do testing is required in the process of implementing a functionality?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*3eoBQW9BSDtB_Ons" /></figure><p>A: No. Companies usually aim for a code coverage of around 80–90%. For a big long-term project, this leaves some wiggle room for changes to be made without breaking the system.</p><p>“<em>Don’t try to achieve 100% code coverage. There’ll be little value in that last 5% to 10%, which makes it a waste of time, effort, and money.</em>”</p><p>“<em>For most applications, a code coverage of 80% to 90% is a very good score.</em>”</p><p>— Peter Morlion, LINEARB</p><p><strong>TDD in Badaso LMS</strong></p><p>At the beginning of the sprint, each member of the development team was assigned a feature (PBI) to implement. In the respective feature branches, we are meant to practice TDD in the development of that feature, marking stages of the TDD cycle with certain tags in the commit message: [RED], [GREEN], [REFACTOR].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/0*sFFex00OpyrMZPce" /></figure><p>At the start of this project, we were not very familiar with the stacks yet, so writing any code at all was rough, let alone creating tests. This issue made practicing TDD became a bit of a setback. However, after getting used to both Laravel and Vue, having tests already made for each bit of functionality sets a clear guide in the development process. Here are some snippets of what the test and code looks like in the commit example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*fY_4DZ-WBnEeiACp" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*Ac2w1oUL8OVdIQJt" /></figure><p>Following the tests, an “Add Course” tag is on the card along with the two buttons, “Create” and “Join”.</p><p>I hope you find this blog helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!</p><p><strong>References</strong></p><p>Hamilton, T. (2022, February 26). <em>What is Test Driven Development (TDD)? tutorial with example</em>. Guru99. Retrieved March 19, 2022, from <a href="https://www.guru99.com/test-driven-development.html">https://www.guru99.com/test-driven-development.html</a></p><p>Novoseltseva, E. (2017, March 2). <em>Benefits of test-driven development — dzone devops</em>. dzone. Retrieved March 19, 2022, from <a href="https://dzone.com/articles/20-benefits-of-test-driven-development">https://dzone.com/articles/20-benefits-of-test-driven-development</a></p><p>Unknown. (2021, June 29). <em>What is TDD– test driven development</em>. Innuy. Retrieved March 19, 2022, from <a href="https://www.innuy.com/blog/what-is-tdd-test-driven-development/">https://www.innuy.com/blog/what-is-tdd-test-driven-development/</a></p><p>Ivo, A. A., Guerra, E. M., Porto, S. M., Choma, J., &amp; Quiles, M. G. (2018). An approach for applying test-driven development (TDD) in the development of randomized algorithms. <em>Journal of Software Engineering Research and Development</em>, <em>6</em>(1). <a href="https://doi.org/10.1186/s40411-018-0053-5">https://doi.org/10.1186/s40411-018-0053-5</a></p><p>Morlion, P. (2022, January 14). <em>Code coverage types: Which is the best?</em> LinearB. Retrieved March 20, 2022, from <a href="https://linearb.io/blog/code-coverage-types/">https://linearb.io/blog/code-coverage-types/</a></p><p>Attached illustrations were made by me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41fd93857cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>