<?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 MRadhitya Utomo (Tomi) on Medium]]></title>
        <description><![CDATA[Stories by MRadhitya Utomo (Tomi) on Medium]]></description>
        <link>https://medium.com/@muhammad.radhitya?source=rss-bd96f3f03413------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PWaeUwgtlk1Hy4nV</url>
            <title>Stories by MRadhitya Utomo (Tomi) on Medium</title>
            <link>https://medium.com/@muhammad.radhitya?source=rss-bd96f3f03413------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:34:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhammad.radhitya/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[SiMagang: UI REVAMP]]></title>
            <link>https://medium.com/@muhammad.radhitya/simagang-ui-revamp-bb53e18ca4ea?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb53e18ca4ea</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Tue, 27 May 2025 04:34:47 GMT</pubDate>
            <atom:updated>2025-05-27T04:34:47.876Z</atom:updated>
            <content:encoded><![CDATA[<h3>Re-Evaluation</h3><p>So last time I talked about UI and adhering to the 10 heuristics we got a a few feedback on the design choices we made. From a follow evaluation we found that:</p><ul><li>The colors are too contrasting</li><li>Some unintuitive design choices for UX when displaying tables of information like logs</li><li>Elements that are not standardized in size nor aesthetic</li><li>Fonts are not standardized, too big, or not fitting for a web view</li></ul><p>These are the iterations I made in quick succession, however it’s apparent my newbie experience on designing websites then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jg-YzN8jOMTIE8wzMXtpAQ.png" /></figure><p>So my teammate and I did some research on the fonts, colors, and usual design details for websites. We benchmarked a whole lot of websites like <a href="http://siasisten.cs.ui.ac.id/">SiAsisten</a>, <a href="https://scele.cs.ui.ac.id/">Scele</a>, <a href="https://www.linkedin.com/feed/">LinkedIn</a>, and a fun one, <a href="https://www.canva.com/">Canva</a>.</p><p>We analyzed and noticed the use of simple colors, not too contrasting, and minimal use of colors aswell. Let the base be an easy to process color like white (or dark if dark mode) and let important elements have the website’s main colors.</p><h3>Design System</h3><p>I also noticed our design system was hard to follow, what were the elements? what font goes where? which colors to use sparingly and which are the main ones?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2xJKq1eBcenSCG7Z" /></figure><p>And here it is. I’ve gotten into graphic design these past few weeks because of interests (music videos, video games) and also taking a game development class that required me to design UI, so I was happy to incorporate a bit of style into the design system.</p><ul><li>The Logo was designed to feature the main color, blue, and a symbol “M” for magang the 2 dots being heads as 2 people being the logo. My friend designed this one to give it a sense of recognizability and charm.</li><li>The main colors are 3 shades of blue forour main branding, green for accents of valid elements like confirm buttons, and the black and yellow for our campus’ iconography.</li><li>The fonts are Montserrat (regular) for <strong>Titles</strong>, Roboto (regular) for <strong>Leading Elements and Body</strong>, and Poppins for <strong>Button Elements. </strong>These are fonts very much used for website and graphic design.</li><li>We added a bit of gradation to elements like the navbar or as we see later, the user’s profile card. This is to give the feeling of a breeze, white fading into this serene oceanic blue color. We wanted to give users that are looking for internships a sense of calmness to better focus on their goals with using our website.</li><li>Navbar are also made adaptable by default with context processors where each role will have a different navbar</li><li>Buttons are more standardized into which ones to use. Primary, Secondary, and Tertiary</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*g27WezHB1QbVyLJb.png" /></figure><h3>Design Standardization in Django</h3><p>To keep everyone’s feature UI consistent we implemented a design template for reusable components in our django codebase. Located in templates =&gt; base.html, classes and styles are defined and ready to be used across the codebase.</p><ul><li>Color</li></ul><pre>:root {<br>  --color-light: #f6f1f1;<br>  --color-sky: #afd3e2;<br>  --color-blue: #19a7ce;<br>  --color-navy: #146c94;<br>  --color-green: #659b5e;<br>  --color-yellow: #feea00;<br>  --color-dark: #333333;<br>}</pre><ul><li>Global elements</li></ul><pre>    &lt;!-- Custom Color Palette &amp; Typography --&gt;<br>    &lt;style&gt;<br>        :root {<br>            /* Color Palette */<br>            --color-light: #f6f1f1;<br>            --color-sky: #afd3e2;<br>            --color-blue: #19a7ce;<br>            --color-navy: #146c94;<br>            --color-green: #659b5e;<br>            --color-yellow: #feea00;<br>            --color-dark: #333333;<br>            <br>            /* Font Families */<br>            --font-montserrat: &#39;Montserrat&#39;, sans-serif;<br>            --font-roboto: &#39;Roboto&#39;, sans-serif;<br>            --font-poppins: &#39;Poppins&#39;, sans-serif;<br>        }<br>        <br>        /* Typography Utility Classes */<br>        .font-montserrat { font-family: var(--font-montserrat); }<br>        .font-roboto { font-family: var(--font-roboto); }<br>        .font-poppins { font-family: var(--font-poppins); }<br>        <br>        /* Color Utility Classes - Backgrounds */<br>        .bg-light { background-color: var(--color-light); }<br>        .bg-sky { background-color: var(--color-sky); }<br>        .bg-blue { background-color: var(--color-blue); }<br>        .bg-navy { background-color: var(--color-navy); }<br>        .bg-green { background-color: var(--color-green); }<br>        .bg-yellow { background-color: var(--color-yellow); }<br>        .bg-dark { background-color: var(--color-dark); }<br>        <br>        /* Color Utility Classes - Text */<br>        .text-light { color: var(--color-light); }<br>        .text-sky { color: var(--color-sky); }<br>        .text-blue { color: var(--color-blue); }<br>        .text-navy { color: var(--color-navy); }<br>        .text-green { color: var(--color-green); }<br>        .text-yellow { color: var(--color-yellow); }<br>        .text-dark { color: var(--color-dark); }<br>        <br>        /* Color Utility Classes - Borders */<br>        .border-light { border-color: var(--color-light); }<br>        .border-sky { border-color: var(--color-sky); }<br>        .border-blue { border-color: var(--color-blue); }<br>        .border-navy { border-color: var(--color-navy); }<br>        .border-green { border-color: var(--color-green); }<br>        .border-yellow { border-color: var(--color-yellow); }<br>        .border-dark { border-color: var(--color-dark); }<br>        <br>        /* Gradients */<br>        .bg-gradient-blue-sky { <br>            background: linear-gradient(to right, var(--color-blue), var(--color-sky)); <br>        }<br>        .bg-gradient-navy-blue { <br>            background: linear-gradient(to right, var(--color-navy), var(--color-blue)); <br>        }<br>        .bg-gradient-light-sky { <br>            background: linear-gradient(to right, var(--color-light), var(--color-sky)); <br>        }<br>        .bg-gradient-navy-green {<br>            background: linear-gradient(135deg, var(--color-navy), var(--color-green));<br>        }<br>        <br>        /* Set global background gradient */<br>        html {<br>            min-height: 100%;<br>            height: 100%;<br>        }</pre><ul><li>Buttons</li></ul><pre>        /* Button effects */<br>        .btn {<br>            transition: all 0.3s ease;<br>            position: relative;<br>            overflow: hidden;<br>        }<br>        <br>        .btn:hover {<br>            transform: translateY(-2px);<br>            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);<br>        }<br>        <br>        .btn:active {<br>            transform: translateY(0);<br>            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);<br>        }<br>        <br>        .btn-blue {<br>            background-color: var(--color-blue);<br>            color: white;<br>        }<br>        <br>        .btn-blue:hover {<br>            background-color: var(--color-navy);<br>        }<br>        <br>        .btn-green {<br>            background-color: var(--color-green);<br>            color: white;<br>        }<br>        <br>        .btn-green:hover {<br>            background-color: #548a4d;<br>        }</pre><ul><li>Form fields</li></ul><pre>        /* Form Field Components */<br>        .form-field {<br>            margin-bottom: 1rem;<br>        }<br><br>        .form-label {<br>            display: block;<br>            font-family: var(--font-poppins);<br>            font-size: 0.875rem;<br>            font-weight: 500;<br>            color: var(--color-navy);<br>            margin-bottom: 0.5rem;<br>        }<br><br>        .form-label-required::after {<br>            content: &quot;*&quot;;<br>            color: #e53e3e;<br>            margin-left: 0.25rem;<br>        }<br><br>        .form-input {<br>            width: 100%;<br>            padding: 0.625rem 0.75rem;<br>            border: 1px solid var(--color-sky);<br>            border-radius: 0.375rem;<br>            font-family: var(--font-roboto);<br>            transition: all 0.2s ease;<br>        }<br><br>        .form-input:focus {<br>            outline: none;<br>            border-color: transparent;<br>            box-shadow: 0 0 0 2px var(--color-blue);<br>        }<br><br>        .form-input-disabled {<br>            background-color: #f9fafb;<br>            color: #6b7280;<br>            cursor: not-allowed;<br>        }<br><br>        .form-select {<br>            width: 100%;<br>            padding: 0.625rem 0.75rem;<br>            border: 1px solid var(--color-sky);<br>            border-radius: 0.375rem;<br>            font-family: var(--font-roboto);<br>            appearance: none;<br>            background-image: url(https://medium.com/&quot;data:image/svg+xml,%3csvg%20xmlns=&#39;http://www.w3.org/2000/svg&#39;%20fill=&#39;none&#39;%20viewBox=&#39;0%200%2020%2020&#39;%3e%3cpath%20stroke=&#39;%236b7280&#39;%20stroke-linecap=&#39;round&#39;%20stroke-linejoin=&#39;round&#39;%20stroke-width=&#39;1.5&#39;%20d=&#39;M6%208l4%204%204-4&#39;/%3e%3c/svg%3e&quot;);<br>            background-position: right 0.5rem center;<br>            background-repeat: no-repeat;<br>            background-size: 1.5em 1.5em;<br>        }<br><br>        .form-textarea {<br>            width: 100%;<br>            padding: 0.625rem 0.75rem;<br>            border: 1px solid var(--color-sky);<br>            border-radius: 0.375rem;<br>            font-family: var(--font-roboto);<br>            min-height: 6rem;<br>        }<br><br>        .form-checkbox {<br>            width: 1rem;<br>            height: 1rem;<br>            border-radius: 0.25rem;<br>            border: 1px solid var(--color-sky);<br>            accent-color: var(--color-blue);<br>        }<br><br>        .form-file {<br>            width: 100%;<br>            padding: 0.5rem;<br>            border: 1px dashed var(--color-sky);<br>            border-radius: 0.375rem;<br>            font-family: var(--font-roboto);<br>            cursor: pointer;<br>        }<br><br>        .form-file::file-selector-button {<br>            padding: 0.25rem 0.75rem;<br>            margin-right: 1rem;<br>            background-color: var(--color-light);<br>            border: 1px solid var(--color-sky);<br>            border-radius: 0.25rem;<br>            transition: all 0.3s ease;<br>        }<br><br>        .form-file::file-selector-button:hover {<br>            background-color: var(--color-sky);<br>        }<br><br>        .form-error {<br>            margin-top: 0.5rem;<br>            padding: 0.5rem 0.75rem;<br>            border-radius: 0.375rem;<br>            background-color: #FEE2E2;<br>            border: 1px solid #FECACA;<br>        }<br><br>        .form-error-message {<br>            color: #B91C1C;<br>            font-family: var(--font-roboto);<br>            font-size: 0.875rem;<br>            font-weight: 500;<br>        }<br><br>        .form-help {<br>            color: #6b7280;<br>            font-family: var(--font-poppins);<br>            font-size: 0.75rem;<br>            margin-top: 0.25rem;<br>        }</pre><h3>Implementation</h3><p>With respects to our previous 10 Heuristics claim, we implemented the design system into our frontend and here are the results:</p><h4>Landing Page</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QfcAQ8iYbX4h3NYkcCsdCQ.png" /></figure><h4>Dashboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMjnVjq6z8E33yN05nQSGA.png" /></figure><p>With the implementation of a resusable design template in our codebase and our team’s adoption to use it UI across all of the website are consistent, standardized, and cleaner in the code. Here are the list of all the benefits:</p><ul><li><strong>Consistent UI</strong> across all pages and user roles (Mahasiswa, Dosen, Penyelia)</li><li><strong>Reduced UI bugs</strong> and rework due to predictable component behavior</li><li><strong>Faster development</strong> since developers could simply include a component instead of rebuilding it</li><li><strong>Easier updates</strong> to visual style via centralized changes</li></ul><h3>Conclusion</h3><p>The transformation of SiMagang through systematic UI standardization and the implementation of a comprehensive design system proved to be one of the most impactful decisions our team made during the development process. By creating reusable components with standardized CSS variables , we eliminated the visual inconsistencies that previously plagued our interface while dramatically improving team productivity. The design system enabled developers to focus on functionality rather than reinventing visual components, reduced debugging time through predictable component behavior, and democratized design decisions by allowing junior developers to implement professional interfaces without extensive design expertise. Most importantly, the centralized styling approach created a sustainable foundation where visual updates can be implemented across the entire platform with minimal effort, while the consistent structure makes onboarding new team members significantly easier and reduces the learning curve for understanding our codebase. This systematic approach transformed our development workflow from a fragmented process into a cohesive, efficient system that not only delivered the calming, professional user experience we envisioned for students navigating internship searches, but also established a template for future projects that treats design systems as first-class development infrastructure rather than an afterthought. Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb53e18ca4ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Song of Silk and Performance]]></title>
            <link>https://medium.com/@muhammad.radhitya/song-of-silk-and-performance-35c7f6f354e5?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/35c7f6f354e5</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[profiling]]></category>
            <category><![CDATA[silk]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Mon, 12 May 2025 19:09:48 GMT</pubDate>
            <atom:updated>2025-05-12T19:09:48.264Z</atom:updated>
            <content:encoded><![CDATA[<p>Performance optimization often feels like a late-stage concern in web development — something we address only after users start complaining about slowness. However, building performance awareness into your development process from the start can save countless headaches down the road. In this article, I’ll show changes I’ve made by observing request latency and iterating for a better performance.</p><p>This time I refactored my code on form submissions for Mahasiswa KP. Basically for when users submit forms with their data for internship. I will show the before and after at the end.</p><h3>Changes Made</h3><h4>1. Added Caching for Active Semester</h4><p>Reduces database queries by storing the active semester in cache for 1 hour. This is particularly effective for frequently accessed data that doesn’t change often.</p><p>Before:</p><pre>python@staticmethod<br>def get_active_semester():<br>    &quot;&quot;&quot;Get currently active semester&quot;&quot;&quot;<br>    return Semester.objects.filter(aktif=True).first()</pre><p>After:</p><pre>@staticmethod<br>def get_active_semester():<br>    &quot;&quot;&quot;Get currently active semester with caching&quot;&quot;&quot;<br>    cache_key = &#39;active_semester&#39;<br>    semester = cache.get(cache_key)<br>    if not semester:<br>        semester = Semester.objects.filter(aktif=True).first()<br>        if semester:<br>            # Cache for 1 hour - adjust as needed<br>            cache.set(cache_key, semester, 60 * 60)<br>    return semester</pre><h4>2. Optimized Field Selection for Existing Registration Check</h4><p>Reduces data transferred from the database by selecting only the necessary fields (id and status_pendaftaran) instead of fetching the entire record.</p><p>Before:</p><pre>@staticmethod<br>def check_existing_registration(mahasiswa, semester):<br>    &quot;&quot;&quot;Check if student already has registration for current semester&quot;&quot;&quot;<br>    return PendaftaranKP.objects.filter(<br>        mahasiswa=mahasiswa,<br>        semester=semester<br>    ).first()</pre><p>After:</p><pre>@staticmethod<br>def check_existing_registration(mahasiswa, semester):<br>    &quot;&quot;&quot;Check if student already has registration for current semester (minimal fields)&quot;&quot;&quot;<br>    return PendaftaranKP.objects.filter(<br>        mahasiswa=mahasiswa,<br>        semester=semester<br>    ).only(&#39;id&#39;, &#39;status_pendaftaran&#39;).first()</pre><p>3. Added Specialized Method for Detailed Registration Retrieval</p><p>Optimizes database access by fetching related objects (mahasiswa, semester, and penyelia) in a single query using select_related(), which prevents the N+1 query problem.</p><p>After:</p><pre>@staticmethod<br>def get_pendaftaran_details(pendaftaran_id, mahasiswa):<br>    &quot;&quot;&quot;Get registration with all related data for display&quot;&quot;&quot;<br>    return PendaftaranKP.objects.filter(<br>        id=pendaftaran_id, <br>        mahasiswa=mahasiswa<br>    ).select_related(<br>        &#39;mahasiswa&#39;,<br>        &#39;semester&#39;,<br>        &#39;penyelia&#39;<br>    ).first()</pre><h4>4. Optimized Success View Implementation</h4><ul><li>Uses the optimized get_pendaftaran_details method instead of get_pendaftaran_by_id</li><li>Adds proper error handling to redirect if the registration is not found</li><li>Improves code readability by organizing the context in a separate variable</li></ul><p>Before:</p><pre>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    service = PendaftaranKPService()<br>    pendaftaran = service.get_pendaftaran_by_id(pendaftaran_id, request.user.mahasiswa)<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, {<br>        &#39;pendaftaran&#39;: pendaftaran,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)<br>    })</pre><p>After:</p><pre>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    service = PendaftaranKPService()<br>    # Use the optimized method instead of get_pendaftaran_by_id<br>    pendaftaran = service.get_pendaftaran_details(pendaftaran_id, request.user.mahasiswa)<br>    <br>    if not pendaftaran:<br>        return redirect(&#39;home_mahasiswa&#39;)<br>        <br>    context = {<br>        &#39;pendaftaran&#39;: pendaftaran,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)<br>    }<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, context)</pre><h3>Results and Analysis</h3><p>Before:</p><p>Here is my checking of the performance in my development domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_51SKqvma2kmkFapSqDsw.png" /></figure><p>I then went up and refactored my code in branch.</p><p>After:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS1hlQELcoglg4iLJLg2Dw.png" /></figure><p><strong>Query Metrics Improvement:</strong></p><ul><li>GET request: Reduced from 8 queries to 7 queries</li><li>GET request timing: Reduced from 17ms to 11ms for query execution</li><li>POST request: Query time improved from 19ms to 7ms</li></ul><p>These changes collectively improved both response time and reduced server load, particularly through the smart use of caching and query optimization. The modifications follow Django best practices for performance optimization while maintaining all the original functionality.</p><h3>Conclusion</h3><p>Performance optimization doesn’t always require dramatic architectural changes. As we’ve seen in this example, thoughtful application of Django’s built-in optimization tools can yield substantial improvements. The changes we implemented — strategic caching, selective field retrieval, and efficient relationship loading — reduced our query count, slashed query execution time, and improved overall response speed.</p><p>What’s particularly satisfying about these optimizations is their minimal impact on code complexity. By working with Django’s ORM features rather than fighting against them, we maintained clean, readable code while achieving better performance. The principles demonstrated here — caching relatively static data, loading only what you need, and avoiding N+1 query problems — can be applied to virtually any Django application.</p><p>Remember that performance optimization is an ongoing process rather than a one-time effort. As your application evolves and usage patterns change, new bottlenecks will emerge. By establishing good practices early and monitoring performance regularly, you can ensure your Django applications remain responsive and efficient, even as they scale to serve more users and handle more complex tasks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35c7f6f354e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLIDifying My Code.]]></title>
            <link>https://medium.com/@muhammad.radhitya/solidifying-my-code-3f166594caf1?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f166594caf1</guid>
            <category><![CDATA[principles-of-design]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Mon, 05 May 2025 17:56:19 GMT</pubDate>
            <atom:updated>2025-05-08T01:50:45.125Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I undertook a significant refactor of my Django project to improve the maintainability and testability of my codebase. Specifically, I refactored my views.py file to implement a <strong>service layer design pattern</strong>. This not only cleaned up my views but also brought my project architecture closer to following the <strong>SOLID principles</strong> of object-oriented design.</p><h3>Service Layer Implementation</h3><p>The main change I made was extracting the business logic from my Django views and moving it into a dedicated service file named Service.py. This service layer is now responsible for handling all the core logic related to KP registrations, such as validating input, interacting with the database, and enforcing business rules.</p><p>My views now serve their original purpose: handling HTTP requests and responses. They delegate the actual logic to the service layer.</p><p>BEFORE:</p><pre>from django.shortcuts import get_object_or_404, render, redirect<br>from django.contrib.auth.decorators import login_required<br>from PendaftaranMahasiswaKP.forms import PendaftaranKPForm<br>from database.models import PendaftaranKP, Semester<br>from kpbackend.views import get_pendaftaran_url<br><br>@login_required<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa<br>    semester_aktif = Semester.objects.filter(aktif=True).first()<br><br>    # Ambil data pendaftaran yang sudah ada<br>    existing_pendaftaran = PendaftaranKP.objects.filter(<br>        mahasiswa=mahasiswa, <br>        semester=semester_aktif<br>    ).first()<br><br>    if existing_pendaftaran:<br>        return render(request, &#39;daftar_kp_gagal.html&#39;, {<br>            &#39;message&#39;: &#39;Anda sudah melakukan pendaftaran program KP di semester ini.&#39;,<br>            &#39;pendaftaran&#39;: existing_pendaftaran  # Kirim objek pendaftaran<br>        })<br>    <br>    if request.method == &#39;POST&#39;:<br>        form = PendaftaranKPForm(request.POST, user=request.user)<br>        if form.is_valid():<br>            pendaftaran = form.save(commit=False)<br>            pendaftaran.mahasiswa = request.user.mahasiswa<br>            pendaftaran.save()<br>            return redirect(&quot;PendaftaranMahasiswaKP:kp_berhasil&quot;, pendaftaran_id=pendaftaran.id) <br>    else:<br>        form = PendaftaranKPForm(user=request.user)<br>    <br>    return render(request, &#39;pendaftaran_kp.html&#39;, {&#39;form&#39;: form,<br>                                                   &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>                                                   &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/mahasiswa)})<br><br>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    pendaftaran = get_object_or_404(PendaftaranKP, id=pendaftaran_id, mahasiswa=request.user.mahasiswa)<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, {&#39;pendaftaran&#39;: pendaftaran,<br>                                                      &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>                                                      &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)})</pre><p>AFTER:</p><pre>from django.shortcuts import render, redirect<br>from django.contrib.auth.decorators import login_required<br>from .forms import PendaftaranKPForm<br>from .services import PendaftaranKPService<br>from kpbackend.views import get_pendaftaran_url<br><br>@login_required<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa<br>    service = PendaftaranKPService()<br>    semester_aktif = service.get_active_semester()<br>    <br>    # Check existing registration<br>    existing_pendaftaran = service.check_existing_registration(mahasiswa, semester_aktif)<br>    if existing_pendaftaran:<br>        return render(request, &#39;daftar_kp_gagal.html&#39;, {<br>            &#39;message&#39;: &#39;Anda sudah melakukan pendaftaran program KP di semester ini.&#39;,<br>            &#39;pendaftaran&#39;: existing_pendaftaran<br>        })<br>    <br>    if request.method == &#39;POST&#39;:<br>        form = PendaftaranKPForm(request.POST, user=request.user)<br>        if form.is_valid():<br>            pendaftaran = service.create_pendaftaran(form, mahasiswa)<br>            return redirect(&quot;PendaftaranMahasiswaKP:kp_berhasil&quot;, pendaftaran_id=pendaftaran.id)<br>    else:<br>        form = PendaftaranKPForm(user=request.user)<br>    <br>    return render(request, &#39;pendaftaran_kp.html&#39;, {<br>        &#39;form&#39;: form,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/mahasiswa)<br>    })<br><br>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    service = PendaftaranKPService()<br>    pendaftaran = service.get_pendaftaran_by_id(pendaftaran_id, request.user.mahasiswa)<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, {<br>        &#39;pendaftaran&#39;: pendaftaran,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)<br>    })</pre><p>And Service layer:</p><pre>from django.shortcuts import get_object_or_404<br>from database.models import PendaftaranKP, Semester<br><br>class PendaftaranKPService:<br>    &quot;&quot;&quot;Service class to handle KP registration business logic&quot;&quot;&quot;<br>    <br>    @staticmethod<br>    def get_active_semester():<br>        &quot;&quot;&quot;Get currently active semester&quot;&quot;&quot;<br>        return Semester.objects.filter(aktif=True).first()<br>    <br>    @staticmethod<br>    def check_existing_registration(mahasiswa, semester):<br>        &quot;&quot;&quot;Check if student already has registration for current semester&quot;&quot;&quot;<br>        return PendaftaranKP.objects.filter(<br>            mahasiswa=mahasiswa,<br>            semester=semester<br>        ).first()<br>    <br>    @staticmethod<br>    def create_pendaftaran(form, mahasiswa):<br>        &quot;&quot;&quot;Create new KP registration&quot;&quot;&quot;<br>        pendaftaran = form.save(commit=False)<br>        pendaftaran.mahasiswa = mahasiswa<br>        pendaftaran.save()<br>        return pendaftaran<br>    <br>    @staticmethod<br>    def get_pendaftaran_by_id(pendaftaran_id, mahasiswa):<br>        &quot;&quot;&quot;Get KP registration by ID&quot;&quot;&quot;<br>        return get_object_or_404(PendaftaranKP, id=pendaftaran_id, mahasiswa=mahasiswa)</pre><p>This refactor wasn’t just about tidying up the code — it was driven by a desire to make my code more <strong>robust, testable, and scalable</strong>. Here’s how it aligns with each of the <strong>SOLID </strong>principles:</p><p><strong>Single Responsibility Principle (SRP):<br>- </strong>Separated business logic into PendaftaranKPService<br>- Views only handle HTTP requests/responses<br>- Each service method has a single responsibility</p><p>views.py handles HTTP requests and responses, forms.py manages form input validation, services.py handles business logic.</p><pre># Service class handles business logic<br>class PendaftaranKPService:<br>    &quot;&quot;&quot;Service class to handle KP registration business logic&quot;&quot;&quot;<br>    <br>    @staticmethod<br>    def get_active_semester():<br>        &quot;&quot;&quot;Get currently active semester&quot;&quot;&quot;<br>        return Semester.objects.filter(aktif=True).first()<br>    <br>    @staticmethod<br>    def check_existing_registration(mahasiswa, semester):<br>        &quot;&quot;&quot;Check if student already has registration for current semester&quot;&quot;&quot;<br>        return PendaftaranKP.objects.filter(<br>            mahasiswa=mahasiswa,<br>            semester=semester<br>        ).first()<br>    <br>    @staticmethod<br>    def create_pendaftaran(form, mahasiswa):<br>        &quot;&quot;&quot;Create new KP registration&quot;&quot;&quot;<br>        pendaftaran = form.save(commit=False)<br>        pendaftaran.mahasiswa = mahasiswa<br>        pendaftaran.save()<br>        return pendaftaran<br>    <br>    @staticmethod<br>    def get_pendaftaran_by_id(pendaftaran_id, mahasiswa):<br>        &quot;&quot;&quot;Get KP registration by ID&quot;&quot;&quot;<br>        return get_object_or_404(PendaftaranKP, id=pendaftaran_id, mahasiswa=mahasiswa)</pre><pre># Views only handle HTTP requests and responses<br>from django.shortcuts import render, redirect<br>from django.contrib.auth.decorators import login_required<br>from .forms import PendaftaranKPForm<br>from .services import PendaftaranKPService<br>from kpbackend.views import get_pendaftaran_url<br><br>@login_required<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa<br>    service = PendaftaranKPService()<br>    semester_aktif = service.get_active_semester()<br>    <br>    # Check existing registration<br>    existing_pendaftaran = service.check_existing_registration(mahasiswa, semester_aktif)<br>    if existing_pendaftaran:<br>        return render(request, &#39;daftar_kp_gagal.html&#39;, {<br>            &#39;message&#39;: &#39;Anda sudah melakukan pendaftaran program KP di semester ini.&#39;,<br>            &#39;pendaftaran&#39;: existing_pendaftaran<br>        })<br>    <br>    if request.method == &#39;POST&#39;:<br>        form = PendaftaranKPForm(request.POST, user=request.user)<br>        if form.is_valid():<br>            pendaftaran = service.create_pendaftaran(form, mahasiswa)<br>            return redirect(&quot;PendaftaranMahasiswaKP:kp_berhasil&quot;, pendaftaran_id=pendaftaran.id)<br>    else:<br>        form = PendaftaranKPForm(user=request.user)<br>    <br>    return render(request, &#39;pendaftaran_kp.html&#39;, {<br>        &#39;form&#39;: form,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/mahasiswa)<br>    })<br><br>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    service = PendaftaranKPService()<br>    pendaftaran = service.get_pendaftaran_by_id(pendaftaran_id, request.user.mahasiswa)<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, {<br>        &#39;pendaftaran&#39;: pendaftaran,<br>        &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>        &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)<br>    })</pre><p><strong>Open/Closed Principle (OCP):<br>- </strong>Service class is open for extension (can add new methods) but closed for modification<br>- Views can use different service implementations without changing their code</p><pre># Form validation logic is encapsulated in the form class<br>class PendaftaranKPForm(forms.ModelForm):<br>    def clean_sks_lulus(self):<br>        # Validation logic<br>    <br>    def clean_jumlah_semester(self):<br>        # Validation logic</pre><p>If I need to add new validation rules, I can extend the form or create a new service method without modifying existing code.</p><p><strong>Liskov Substitution Principle (LSP):</strong><br>- Service methods are stateless and can be used independently<br>- Any subclass of PendaftaranKPService would work the same way</p><pre># The view would work with any service implementation that provides these methods<br>service = PendaftaranKPService()  # Could be substituted with a different implementation</pre><p>This could be further enhanced by defining an abstract base class or protocol for the service.</p><p><strong>Interface Segregation Principle (ISP):</strong><br>- Service methods are focused and specific<br>- Views only depend on the methods they need</p><p>While not explicitly using interfaces (as Python doesn’t have formal interfaces), this follows the spirit of ISP by providing specific service methods:</p><pre># Each service method has a specific purpose<br>service = PendaftaranKPService()<br>semester_aktif = service.get_active_semester()<br>existing_pendaftaran = service.check_existing_registration(mahasiswa, semester_aktif)<br>pendaftaran = service.create_pendaftaran(form, mahasiswa)<br>pendaftaran = service.get_pendaftaran_by_id(pendaftaran_id, request.user.mahasiswa)</pre><p>This allows clients to use only the methods they need without depending on methods they don’t.</p><p><strong>Dependency Inversion Principle (DIP):</strong><br>- Views depend on service abstraction rather than concrete implementations<br>- Easy to mock service layer in tests</p><pre>@login_required<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa<br>    service = PendaftaranKPService()<br>    semester_aktif = service.get_active_semester()<br>    <br>    # Using service methods rather than direct database calls<br>    existing_pendaftaran = service.check_existing_registration(mahasiswa, semester_aktif)<br>    # ...</pre><p>view.py doesn’t directly interact with the database. Instead, it relies on the service layer’s interface, allowing for easier testing and potential implementation changes.</p><h4>BENEFITS</h4><h4>Separation of Concerns</h4><p>The view no longer mixes HTTP and business logic. It delegates responsibilities to the service layer, achieving a <strong>cleaner separation</strong> between presentation and application logic.</p><h4>Improved Testability</h4><p>I can now <strong>test the service methods in isolation</strong>, without the overhead of simulating HTTP requests. This simplifies unit tests and reduces boilerplate.</p><h4>Code Reusability</h4><p>Service methods can be reused across multiple views or even different applications. For example, a get_active_semester() orcheck_existing_registration()method can be reused in both form submissions and API endpoints.</p><h4>Maintainability</h4><p>Business logic changes are now <strong>localized to the service class</strong>. This makes updates easier and reduces the chance of regressions in unrelated parts of the code.</p><h4>Single Responsibility</h4><p>Each component — views, services, and models — now has a <strong>well-defined role</strong>, leading to a more organized and modular codebase.</p><h4>Better Dependency Management</h4><p>Because views depend on service <strong>abstractions</strong>, it’s easier to <strong>swap implementations</strong> or inject mock services in tests without touching the view logic for future testing.</p><h4>POTENTIAL TRADEOFFS</h4><p><strong>Increased Complexity</strong>: Adding another layer increases the complexity of the codebase, especially for simpler operations.</p><pre># Original approach - direct model access in view<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa<br>    semester_aktif = Semester.objects.filter(aktif=True).first()<br>    <br>    # Direct model query in view<br>    existing_pendaftaran = PendaftaranKP.objects.filter(<br>        mahasiswa=mahasiswa, <br>        semester=semester_aktif<br>    ).first()</pre><p><strong>Potential Over-Engineering</strong>: For very simple CRUD operations, a service layer might be unnecessary overhead.</p><pre># Simple method that might be over-engineered<br>@staticmethod<br>def get_active_semester():<br>    &quot;&quot;&quot;Get currently active semester&quot;&quot;&quot;<br>    return Semester.objects.filter(aktif=True).first()</pre><p><strong>Additional Files</strong>: More files and classes to maintain such as service.py</p><p><strong>Django-Specific Concerns</strong>: Somewhat deviates from Django’s typical MVT (Model-View-Template) pattern, potentially causing confusion for developers familiar with standard Django practices.</p><pre># In tests.py - now requires mocking service methods instead of model behavior<br>@patch.object(PendaftaranKPService, &#39;create_pendaftaran&#39;)<br>def test_daftar_kp_with_service(self, mock_create):<br>    mock_create.return_value = MagicMock(id=1)<br>    request = self.factory.post(reverse(&#39;PendaftaranMahasiswaKP:pendaftaran_kp&#39;), data=self.valid_data)<br>    request.user = self.user<br>    response = daftar_kp(request)<br>    self.assertEqual(response.status_code, 302)<br>    mock_create.assert_called_once()</pre><p><strong>Initial Refactoring Cost</strong>: Requires upfront work to refactor existing code and tests to use the service layer pattern.</p><pre># Before - tests would directly test views with model operations<br># After - tests need to be updated to work with the service layer<br>class PendaftaranKPServiceTest(TestCase):<br>    def setUp(self):<br>        # Setting up test data<br>        self.service = PendaftaranKPService()<br><br>    def test_check_existing_registration(self):<br>        # Testing service methods instead of view behavior<br>        result = self.service.check_existing_registration(self.mahasiswa, self.semester)<br>        self.assertIsNone(result)</pre><p>Despite the trade-offs, introducing a service layer and applying SOLID principles has paid off<strong> </strong>in my project. The code is now more modular, easier to test, and ready to scale as the application grows. If you’re working on a mid-size to large Django project or plan to iterate on complex business rules, the service layer pattern is definitely worth considering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f166594caf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Analysis to Assure Quality, Road to 100% Coverage.]]></title>
            <link>https://medium.com/@muhammad.radhitya/static-analysis-to-assure-quality-road-to-100-coverage-4b4e7352646d?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b4e7352646d</guid>
            <category><![CDATA[sonar]]></category>
            <category><![CDATA[static-code-analysis]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Thu, 01 May 2025 18:25:41 GMT</pubDate>
            <atom:updated>2025-05-01T18:25:41.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3lKQvO6t70vn3b-bmFlN7Q.png" /><figcaption>100% Coverage of my team-shared code</figcaption></figure><p>As my time in the Scrum workflow of my software development project, I’ve said in a previous <a href="https://medium.com/@muhammad.radhitya/pipes-and-lines-of-django-development-dd638be6e2c9">blog where I explained my project’s pipeline</a>, I mentioned the use of Sonarqube as a tool to unit test and check our code automatically and detect missing coverages, issues, or messy code. Well in this blog I will explain how exactly it works and what I do in the workflow to ensure a clean 100% coverage.</p><h3>Setup</h3><p>Setting up Sonarqube was a group effort in tinkering with the ci.yml file:</p><pre>sonarqube:<br>  stage: sonarqube<br>  cache:<br>    policy: pull-push<br>    key: &quot;sonar-cache-$CI_COMMIT_REF_SLUG&quot;<br>    paths:<br>      - &quot;${SONAR_USER_HOME}/cache&quot;<br>      - sonar-scanner/     <br>  script: <br>    - sonar-scanner -Dsonar.host.url=&quot;${SONAR_HOST_URL}&quot; -Dsonar.python.coverage.reportPaths=coverage.xml<br>  allow_failure: true</pre><p>and in README</p><pre># BADGES<br>[![Coverage](https://sonarqube.cs.ui.ac.id/api/project_badges/measure?project=siKP-be&amp;metric=coverage&amp;token=sqb_265784336308a9556fc4a51f57c2ae6c96563451)](https://sonarqube.cs.ui.ac.id/dashboard?id=siKP-be)<br>[![Quality Gate Status](https://sonarqube.cs.ui.ac.id/api/project_badges/measure?project=siKP-be&amp;metric=alert_status&amp;token=sqb_265784336308a9556fc4a51f57c2ae6c96563451)](https://sonarqube.cs.ui.ac.id/dashboard?id=siKP-be)</pre><p>And an extra that my teammate added is support for multiple versions of Python (sonar-project.properties):</p><pre>sonar.projectKey=siKP-be<br>sonar.qualitygate.wait=true<br>sonar.exclusions=**/tests/**, **/test_*.py<br>sonar.coverage.exclusions=**/tests/**, **/test_*.py<br><br># Support multiple Python versions<br>sonar.python.version=3.8,3.9,3.10,3.11,3.12</pre><p>At the second sprint we unfortunately ran into problems with the given Sonarqube from our university, thus making it inactive for about 2 weeks. To prepare for things like these again in the future I set up my own sonar albeit locally. First is to download the sonarqube image onto my local machine’s dockerhub with a specified port.</p><pre>docker run -d -p 9000:9000 -p 9092:9092 sonarqube</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r9gt9Xdhzsf59y0EDfjQqw.png" /><figcaption>In the root folder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K1yE0plPfN-Tivu2Gjc_ow.png" /><figcaption>A new docker image has appeared!</figcaption></figure><p>After that, download the sonareqube scanner from <a href="https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/#windows">https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/#windows</a></p><p>Then, after choosing the branch where you want to monitor, and setting up the projectKey, a command is given to run at the root folder, mine was:</p><pre>Analyze &quot;sikpbe&quot;: &lt;&quot;keystring&quot;&gt;</pre><p>and just like that I have my own local analyzer, but only scans one branch at a time as it’s not CI.</p><h3>COVERAGE</h3><p>Coverage is important in unit testing as it covers all of your written code via tests.</p><pre>    def clean(self):<br>        cleaned_data = super().clean()<br>        jumlah_semester = cleaned_data.get(&#39;jumlah_semester&#39;)<br>        sks_lulus = cleaned_data.get(&#39;sks_lulus&#39;)<br>        mahasiswa = self.user.mahasiswa<br>        semester = cleaned_data.get(&#39;semester&#39;)<br>        if PendaftaranKP.objects.filter(mahasiswa=mahasiswa, semester=semester).exists():<br>            raise ValidationError(&quot;Anda sudah mendaftar di semester ini.&quot;)<br>        <br>        # Validasi jumlah semester dan SKS<br>        if (sks_lulus and sks_lulus &lt; 100):<br>            raise ValidationError(&quot;Jumlah SKS lulus untuk mendaftar KP harus antara 100 hingga 144.&quot;)<br>        if (jumlah_semester and jumlah_semester &lt; 6):<br>            raise ValidationError(&quot;Jumlah semester untuk mendaftar KP harus antara 6 hingga 12.&quot;)<br>        <br>        return cleaned_data</pre><p>This was my code for forms.py in PendaftaranMahasiswaKP, and it had some missing coverages like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRX_iVQSW_iTpv5XcImz6w.png" /></figure><p>which I refactored into:</p><pre>    def clean_sks_lulus(self):<br>        sks = self.cleaned_data.get(&#39;sks_lulus&#39;)<br>        if sks is not None and not (100 &lt;= sks &lt;= 144):<br>            raise ValidationError(&quot;Jumlah SKS lulus untuk mendaftar KP harus antara 100 hingga 144.&quot;)<br>        return sks<br><br>    def clean_jumlah_semester(self):<br>        jumlah = self.cleaned_data.get(&#39;jumlah_semester&#39;)<br>        if jumlah is not None and not (6 &lt;= jumlah &lt;= 12):<br>            raise ValidationError(&quot;Jumlah semester untuk mendaftar KP harus antara 6 hingga 12.&quot;)<br>        return jumlah<br><br>    def clean_pernyataan_komitmen(self):<br>        komitmen = self.cleaned_data.get(&#39;pernyataan_komitmen&#39;)<br>        if not komitmen:<br>            raise ValidationError(&quot;Anda harus menyetujui pernyataan komitmen untuk melanjutkan.&quot;)<br>        return komitmen<br><br></pre><p>As you can see I decoupled the clean validations of data for each data field, thus making it easier to test.</p><pre>    def test_clean_method_invalid_sks_less_than_100(self):<br>        &quot;&quot;&quot;Test clean method validation when SKS is less than minimum&quot;&quot;&quot;<br>        invalid_data = self.valid_data.copy()<br>        invalid_data[&#39;sks_lulus&#39;] = 50 <br>        form = PendaftaranKPForm(data=invalid_data, user=self.user)<br>        <br>        self.assertFalse(form.is_valid())<br>        self.assertIn(<br>            &quot;Jumlah SKS lulus untuk mendaftar KP harus antara 100 hingga 144.&quot;,<br>            str(form.errors)<br>        )<br><br>    def test_clean_method_invalid_semester_less_than_6(self):<br>        &quot;&quot;&quot;Test clean method validation when semester is less than minimum&quot;&quot;&quot;<br>        invalid_data = self.valid_data.copy()<br>        invalid_data[&#39;jumlah_semester&#39;] = 3 <br>        form = PendaftaranKPForm(data=invalid_data, user=self.user)<br>        <br>        self.assertFalse(form.is_valid())<br>        self.assertIn(<br>            &quot;Jumlah semester untuk mendaftar KP harus antara 6 hingga 12.&quot;,<br>            str(form.errors)<br>        )</pre><p>I also changed my tests to be more specific to each field and validations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAzxHqEqTv2SAuSkuYtNFQ.png" /><figcaption>Before</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRyszKMBBif5VlPIFzwTzQ.png" /><figcaption>After</figcaption></figure><p>It’s an improvement nonetheless.</p><p>Another example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZpxlus91pv_qlsd0NAcGA.png" /><figcaption>views.py in IsiLogMahasiswa</figcaption></figure><p>Simply added more fitting tests, I had an oversight in my previous test on how delete should’ve been handled. Now tests are more specific and also handles some edge-cases as well. so I refactored it into:</p><pre><br>## test delete log mahasiswa<br>    def test_create_log_POST_partial_week(self):<br>        &quot;&quot;&quot;Bisa buat log mingguan meski tidak 7 hari penuh, asalkan tanggal valid dan aktivitas sesuai&quot;&quot;&quot;<br>        valid_data = {<br>            &#39;tanggal_mulai&#39;: &#39;2024-07-02&#39;,<br>            &#39;tanggal_selesai&#39;: &#39;2024-07-04&#39;,<br>            &#39;aktivitas_harian-TOTAL_FORMS&#39;: &#39;3&#39;,<br>            &#39;aktivitas_harian-INITIAL_FORMS&#39;: &#39;0&#39;,<br>        }<br>        for i in range(3):<br>            valid_data.update({<br>                f&#39;aktivitas_harian-{i}-tanggal&#39;: f&#39;2024-07-0{i+2}&#39;,<br>                f&#39;aktivitas_harian-{i}-jam_mulai&#39;: &#39;09:00&#39;,<br>                f&#39;aktivitas_harian-{i}-jam_selesai&#39;: &#39;15:00&#39;,<br>                f&#39;aktivitas_harian-{i}-deskripsi&#39;: f&#39;Aktivitas {i+1}&#39;,<br>            })<br>        self.client.force_login(self.user1)<br>        response = self.client.post(self.create_log_url, valid_data)<br>        self.assertRedirects(response, reverse(&#39;IsiLogMahasiswa:log_detail&#39;))<br>        self.assertEqual(LogMingguan.objects.count(), 1)<br>        self.assertEqual(AktivitasHarian.objects.count(), 3)<br>    def test_create_multiple_non_overlapping_logs(self):<br>        &quot;&quot;&quot;Bisa membuat 2 log terpisah jika tidak tumpang tindih&quot;&quot;&quot;<br>        self.client.force_login(self.user1)<br>        for i in range(2):<br>            start_day = 2 + (i * 7)<br>            valid_data = {<br>                &#39;tanggal_mulai&#39;: f&#39;2024-07-{start_day:02}&#39;,<br>                &#39;tanggal_selesai&#39;: f&#39;2024-07-{start_day + 6:02}&#39;,<br>                &#39;aktivitas_harian-TOTAL_FORMS&#39;: &#39;2&#39;,<br>                &#39;aktivitas_harian-INITIAL_FORMS&#39;: &#39;0&#39;,<br>            }<br>            for j in range(2):<br>                valid_data.update({<br>                    f&#39;aktivitas_harian-{j}-tanggal&#39;: f&#39;2024-07-{start_day + j:02}&#39;,<br>                    f&#39;aktivitas_harian-{j}-jam_mulai&#39;: &#39;08:00&#39;,<br>                    f&#39;aktivitas_harian-{j}-jam_selesai&#39;: &#39;12:00&#39;,<br>                    f&#39;aktivitas_harian-{j}-deskripsi&#39;: f&#39;Aktivitas mingguan ke-{i+1}&#39;,<br>                })<br>            response = self.client.post(self.create_log_url, valid_data)<br>            self.assertEqual(response.status_code, 302)<br>        self.assertEqual(LogMingguan.objects.count(), 2)<br>    def test_create_log_invalid_jam_sama(self):<br>        &quot;&quot;&quot;Jam mulai dan jam selesai sama harus dianggap invalid&quot;&quot;&quot;<br>        data = {<br>            &#39;tanggal_mulai&#39;: &#39;2024-07-02&#39;,<br>            &#39;tanggal_selesai&#39;: &#39;2024-07-08&#39;,<br>            &#39;aktivitas_harian-TOTAL_FORMS&#39;: &#39;1&#39;,<br>            &#39;aktivitas_harian-INITIAL_FORMS&#39;: &#39;0&#39;,<br>            &#39;aktivitas_harian-0-tanggal&#39;: &#39;2024-07-03&#39;,<br>            &#39;aktivitas_harian-0-jam_mulai&#39;: &#39;09:00&#39;,<br>            &#39;aktivitas_harian-0-jam_selesai&#39;: &#39;09:00&#39;,<br>            &#39;aktivitas_harian-0-deskripsi&#39;: &#39;Aktivitas yang tidak valid&#39;,<br>        }<br>        self.client.force_login(self.user1)<br>        response = self.client.post(self.create_log_url, data)<br>        self.assertEqual(LogMingguan.objects.count(), 0)<br>        self.assertContains(response, &quot;Jam mulai harus sebelum jam selesai&quot;)<br>    def test_create_log_invalid_dates_format(self):<br>        &quot;&quot;&quot;Test kirim format tanggal tidak valid&quot;&quot;&quot;<br>        data = {<br>            &#39;tanggal_mulai&#39;: &#39;02-07-2024&#39;,  # Salah format<br>            &#39;tanggal_selesai&#39;: &#39;08-07-2024&#39;,<br>            &#39;aktivitas_harian-TOTAL_FORMS&#39;: &#39;1&#39;,<br>            &#39;aktivitas_harian-INITIAL_FORMS&#39;: &#39;0&#39;,<br>            &#39;aktivitas_harian-0-tanggal&#39;: &#39;2024-07-03&#39;,<br>            &#39;aktivitas_harian-0-jam_mulai&#39;: &#39;08:00&#39;,<br>            &#39;aktivitas_harian-0-jam_selesai&#39;: &#39;17:00&#39;,<br>            &#39;aktivitas_harian-0-deskripsi&#39;: &#39;Format salah&#39;,<br>        }<br>        self.client.force_login(self.user1)<br>        response = self.client.post(self.create_log_url, data)<br>        # self.assertContains(response, &quot;Masukkan tanggal yang valid.&quot;)<br>        self.assertEqual(LogMingguan.objects.count(), 0)</pre><p>and voila.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jh3KvzjEFHnkKwUDB1Y39A.png" /><figcaption>before</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ntv3YTxL4NWBYQxO7sAhew.png" /><figcaption>after</figcaption></figure><h3>ISSUES</h3><p>Other than coverage, sonar also detects issues or code smells like duplications and such or security. Luckily my code didn’t run into any security issues, although my templates or frontend code did have some issues regarding reliability. In IsiLogMahasiswa templates, log_form.html:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZwUVP2kWTfE15KD1PLGUQ.png" /></figure><p>The problem is that there’s a &lt;label&gt; element with text &quot;Nama&quot; (meaning &quot;Name&quot; in Indonesian), but it isn&#39;t properly connected to any form input element. For proper accessibility, every form label should be explicitly associated with its corresponding form control (like an input field, textarea, or select dropdown).</p><p>The fix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T_gUiehYP_Lknxe-5-hJRw.png" /></figure><p>For each label in the form, there’s now a proper association between the label and its corresponding form control using the for attribute:</p><p>The &lt;label&gt; elements now include a for attribute that references the id of the corresponding element:</p><ul><li>&lt;label for=&quot;id_nama&quot;&gt;Nama&lt;/label&gt; references &lt;div id=&quot;id_nama&quot;&gt;{{ form.nama.value }}&lt;/div&gt;</li><li>&lt;label for=&quot;id_npm&quot;&gt;NPM&lt;/label&gt; references &lt;div id=&quot;id_npm&quot;&gt;{{ form.npm.value }}&lt;/div&gt;</li><li>And so on for “Tempat Magang” and “Role Magang”</li></ul><p>Each &lt;div&gt; that displays the form value has a corresponding id attribute that matches the for attribute of its label.</p><p>This proper association ensures that:</p><ul><li>Screen readers can correctly announce which label belongs to which field</li><li>Clicking on a label would direct focus to its associated form control (though note these are &lt;div&gt; elements, not standard form controls)</li><li>The form meets accessibility standards for label-control association</li></ul><p>The form now passes the accessibility check that was previously failing because each label is properly associated with its corresponding element through the matching for and id attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8CZDw1u3C4R0oCsXK2O_g.png" /><figcaption>before</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_lKmATu6zvnUjZmBAopjA.png" /><figcaption>after</figcaption></figure><h3>Benefits</h3><p>As seen above the benefits of this workflow and sonar as a tool is immense for code quality checking and static analysis of code in general. It helped me with coverage which are now all 100% and resolve issues like control labels in templates regarding reliability. For unit tests it helps me identify edge cases in a function or form, such as the validation bit earlier. It also helps me with decoupling or separating my code if possible with the forms, separating my data cleaning and validation allowing for more specific and edge case tests.</p><h3>Conclusion</h3><p>Static analysis tools like Sonarqube have proven to be invaluable in ensuring code quality throughout my development process. My journey to achieving 100% test coverage demonstrates several important benefits:</p><ol><li><strong>Comprehensive testing</strong>: By refactoring my code and creating more specific test cases, I was able to cover all code paths and edge cases that I previously overlooked.</li><li><strong>Code improvement</strong>: The process naturally led me to better code organization, such as decoupling validation logic in forms to make testing more straightforward and maintainable.</li><li><strong>Issue detection</strong>: Beyond coverage, static analysis identified accessibility issues in my HTML templates that might have otherwise gone unnoticed, improving overall application reliability.</li><li><strong>CI/CD integration</strong>: Setting up Sonarqube in our CI pipeline enabled automated quality checks, ensuring consistent code standards even when the university-provided solution was temporarily unavailable.</li></ol><p>My experience highlights how static analysis is not just about meeting arbitrary coverage metrics, but about creating more robust, reliable, and maintainable software. By addressing coverage gaps, fixing code smells, and resolving accessibility issues, I’ve been able to deliver higher quality applications that better serve users’ needs.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b4e7352646d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scrummed, an Evaluation.]]></title>
            <link>https://medium.com/@muhammad.radhitya/scrummed-an-evaluation-6f8e2dd1f228?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f8e2dd1f228</guid>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[scrum-master]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Thu, 24 Apr 2025 13:01:43 GMT</pubDate>
            <atom:updated>2025-04-24T13:32:55.759Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I will share my experiences of being a Scrum master in a DevOps production team for a campus class project. To recap I’m currently working with 6 other people to develop an internship management application. We employed a SCRUM workflow, having set roles like me being the scrum master, a product owner, and the rest being developers although they highly encouraged to swap roles between sprints to spread out the experience). So what’s it like being a SCRUM master? what are the benefits for the team by having one? and what are the experiences that one can gain by being said role?</p><h3>Establish and Maintain Connections</h3><p>By the first sprint we are all pretty new to each other in class so we had to introduce ourselves. Being the SCRUM master means having to serve your teammates with any of their needs (in relation to the project) this also means making friends and making friends make friends with other teammates easy. Before each sprint we decide on tasks that every member takes, more detail can be read from my first SCRUM article <a href="https://medium.com/@muhammad.radhitya/scrum-here-scrum-there-scrum-everywhere-2f3231793cac">here</a>. From the first sprint I called for standup meetings, scheduled twice a week on Thursday and Sunday, we usually hold them in Discord or asynchronous via messaging apps to track progress of:</p><ul><li>What tasks have you done?</li><li>What tasks are you going to do?</li><li>What problems are you currently facing relating to the project?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5VgJ1V1LBhwayT5bU-VMg.png" /><figcaption>(In Indonesian) each member reports on their progress.</figcaption></figure><p>From the gathered responses we then decided what’s the main problem that everyone is facing, and then we move onto individual problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8D6IBmaztsLkjPmfmR4nQ.png" /><figcaption>Gathered responses</figcaption></figure><p>As a SCRUM master it was my job to identify the main problem and suggest or ask everybody on their take to solve it.</p><p>Next up the importance hierarchy is MORALE, ways I did this were:</p><ul><li><strong>Active Checkups :</strong> Constantly check up on everybody but highest priority on those that haven’t tracked their progress, this makes sure everybody is on the same page.</li><li><strong>Task Management </strong>: By using Jira we portioned the backlogs into sizeable and manageable chunks, how and which are decided together collectively in the sprint planning. Note that developers are highly encourage to share their complaints about the tasks if any, I then need to listen and adjust tasks as needed.</li></ul><h3>Innovative and Team Dynamics — Activities</h3><p>Without proper info on each other’s progress deadlines become bottlenecked, vague commits, and a lot of miscommunication leading to mishandling of a feature equals more debugging in the long run.</p><p>Aside from the usual SCRUM have to(s) we also decided on more team building and intimate (PROJECT DEVELOPMENT) solutions such as:</p><ul><li><strong>Code Reviews</strong> : This can be done by anyone but declaring it a need is crucial. Basically every dev is encourage to check on or ask for help to anyone about their code or development, say A needs something from B, B needs to listen and help A to the fullest if possible. Also because of how the tasks are distributed, some may have a strong intimate connection (still about tasks) to another dev because their tasks line up.</li><li><strong>Synchronous Work Meetings : </strong>Working and coding together while in a call is really handy for those who cannot be in touch face to face, it provides real time progress checking, access to screensharing to immediately squash problems or bugs one might have together, make the tasks clear between devs, and increase solidarity and camaraderie.<br>Before UATs we usually have a meeting, offline or synchronous through discord calls, this is to do preliminary testing making sure everything is up and running to avoid hiccups while presenting to the client. As a SCRUM master I also presented the features of my friends if they are unable to, doing live test cases for example.</li></ul><p>The real world effects of this “<em>Live Coding</em>” activity are:</p><ul><li><strong>Rate of finishing tasks </strong>: From ± 14 days/task to ± 10 days/task.</li><li><strong>Big errors per module</strong> : 4–5 errors to 1–2 errors.</li><li><strong>Discussion participation</strong> rate : 30–40% activeness to 80–90% activeness.</li><li><strong>Assistance frequency</strong> : Sporadic to more frequent and real — time.</li><li><strong>Understanding of the subject matter</strong> : Individually limited to mutual level of understanding.</li></ul><h3>Closing Thoughts</h3><p>In conclusion, as a SCRUM master my job was to serve and connect my teammates in doing their job to create the best possible work environment for the project’s success and member’s enthusiasm, activities that exceeds the usual check up is needed so that everyone feels comfortable and not lost when doing their tasks. I hope this share of my experiences can also be helpful to other SCRUM based teams, thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f8e2dd1f228" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Commandments of UI Heuristics]]></title>
            <link>https://medium.com/@muhammad.radhitya/10-commandments-of-ui-heuristics-c737268e8a9f?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/c737268e8a9f</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[heuristics]]></category>
            <category><![CDATA[figma]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 18:10:15 GMT</pubDate>
            <atom:updated>2025-04-16T18:10:15.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RwQW6imaXm0QB5sYT44imw.png" /><figcaption>Asset pile in figma</figcaption></figure><p>In my Django group project one of the first things before diving deep into development was wireframing, deciding the visual layout of our website’s pages without coding. For this we use Figma, a graphic design application usually used for UI design, graphic design making, or me personally to make backgrounds for my illustrations I did in Clip Studio Paint (but we’re not here to talk about the fun uses right now….)</p><p>For the best possible result we’ll have to follow the 10 Heuristics by Nielsen. These are design principles to ensure quality and user comfortability when they inevitably access our website when deployed.</p><ol><li><strong>Visibility of System Status</strong><br>This refers to how clear the system is on communicating the state of itself for the user, for example in my group’s website Si-KP there’s a difference for logged in and non-logged in user’s view of the landing page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZxoooOnM_petHPpTLYbRQ.png" /><figcaption>Left for non-logged in users. Right for logged in users (mahasiswa).</figcaption></figure><p><strong>2. Match Between System and Real World</strong></p><p>This refers to elements that reference real life objects to make navigating more familiar or easier for users. For example in here, the dashboard has icons of a pencil filling out a box to communicate that it is a button to fill out the details of the Pendaftaran Forms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTXgy12fpSZlYyyXlliQRQ.png" /><figcaption>As seen for the “Detil MBKM” and “Detil KP”</figcaption></figure><p><strong>3. User Control and Freedom</strong></p><p>This refers to giving the user full control of what options they are given, or more simply not locking them to do one single thing when they don’t want to. Example, when the user is filling out the Log form, if they change their mind and not want to fill it out, they can just by pressing the “X” symbol on the top right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*LLC44F6JOATmC1vv4tA7OA.png" /><figcaption>Big red X button to cancel their process if they choose to.</figcaption></figure><p><strong>4. Consistency</strong></p><p>This refers to agreements made between devs. on a design direction, like button designs, what fonts to use, how each container or card should look like, color palettes, etc. This is to ensure harmony and uniformity between designs and pages, so that navigating between different pages don’t feel jarring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*2wIp4yOFNWvm4YCl7goOMg.png" /><figcaption>Asset uniformity</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*1_WIU26nPQEggWCekaJYHw.png" /><figcaption>Deciding on a color palette</figcaption></figure><p><strong>5. Error Prevention</strong></p><p>This refers to safety nets to prevent the user from making mistakes when operating the system, for example reassuring the user to check their filled out form again to minimize or prevent wrong information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*BIrXsePq4z9jpE6x9mOx2g.png" /><figcaption>Halt, check again please.</figcaption></figure><p><strong>6. Recognition Rather than Recall</strong></p><p>This refers to the ability of users to recognize locations of features rather than memorize them. Basically users are supposed to be able to recognize a feature does what just by looking at it rather than having to memorize what it is by doing the whole process beforehand. Navbar is an example of this, it’s convenient for users to just navigate the features from there as seen from the first heuristic’s dashboard image. Another example is the inclusion of a calendar when picking out a date for Logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ZFb9TulN5Vu0KG763tt0oQ.png" /></figure><p><strong>7. Flexibility and Efficiency of Use</strong></p><p>Elements and priority features (depending on the user’s role) should be conveniently placed on the system. For example the mahasiswa’s top priority of accessing our Si-KP is to sign up for KP/MBKM, fill out details, and manage logs and laporan. So in the dashboard from number 1, they are all visible and accessible just within a click.</p><p><strong>8. Aesthetic and Minimalist Design</strong></p><p>Self explanatory, a minimalist design means stripping the visual information down to only what is needed, a couple of flourishes for aesthetic purposes is fine but don’t let it overwhelm the main purpose of a page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8G1jChrXeNNpk_3_YJdISQ.png" /></figure><p>As in the images, for dashboard the elements are only those related to signing up for KP/MBKM. And in the logs page it’s only the user’s information and saved logs.</p><p><strong>9. Help Users with Errors.</strong></p><p>This refers to the system required to help out the user if they are currently lost or an error or mistake is happening, the system needs to communicate exactly what is wrong. For example filling out the logs form, if a data filled out by the user is invalid, then the system will call them out on it so the user understands what they filled out wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHN9D-78OydQFwhGWRJjmg.png" /></figure><p><strong>10. Help and Documentation</strong></p><p>The last heuristic is referring to a way for users to learn about the system in general at their own pace. This can be done by providing them an FAQ page or guide page to of course, guide them about what does what, how to go where, etc.</p><p><strong>Benchmarks</strong></p><p>Benchmarks are reference points where we can learn how a design is done or how other products approach the same scenario in terms of design.</p><ol><li><strong>Scele</strong></li></ol><p>SCELE features the addition of deadline information for each assignment, displayed clearly. This concept can be applied to SIKP by adding time indicators to features such as logs or program registration, so students are more aware of applicable deadlines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*Erl5SVtbdQmXvNT4tbHmPA.png" /></figure><p>2. <strong>Sibangku</strong><br>The Sibangku system uses a card format to display students’ daily activities. This format provides a concise yet informative layout. A similar implementation in the weekly log section of SIKP would make it easier for students to view and understand their recorded activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wyD9qW8lpYRNBw8tYHK1g.png" /></figure><p><strong>3. SIAKNG</strong></p><p>SiakNG provides status notifications for processes such as submissions and approvals. SIKP adopts this approach by displaying the status of weekly logs and program registrations, whether they have been approved by the supervisor or are still pending.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/0*bGGJxCEhZP4iV4Wu.png" /></figure><p><strong>Conclusion</strong></p><p>By applying solid usability principles and learning from similar applications, the SIKP UI is expected to provide comfort, efficiency, and clarity for users in carrying out the administrative processes of the internship/”magang” program digitally.</p><p>Reference: <a href="https://www.nngroup.com/articles/ten-usability-heuristics/">https://www.nngroup.com/articles/ten-usability-heuristics/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c737268e8a9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pipes and Lines of Django Development]]></title>
            <link>https://medium.com/@muhammad.radhitya/pipes-and-lines-of-django-development-dd638be6e2c9?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd638be6e2c9</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[cicd-pipeline]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 16:40:21 GMT</pubDate>
            <atom:updated>2025-04-16T16:40:21.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5zIvKa180i4LfBdt" /></figure><p>CICD in software or web development is an important setup or step that acts as a safety net for developers when working, basically it’s a sort of automated checker (hence quality checks) for the code that are pushed into the repo, those who have met the quality checks with no errors, bugs, or noncovered codes are then accepted into the staging branch which will be automatically deployed onto the website.</p><p>CICD is great in comparison to checking manually because it cuts the monotonous work of testing and deploying from developers so they can focus on creating code and solving problems.</p><p><strong>Deployment Architecture in Django</strong></p><p>In my project currently I am using Django and with these specifications</p><ul><li>Backend using python</li><li>Frontend using tailwind</li><li>Docker for deployment</li><li>Gitlab CI/CD for testing pipeline</li><li>Sonarqube for Quality gate checks (security hotspots, code coverages, etc.)</li></ul><p><strong>CI/CD Pipeline</strong></p><p>Here is my flow for the pipeline</p><pre>stages:<br>  - unit_test<br>  - sonarqube<br>  - build<br>  - deploy</pre><p>As per above, the code that are pushed will be tested, quality checked, built, then finally deployed.</p><ol><li><strong>Unit Testing</strong><br>Unit testing will be done by checking the test folders on each feature, there it will run each test accordingly and determine if it’s clean or not.</li></ol><pre>unit_test:<br>  stage: unit_test<br>  image: python:3.12  <br>  services:<br>    - name: postgres:16<br>    - selenium/standalone-chrome<br>  variables:<br>    DATABASE_URL: &quot;postgres://$DB_USER:$DB_PASSWORD@postgres:5432/$DB_NAME&quot;<br>    DB_HOST: &quot;postgres&quot;<br>    POSTGRES_DB: $DB_NAME<br>    POSTGRES_USER: $DB_USER<br>    POSTGRES_PASSWORD: $DB_PASSWORD<br>  before_script:<br>    - apt-get update<br>    - python -m venv env<br>    - source env/bin/activate<br>    - pip install --no-cache-dir -r requirements.txt<br>  before_script:<br>    - apt-get update<br>    - python -m venv env<br>    - source env/bin/activate<br>    - pip install --no-cache-dir -r requirements.txt<br><br>  script:<br>    - python manage.py makemigrations database <br>    - python manage.py migrate --noinput<br>    - coverage run --source=&#39;.&#39; manage.py test<br>    - coverage xml  # Generate XML report for SonarQube<br>  artifacts:<br>    paths:<br>      - coverage.xml  # Preserve coverage.xml for next stage<br>    expire_in: 1h</pre><p><strong>2. Quality Check<br></strong>Code that passed the unit test will then be quality checked by SonarQube</p><pre>sonarqube:<br>  stage: sonarqube<br>  cache:<br>    policy: pull-push<br>    key: &quot;sonar-cache-$CI_COMMIT_REF_SLUG&quot;<br>    paths:<br>      - &quot;${SONAR_USER_HOME}/cache&quot;<br>      - sonar-scanner/     <br>  script: <br>    - sonar-scanner -Dsonar.host.url=&quot;${SONAR_HOST_URL}&quot; -Dsonar.python.coverage.reportPaths=coverage.xml<br>  allow_failure: true</pre><p><strong>3. Build<br></strong>For staging, a docker image is created with a specific tag. This is done for both staging and production.</p><pre>build_staging:<br>  stage: build<br>  image: docker:20.10.16<br>  services:<br>  - name: docker:20.10.16-dind<br>    command: [&quot;--tls=false&quot;]<br>  before_script:<br>  - unset DOCKER_HOST<br>  - docker login -u &quot;$DOCKERHUB_USERNAME&quot; -p &quot;$DOCKERHUB_PASSWORD&quot;<br>  script:<br>    - docker build --pull -t $DOCKER_REPO:staging-$CI_COMMIT_SHA .<br>    - docker push $DOCKER_REPO:staging-$CI_COMMIT_SHA<br>  only:<br>    - staging<br><br><br>build_production:<br>  stage: build<br>  image: docker:20.10.16<br>  services:<br>  - name: docker:20.10.16-dind<br>    command: [&quot;--tls=false&quot;]<br>  before_script:<br>  - unset DOCKER_HOST<br>  - docker login -u &quot;$DOCKERHUB_USERNAME&quot; -p &quot;$DOCKERHUB_PASSWORD&quot;<br>  script:<br>    - docker build --pull -t $DOCKER_REPO:latest .<br>    - docker push $DOCKER_REPO:latest<br>  only:<br>    - main</pre><p><strong>4. Deploy<br></strong>Deployment is done the same to both using SSH and environment variables.</p><pre>deploy_staging:<br>  stage: deploy<br>  image: docker:20.10.16<br>  services:<br>  - name: docker:20.10.16-dind<br>    command: [&quot;--tls=false&quot;]<br>  before_script:<br>  - unset DOCKER_HOST<br>  - apk upgrade &amp;&amp; apk add openssh sshpass<br>  script:<br>  - |<br>    sshpass -p &quot;$SSH_PASSWORD&quot; ssh -o StrictHostKeyChecking=no ${SERVER_USER}@${SERVER_HOST} &quot;bash -c \<br>    &#39;export http_proxy=\&quot;http://proxy.cs.ui.ac.id:8080\&quot; &amp;&amp; \<br>    export https_proxy=\&quot;http://proxy.cs.ui.ac.id:8080\&quot; &amp;&amp; \<br>    export no_proxy=\&quot;localhost,127.0.0.1,172.16.0.0/12,192.168.0.0/16,224.0.0.0/24\&quot; &amp;&amp; \<br>    docker login -u \\$DOCKERHUB_USERNAME -p \\$DOCKERHUB_PASSWORD &amp;&amp; \<br>    docker pull \\$DOCKER_REPO:staging-$CI_COMMIT_SHA &amp;&amp; \<br>    docker stop sikp-be-staging || true &amp;&amp; \<br>    docker rm sikp-be-staging || true &amp;&amp; \<br>    docker system prune -af &amp;&amp; \<br>    docker create -p 8001:8000 -e ENV=staging --env-file .env --name sikp-be-staging -v /staging/staticfiles:/sikp-be/staticfiles \\$DOCKER_REPO:staging-\\$CI_COMMIT_SHA &amp;&amp; \<br>    docker start sikp-be-staging &amp;&amp; \<br>    docker cp .env sikp-be-staging:.env &amp;&amp; \<br>    docker exec sikp-be-staging python manage.py makemigrations database &amp;&amp; \<br>    docker exec sikp-be-staging python manage.py migrate --noinput &amp;&amp; \<br>    sudo systemctl restart nginx&#39;&quot;<br>  only:<br>  - staging<br><br>deploy_production:<br>  stage: deploy<br>  image: docker:20.10.16<br>  services:<br>  - name: docker:20.10.16-dind<br>    command: [&quot;--tls=false&quot;]<br>  when: manual<br>  before_script:<br>  - unset DOCKER_HOST<br>  - apk upgrade &amp;&amp; apk add openssh sshpass<br>  script:<br>  - |<br>    sshpass -p &quot;$SSH_PASSWORD&quot; ssh -o StrictHostKeyChecking=no ${SERVER_USER}@${SERVER_HOST} &quot;bash -c \<br>    &#39;export http_proxy=\&quot;http://proxy.cs.ui.ac.id:8080\&quot; &amp;&amp; \<br>    export https_proxy=\&quot;http://proxy.cs.ui.ac.id:8080\&quot; &amp;&amp; \<br>    export no_proxy=\&quot;localhost,127.0.0.1,172.16.0.0/12,192.168.0.0/16,224.0.0.0/24\&quot; &amp;&amp; \<br>    docker login -u \\$DOCKERHUB_USERNAME -p \\$DOCKERHUB_PASSWORD &amp;&amp; \<br>    docker pull \\$DOCKER_REPO:latest &amp;&amp; \<br>    docker stop sikp-be || true &amp;&amp; \<br>    docker rm sikp-be || true &amp;&amp; \<br>    docker system prune -af &amp;&amp; \<br>    docker create -p 8000:8000 -e ENV=production --env-file .env --name sikp-be -v /prod/staticfiles:/sikp-be/staticfiles \\$DOCKER_REPO:latest &amp;&amp; \<br>    docker start sikp-be &amp;&amp; \<br>    docker exec sikp-be python manage.py migrate --noinput &amp;&amp; \<br>    sudo systemctl restart nginx&#39;&quot;<br>  only:<br>  - main</pre><p><strong>Conclusion</strong></p><p>The CI/CD development pipeline sets up so much time for developers to be focusing on writing code rather than testing or deploying. Checks that would be agonizing to monitor by the human eye like code duplications or code smells can be automatically detected by services like SonarQube! And on top of that unoptimized code will also be filtered by it’s quality gate so it won’t ruin deployed code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd638be6e2c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Code and Oh, WASP]]></title>
            <link>https://medium.com/@muhammad.radhitya/securing-code-and-oh-wasp-8adcd166f9f3?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/8adcd166f9f3</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[secure-coding]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Tue, 08 Apr 2025 02:30:54 GMT</pubDate>
            <atom:updated>2025-04-08T02:30:54.921Z</atom:updated>
            <content:encoded><![CDATA[<p>This time I looked back at my code from the first sprint and applied some secure programming flavours on it.</p><h4>Basic Level</h4><p>This is the very top or basic level of secure programming, consisting of simple error preventions or validation handling.</p><ol><li>Implemented duplicate preventions such as checking for exists()</li></ol><pre>    def clean(self):<br>        cleaned_data = super().clean()<br>        mahasiswa = getattr(self.user, &#39;mahasiswa&#39;, None)<br>        semester = cleaned_data.get(&#39;semester&#39;)<br><br>        # This checks if the pendaftaranKP instance that we are creating is not a duplicate.<br>        if mahasiswa and semester:<br>            if PendaftaranKP.objects.filter(mahasiswa=mahasiswa, semester=semester).exists():<br>                raise ValidationError(&quot;Anda sudah mendaftar di semester ini.&quot;)<br><br>        return cleaned_data</pre><p>2. Disabled Fields for secure information and validation<br>This is mostly in the forms.py part of my project where I implemented non active or non-interactable fields that are only for giving out information. For input validation, fields have constraints and conditions that are cleaned before use.</p><pre>def clean_sks_lulus(self):<br>        sks = self.cleaned_data.get(&#39;sks_lulus&#39;)<br>        if sks is not None and not (100 &lt;= sks &lt;= 144):<br>            raise ValidationError(&quot;Jumlah SKS lulus untuk mendaftar KP harus antara 100 hingga 144.&quot;)<br>        return sks<br><br>    def clean_jumlah_semester(self):<br>        jumlah = self.cleaned_data.get(&#39;jumlah_semester&#39;)<br>        if jumlah is not None and not (6 &lt;= jumlah &lt;= 12):<br>            raise ValidationError(&quot;Jumlah semester untuk mendaftar KP harus antara 6 hingga 12.&quot;)<br>        return jumlah<br><br>    def clean_pernyataan_komitmen(self):<br>        komitmen = self.cleaned_data.get(&#39;pernyataan_komitmen&#39;)<br>        if not komitmen:<br>            raise ValidationError(&quot;Anda harus menyetujui pernyataan komitmen untuk melanjutkan.&quot;)<br>        return komitmen<br><br>    def clean_semester(self):<br>        semester = self.cleaned_data.get(&#39;semester&#39;)<br>        if semester and not semester.aktif:<br>            raise ValidationError(&quot;Semester yang dipilih tidak aktif.&quot;)<br>        return semester<br><br>    def clean(self):<br>        cleaned_data = super().clean()<br>        mahasiswa = getattr(self.user, &#39;mahasiswa&#39;, None)<br>        semester = cleaned_data.get(&#39;semester&#39;)<br><br>        # Cek duplikat pendaftaran<br>        if mahasiswa and semester:<br>            if PendaftaranKP.objects.filter(mahasiswa=mahasiswa, semester=semester).exists():<br>                raise ValidationError(&quot;Anda sudah mendaftar di semester ini.&quot;)<br><br>        return cleaned_data</pre><p>3. Authentication and Authorization<br>The feature in my code is only available to logged in users, and the users being strictly of the mahasiswa type, to implement this in Django simply use the ‘@login_required’ decorator in views that needs to be restricted. Requests or logged in users are also checked for their roles by ‘request.user.mahasiswa’.</p><p>Example of a view in my views.py that contains authorization and authentication, used by mahasiswa to fill in the pendaftaranKP form to then be checked if the mahasiswa in question is valid.</p><pre>@login_required<br>def kp_berhasil(request, pendaftaran_id):<br>    pendaftaran = get_object_or_404(PendaftaranKP, id=pendaftaran_id, mahasiswa=request.user.mahasiswa)<br>    return render(request, &#39;daftarkp_berhasil.html&#39;, {&#39;pendaftaran&#39;: pendaftaran,<br>                                                      &#39;dashboard_url&#39;: &#39;/home_mahasiswa/&#39;,<br>                                                      &#39;pendaftaran_url&#39;: get_pendaftaran_url(https://medium.com/pendaftaran.mahasiswa)})</pre><p>Same with checking before entering the form page aswell, incase a user that’s not mahasiswa bruteforced their way to the feature via endpoints</p><pre>@login_required<br>def daftar_kp(request):<br>    mahasiswa = request.user.mahasiswa</pre><h3>OWASP</h3><p>What is OWASP? it’s basically a community that’s the go to authority and Guru so to speak for secure web programming, it has a top 10 that’s the guide for people wanting to implement secure programming in their code.</p><p>1. <strong>Broken Access Control<br></strong>Users accessing data or functions they shouldn’t.</p><p>2. <strong>Cryptographic Failures<br></strong>Weak/missing encryption or secret storage</p><p>3. <strong>Injection<br></strong>SQL, NoSQL, OS, and other injection flaws</p><p>4. <strong>Insecure Design<br></strong>Poor security decisions during system design</p><p>5. <strong>Security Misconfiguration<br></strong>Default settings, error messages, etc.</p><p>6. <strong>Vulnerable Components<br></strong>Using outdated libraries, unpatched software</p><p>7. <strong>Identification &amp; Authentication Failures<br></strong>Weak login mechanisms, session issues</p><p>8. <strong>Software &amp; Data Integrity Failures<br></strong>Gaps in code signing, CI/CD pipeline risks</p><p>9. <strong>Security Logging &amp; Monitoring Failures<br></strong>No logging/auditing in place</p><p>10. <strong>Server-Side Request Forgery (SSRF)<br></strong>Backends making unintended requests</p><p>In my code, it hasn’t fully implemented all of these top 10, only some:</p><p># <strong>Authentication and Authorization</strong><br> As previously shown, using Django’s built-in authentication, enforced role-based access, and made sure permissions were tightly controlled. (<em>Covers: Broken Access Control, Authentication Failures</em>)</p><p># <strong>Form and Input Validation</strong><br> All user inputs were validated using Django forms and serializers, and I used clean_&lt;field&gt;() methods to apply custom logic. (<em>Covers: Injection, Insecure Design</em>)</p><p># <strong>Secure Defaults</strong><br> Debug mode turned off in production, used secure cookies (SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE). (<em>Covers: Security Misconfiguration</em>)</p><pre>   &lt;!-- Form Section --&gt;<br>    &lt;div class=&quot;bg-white p-8 rounded-lg shadow col-span-1 row-span-2&quot;&gt;<br>        &lt;h1 class=&quot;text-3xl font-bold text-gray-800 mb-8 border-b-2 border-gray-200 pb-4&quot;&gt;Form Pendaftaran KP&lt;/h1&gt;<br>        <br>        &lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; class=&quot;space-y-8&quot;&gt;<br>            {% csrf_token %}</pre><p>Also implemented default field forms.</p><pre>    nama = forms.CharField(disabled=True, required=False, label=&quot;Nama Mahasiswa&quot;)<br>    npm = forms.CharField(disabled=True, required=False, label=&quot;NPM&quot;)<br>    email = forms.EmailField(disabled=True, required=False, label=&quot;Email Mahasiswa&quot;)<br>    prodi = forms.CharField(disabled=True, required=False, label=&quot;Program Studi&quot;)</pre><h3>SDLC</h3><p>SDLC is basically the outer ring of security, it dictates development security on a pipeline scale like profiling, monitoring, automated deployments and testing.</p><p>For this I’ve implemented Sonarqube monitoring to check for code quality, code security hotspots, and code coverage. Every time I commit a new change it automatically runs a pipeline to test the code base, if passed then it will continue to stay in my branch available for merging. Merging is also automated in the side of deployment, if no errors or failed tests come in way then the passed code will be automatically deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnvMeOm15NXyEGiXnqIZFw.png" /><figcaption>Overview of code coverage</figcaption></figure><p>Right now the Sonarqube is down from the campus’ server side, so no further checks are currently being done.</p><p>Other checks of security can be done by human hands as well in the shape of code reviews by peers when merging is requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7okNyMAElv1rOS3Y5B16Fg.png" /><figcaption>Giving appreciation and suggestions when a code is requested to merge into the deployed “staging” branch</figcaption></figure><p>Unit tests are also a big part on SDLC, that’s why we opted on using TDD principles to test our code first before shipping.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8adcd166f9f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sprinting for Our Lives: Team Project Declarations for Progress Checking]]></title>
            <link>https://medium.com/@muhammad.radhitya/sprinting-for-our-lives-team-project-declarations-for-progress-checking-c90e269bfd74?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/c90e269bfd74</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[sprint-planning]]></category>
            <category><![CDATA[sprint]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 17:23:48 GMT</pubDate>
            <atom:updated>2025-03-25T02:30:56.020Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been 1 sprint since my team has been doing SCRUM on the University Project for Software Eng. class. Here is our workflow that we have agreed to including Definition of Done(s) for checking work quality.</p><h3>Our Scrum Workflow</h3><p>Each sprint lasts for <strong>three weeks</strong>, and we define a <strong>sprint goal</strong> at the beginning. The sprint goal represents the primary objective for that sprint. For instance, in Sprint 1, our goal was to enable <strong>students to register for internships (KP/MBKM) and get approval from their academic advisors (Dosen PA). </strong>Once the goal is established, we break down related tasks from the backlog and assign them to team members.</p><h4>JIRA Backlogs Manager</h4><p>Same as my previous story, we are using JIRA to keep up with tasks and who’s assigned to what, once the DoD is fulfilled for that task we would check the tasks to be DONE.</p><p>If there are issues or unfinished features from the first sprint, we put them onto the next sprint and plan our new tasks according to the previous unfinished tasks’ weight.</p><h4>Development Process and Standup Meetings</h4><ul><li>Each member works on their assigned features throughout the week.</li><li>We conduct standup meetings <strong>twice a week (Thursday &amp; Sunday)</strong> to track progress and address any blockers.</li><li>Our <strong>GitLab Webhook</strong> integration notifies the team whenever someone pushes code, keeping everyone updated on development activities.</li><li><strong>SonarQube</strong> is used to monitor <strong>code quality</strong> and ensure adherence to best practices.</li></ul><h4><strong>Commit Practices and Merge Requirements</strong></h4><ul><li>Use TDD practices (RED testing phase and skeleton, GREEN implementation phase, REFACTOR ‘ironing out the wrinkles’ phase), this ensures that our progress and changes to features are tracked nicely within commits.</li><li>If someone opens a merge request then other members are encouraged to comment by giving appreciation first, then analyzing the request be it quality errors or implementation that could be better, and finally giving a solution to that analysis.</li><li>For merging to our staging branch where it will be deployed, features need to pass the definition of done and unit test.</li></ul><h4>Definition of Done (DoD)</h4><p>To ensure a feature is considered “done,” it must meet the following criteria:</p><p>Functional Requirements:</p><ul><li>Each feature fulfills the functional requirements outlined in the <strong>user story</strong>.</li><li>Users can complete tasks based on their <strong>assigned roles and access rights</strong>.</li></ul><p>Testing Requirements:</p><ul><li><strong>Unit tests</strong> confirm that each component works correctly.</li><li><strong>Integration tests</strong> ensure seamless functionality between different modules (e.g., from registration to report management).</li><li><strong>Functional tests</strong> verify data input and file upload processes.</li><li><strong>Status verification tests</strong> ensure logs and reports are processed correctly.</li></ul><p>Security Requirements:</p><ul><li><strong>Role-based access control</strong> restricts users to their permitted data and actions.</li><li><strong>Authentication and password management</strong> follow secure protocols.</li></ul><p>Code Review and Quality Assurance:</p><ul><li>Code coverage and <strong>code quality in SonarQube</strong> must be <strong>above 90%</strong>.</li><li>Peer <strong>code reviews</strong> must be completed and approved with no major issues.</li></ul><p>Deployment Readiness:</p><ul><li>Features must be tested in the <strong>staging environment</strong> and pass all functional and integration tests.</li><li>No critical issues should remain before deployment to production.</li></ul><h3>Conclusion</h3><p>By implementing <strong>Scrum with GitLab, Webhooks, and SonarQube</strong>, we have established a structured and efficient workflow for our internship management web application. Our <strong>Definition of Done</strong> ensures high-quality software delivery while keeping security and functionality at the forefront.</p><p>Using standup meetings, automated notifications, and quality tracking, we maintain transparency and agility throughout the development process. This approach has helped our team <strong>deliver reliable features on time</strong> while continuously improving our workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c90e269bfd74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django Un-Registered]]></title>
            <link>https://medium.com/@muhammad.radhitya/django-un-registered-5d160668db66?source=rss-bd96f3f03413------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d160668db66</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[unittest]]></category>
            <dc:creator><![CDATA[MRadhitya Utomo (Tomi)]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 18:13:34 GMT</pubDate>
            <atom:updated>2025-03-10T18:13:34.897Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sprint 1: Developing the KP Registration Feature with Django</h3><h3>Introduction</h3><p>As a developer in a team implementing the Scrum methodology, I began my journey in Sprint 1 by focusing on developing the registration feature for the Kerja Praktik (KP) program for students. In this sprint, I was responsible for implementing this feature using Django, covering everything from data structure to testing.</p><h3>Initial Challenges</h3><p>One of the main challenges in this sprint was that the authentication system had not yet been completed. Therefore, to test the registration feature, I used dummy data in the Django admin as a temporary solution.</p><h3>Feature Implementation</h3><p>The development of the KP registration feature involved several key stages:</p><p><strong>Creating Dummy Data in Django Admin</strong><br>Since student login was not yet available, I manually added student data through Django Admin to test the registration feature.</p><p><strong>Implementing Forms, Views, and Templates</strong></p><ul><li>Using Django Forms to facilitate input validation from students.</li><li>Implementing class-based and function-based Views to handle business logic for registration.</li><li>Structuring Templates with the Django Template Engine to ensure an interactive and user-friendly registration interface.</li></ul><p><strong>Writing Tests with Test-Driven Development (TDD)</strong></p><ul><li>Creating unit and integration tests to ensure the feature functions properly.</li><li>Implementing both positive (valid input) and negative (invalid input) test scenarios.</li><li>Using Django TestCase to automate testing.</li></ul><h3>Lessons Learned from Sprint 1</h3><p>This sprint provided valuable insights, especially in:</p><ul><li>Overcoming limitations with creative solutions, such as using dummy data.</li><li>Ensuring code quality through the TDD approach.</li><li>Managing views and templates efficiently for better reusability.</li></ul><p>Since I am sharing a branch with a groupmate we had to carefully navigate each our own tests, then we just thought why not seperate our forms class.</p><h3>Conclusion</h3><p>Sprint 1 was a crucial first step in developing the KP registration feature. With the foundation laid, future iterations will focus on integrating the login system and refining other features. The Scrum methodology ensures that development progresses iteratively and can be evaluated effectively in each sprint.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d160668db66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>