<?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 Rahma Adinda Putri on Medium]]></title>
        <description><![CDATA[Stories by Rahma Adinda Putri on Medium]]></description>
        <link>https://medium.com/@rahmaadinda?source=rss-7fd47c994171------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*b2WMHwHJhlA1gcd5</url>
            <title>Stories by Rahma Adinda Putri on Medium</title>
            <link>https://medium.com/@rahmaadinda?source=rss-7fd47c994171------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:52:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahmaadinda/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[Understanding Performance Monitoring Dashboards on Google Cloud Platform]]></title>
            <link>https://medium.com/@rahmaadinda/understanding-performance-monitoring-dashboards-on-google-cloud-platform-230240b55bb3?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/230240b55bb3</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Thu, 23 May 2024 10:56:01 GMT</pubDate>
            <atom:updated>2024-05-23T10:59:34.685Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kx1lLmDmo5BTiKNWoK2HtA.png" /><figcaption>Image from Iconduck</figcaption></figure><p>Monitoring the performance of applications and infrastructure is essential to ensure reliability, efficiency, and a seamless user experience. Google Cloud Platform (GCP) provides robust monitoring tools that offer insights into various performance metrics. As we deploy our applications, Senarai, on GCP, we utilize these tools to maintain optimal performance and address potential issues proactively.</p><p>Here are some aspects that we monitor in GCP.</p><h3>VM Monitoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jje5BmGJk9nIDKcNLNScag.png" /><figcaption>Senarai’s VM Monitoring in the last 2 days</figcaption></figure><p>Monitoring virtual machines (VMs) is crucial to ensure optimal performance and resource utilization in cloud environments. Performance monitoring dashboard from Google Cloud Platform (GCP) provides insights into the health and performance of VMs. There are four main metrics that we monitor, that is CPU Utilization, Memory Utilization, Network Traffic, and Disk Utilization.</p><p><strong>CPU Utilization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*chPBzpli-AJ5QgOze0NnSw.png" /><figcaption>Senarai’s CPU Utilization in the last 2 days</figcaption></figure><p>The graph illustrates the CPU utilization of the virtual machines (VMs) over a selected time frame, specifically focusing on the last 2 days. The horizontal x-axis represents time, while the vertical y-axis indicates CPU utilization, measured as a percentage.</p><p>CPU utilization is a crucial metric in assessing the performance and resource consumption of VMs within a system. By monitoring CPU utilization over time, we can gain valuable insights into the workload patterns and resource demands of our VMs. This information enables proactive capacity planning, allowing for the allocation of additional resources or optimization of existing configurations to ensure optimal performance and stability.</p><p><strong>Memory Utilization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*V8E2ECxlEdOuToCJR4xs-g.png" /><figcaption>Senarai’s Memory Utilization in the last 2 days</figcaption></figure><p>This graph shows the memory utilization for the VM. The x-axis represents time and the y-axis represents memory utilization as a percentage.</p><p>Memory utilization is a critical metric for assessing the efficiency and resource consumption of VMs within a system. By monitoring memory utilization over time, we can gain valuable insights into the resource demands and workload patterns of our VMs. This information enables proactive capacity planning, allowing for the allocation of additional memory resources or optimization of existing configurations to ensure optimal performance and stability.</p><p><strong>Network Traffic</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*D5oKypYwq8XKN15Jv6W0dw.png" /><figcaption>Senarai’s Network Traffic in the last 2 days</figcaption></figure><p>This graph shows the network traffic (sent and received) for the VMs. The x-axis represents time and the y-axis represents the data transfer rate in MiB/s.</p><p>Network traffic is a pivotal metric for assessing the efficiency and performance of VMs within a system. By monitoring network traffic patterns over time, we can glean valuable insights into the data transfer requirements and usage trends of our VMs. This insight enables proactive network capacity planning, facilitating the allocation of additional bandwidth or optimization of network configurations to uphold optimal performance and reliability.</p><p><strong>Disk Utilization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*cgGjFub5WepORszgmEvuQA.png" /><figcaption>Senarai’s Disk Utilization in the last 2 days</figcaption></figure><p>This graph shows the disk utilization for the VMs. The x-axis represents time and the y-axis represents disk utilization as a percentage.</p><p>Disk utilization is a critical metric for assessing storage efficiency and resource consumption within a system. By monitoring disk utilization trends over time, we can gain valuable insights into storage demands and usage patterns of our VMs. This information enables proactive capacity planning, allowing for the allocation of additional storage resources or optimization of storage configurations to maintain optimal performance and prevent storage-related bottlenecks.</p><h3>API &amp; Service Monitoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tbAUwvUt2T5E13DqFMOgJQ.png" /></figure><p>This section in GCP offers a centralized platform for managing and monitoring APIs and cloud services, empowering us to build, deploy, and manage scalable and reliable applications in the cloud.</p><p><strong>Traffic Monitoring</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*BtQR26OnQyfAt_wanOS7Qw.png" /><figcaption>Senarai’s Traffic over the last 2 days</figcaption></figure><p>The graph displays the number of requests per second (rps) over a certain period of time for APIs. The x-axis represents time and the y-axis on the left side represents the number of requests per second.</p><p>This graph provides valuable insights into how APIs are being utilized. By analyzing the traffic volume depicted on the graph, we can observe peaks and valleys in API usage, which may correlate with specific events, promotions, or user activities. This insight enables us to proactively address any issues, optimize resource allocation, and ensure that your APIs are delivering a reliable and responsive experience to users across different geographical regions.</p><p><strong>Error Monitoring</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*-Hyw36EKI50hcRBxJM9JsQ.png" /><figcaption>Senarai’s Errors for the last 2 days</figcaption></figure><p>This graph shows the percentage of requests that resulted in errors over the same period of time. The x-axis represents time and the y-axis represents the error percentage.</p><p>Analyzing the error graph helps us identify potential issues or anomalies affecting our APIs. By monitoring error rates over time, we can proactively detect and address issues before they escalate, minimizing downtime and service interruptions for your users. Additionally, the error graph can be a valuable tool for troubleshooting and diagnosing problems, as it provides a visual representation of error trends and patterns that can help pinpoint the root cause of issues.</p><p><strong>Median Latency Monitoring</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*NVklKsPE8vmPny4Ktk9gPw.png" /><figcaption>Senarai’s Median Latency for the last 2 days</figcaption></figure><p>This graph shows the median response time (in milliseconds) for the APIs over the same period of time. The x-axis represents time and the y-axis represents latency in milliseconds.</p><p>Analyzing the median latency graph can help us assess the overall health and efficiency of our APIs. Consistently low median latency indicates fast and responsive API performance, while spikes or sustained increases in median latency may indicate potential issues affecting API responsiveness. By monitoring median latency over time, we can proactively troubleshoot issues and optimize our APIs to deliver a seamless and responsive user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*xgs5v_M9clF6NfOtCiAvkQ.png" /><figcaption>API name</figcaption></figure><p>The table below the graph shows the usage summary. Here is the breakdown of each column</p><ul><li>Name: The name of the API being monitored.</li><li>Requests: Total number of requests made to the API.</li><li>Errors (%): Percentage of requests that resulted in errors.</li><li>Latency, median (ms): Median latency of requests in milliseconds.</li><li>Latency, 95% (ms): 95th percentile latency, indicating that 95% of the requests were below this latency threshold.</li></ul><h3><strong>Periodic Automatic Checking with Uptime Check</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hrO_eOizGKK-lBvqul_V1g.png" /><figcaption>Senarai’s Uptime checks</figcaption></figure><p>Periodic Automatic Checking with Uptime Check is another essential aspect of monitoring in Google Cloud Platform (GCP). Uptime Check allows us to monitor the availability and performance of our applications and services by periodically sending HTTP requests to specified URLs or endpoints. These checks are configured to run at regular intervals, such as every minute or every few minutes, to ensure continuous monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*h70Zf4iwgXkWJDWRLM2CuA.png" /><figcaption>Senarai’s CapitalizationCheck configuration</figcaption></figure><p>The results of the uptime checks are used to assess the availability and responsiveness of our applications and services. If a check fails to receive a successful response within a specified timeout period or encounters an error, it triggers an alert or notification, indicating a potential issue with the application or service being monitored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DcWK2ujrzu0_1zUxKEYDEQ.png" /><figcaption>Senarai’s alert</figcaption></figure><p>This automatic checking is a crucial component of monitoring in GCP, enabling us to ensure the reliability, availability, and performance of our applications and services through continuous, automated monitoring and alerting.</p><p><strong>Conclusion</strong></p><p>In conclusion, effective monitoring of applications and infrastructure on Google Cloud Platform (GCP) is indispensable for maintaining optimal performance and reliability. By closely monitoring various metrics such as VM utilization, network traffic, API performance, and uptime checks, organizations can proactively identify issues, allocate resources efficiently, and ensure a seamless user experience. GCP’s comprehensive monitoring tools provide valuable insights that enable timely interventions, proactive capacity planning, and continuous optimization, ultimately contributing to the overall success of cloud-based deployments.</p><p><strong>References:</strong></p><ul><li><a href="https://cloud.google.com/monitoring/uptime-checks/introduction">Google Cloud — Synthetic monitoring overview</a></li><li><a href="https://cloud.google.com/monitoring/alerts">Google Cloud — Alerting overview</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=230240b55bb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crafting User-Centric Interfaces: A Comprehensive Approach to Best Practices and Usability…]]></title>
            <link>https://medium.com/@rahmaadinda/crafting-user-centric-interfaces-a-comprehensive-approach-to-best-practices-and-usability-c0ff16649b05?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0ff16649b05</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Thu, 23 May 2024 04:22:58 GMT</pubDate>
            <atom:updated>2024-05-30T11:50:10.817Z</atom:updated>
            <content:encoded><![CDATA[<h3>Crafting User-Centric Interfaces: A Comprehensive Approach to Best Practices and Usability Heuristics</h3><p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5yKcL6mLW9RSQnKpMu06A.jpeg" /><figcaption>Image by Freepik</figcaption></figure><p>In today’s digital landscape, user interface (UI) design plays a pivotal role in shaping the success of a product or service. Whether it’s a website, mobile app, or software application, a well-crafted UI can significantly enhance the user experience, driving engagement, satisfaction, and ultimately, success.</p><p>In crafting Senarai as a web application, we’ve made it a priority to consistently adhere to best practices in web design to deliver a high-quality product. Here are the steps we’ve taken to ensure this:</p><h3><strong>The Wireframing</strong></h3><p>Before diving into the visual design, it’s essential to establish the structural foundation of the interface. This begins with wireframing, where low-fidelity sketches outline the basic layout and hierarchy of elements. Wireframes serve as blueprints, guiding the placement of buttons, menus, and content areas. By focusing on the arrangement of elements without delving into visual design details, we ensured clarity and efficiency in the user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuIn5EPKwofqrUiu6d7Wwg.png" /><figcaption>Senarai’s wireframe</figcaption></figure><h3><strong>Mockup &amp; Prototype Creation</strong></h3><p>With a solid foundation in place, we transitioned to creating high-fidelity mockups that brought the wireframes to life. These detailed visual representations incorporated colors, typography, imagery, and interactive elements, providing stakeholders with a comprehensive preview of the final product. Through mockups and prototype, we refined the aesthetics and fine-tuned the user interface to align with our design objectives and user needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14ChsPGcmVjvwsLoQzKV9A.png" /><figcaption>Senarai’s mockup</figcaption></figure><h3>Implementing Best Practices</h3><p>Ensuring adherence to usability principles is fundamental to effective UI design. Jakob <strong>Nielsen’s 10 Usability Heuristics</strong> offer invaluable guidance in creating user-friendly interfaces. By integrating these principles into the design process, designers can identify and rectify common usability issues, resulting in interfaces that truly connect with users. We applied Nielsen’s 10 Usability Heuristics throughout the creation of Senarai’s wireframes and mockups, shaping the website’s usability and user experience. Here are the details of how each heuristic was implemented in Senarai’s design.</p><p><strong>Visibility of System Status</strong></p><p>This heuristic emphasizes keeping users informed about system status and ongoing processes. For example, in Senarai, rather than displaying an empty suggestions bar when there are no suggestions, we present a text “No suggestions yet” accompanied by an illustration signifying that the text inputted is already well-crafted. This informs users that the system has evaluated the text and determined that no suggestions are needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVf7cHSgLWPQk_WU4lO01A.png" /><figcaption>Senarai’s product page</figcaption></figure><p>Another illustration of this principle is seen in the website implementation, after a user submits the login form, a loading spinner appears, indicating that the system is processing the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tfr4U3DDh8R_8bEZHS8zAA.png" /><figcaption>Senarai’s log in page</figcaption></figure><p><strong>Match Between the System and the Real World</strong></p><p>The system will evaluate the text sequentially from left to right, aligning with the typical reading pattern of Indonesian text — a reflection of the natural way people engage with written content. This adherence to the reading habits of users ensures that the system’s behavior closely matches real-world expectations, facilitating a smoother and more intuitive user experience. Subsequently, it will showcase suggestions in the suggestions bar, starting with the first word and concluding with the last, further reinforcing the system’s alignment with users’ natural interactions with text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*He3nwE2RpVrSpLO2r7jhbA.png" /><figcaption>Senarai’s product page</figcaption></figure><p><strong>User Control and Freedom</strong></p><p>Users should have the ability to navigate and interact with the system without feeling trapped. Senarai offers features like the ability to accept or decline the suggestion as they may see fit. The option to decline (represented by ‘x’) provides users with the freedom to reject a suggestion without feeling compelled to accept it, while also signaling to the system to disregard the word.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*qBABUt00mmCh1xuZrvefEw.png" /><figcaption>Senarai’s suggestion card</figcaption></figure><p><strong>Consistency and Standards</strong></p><p>This heuristic ensures consistency in design and behavior across the interface. Senarai maintains uniformity by adhering to consistent design patterns and standards throughout its interface. We ensure that colors, fonts, and styling remain consistent for every element on Senarai’s website. For instance, all buttons and dropdowns on the website feature the same font and styling, with color variations reflecting their respective functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AngOUTYG-E5Pj62yMQGO4w.png" /><figcaption>Consistency of buttons dropdowns in Senarai’s navigation bar and toolbar</figcaption></figure><p><strong>Error Prevention</strong></p><p>Senarai prioritizes error prevention by implementing preemptive measures to mitigate potential mistakes. This includes utilizing validation checks on form inputs to identify errors in real-time and offering clear instructions to users to minimize misunderstandings. For instance, when a user clicks the ‘Log Out’ button, the website displays a confirmation modal to ensure that the action is intentional and to prevent accidental logouts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mHA0qzieB3WR66g42s4Ksg.png" /><figcaption>Senarai’s logout confirmation modal</figcaption></figure><p><strong>Recognition Rather than Recall</strong></p><p>Senarai wants to make things easy for users. So, instead of making users remember lots of stuff, we put a toolbar on the side of the text editor. This lets users quickly change the language or log out without needing to hunt around for where to do it. It’s simpler and saves users from having to think too hard about what to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2plXNPLZEhevnVuFPjKEmA.png" /><figcaption>Senarai’s product page</figcaption></figure><p><strong>Flexibility and Efficiency of Use</strong></p><p>Senarai offers flexible workflows to users. For instance, when users are logged in, they are automatically directed to the main page (product page) whenever they visit the website, eliminating the need for them to log in each time they access the site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2plXNPLZEhevnVuFPjKEmA.png" /><figcaption>Senarai’s product page</figcaption></figure><p><strong>Aesthetic and Minimalist Design</strong></p><p>Senarai keeps things simple and easy to understand. We use lots of blank space, simple illustrations, and a neat layout to make the website look nice and easy to use. We don’t put in extra drawings or information that don’t matter to keep it simple and help users stay focused.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3VXxMEKJ1QDJkug0EE9kA.png" /><figcaption>Senarai’s straight forward landing page</figcaption></figure><p><strong>Help Users Recognize, Diagnose, and Recover from Errors</strong></p><p>If errors happen, Senarai shows clear and helpful error messages. These messages explain what went wrong and how to fix it. For instance, if a user can’t log in, the system will show a simple message explaining why, making it easy for the user to understand and correct the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_C9joBF6Z7r3JVgy6NQHBg.png" /></figure><p><strong>Help and Documentation</strong></p><p>Senarai doesn’t have documentation available yet. However, it does offer a product demo that closely resembles the main feature / product. This allows users to get acquainted with the interface before using the actual features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usj6GBdvvo9RhRl3fuupdQ.png" /></figure><p>Besides Nielsen’s 10 Usability Heuristics, another widely used best practice is Ben <strong>Shneiderman’s Eight Golden Rules</strong> of Interface Design. These consist of:</p><p><strong>Consistency</strong></p><p>This rule aligns with Nielsen’s <strong>Consistency and Standards</strong> as both emphasize the importance of consistency in design elements, terminology, and feedback to avoid confusion and improve usability.</p><p><strong>Shortcuts</strong></p><p>This rule matches Nielsen’s <strong>Flexibility and Efficiency of Use</strong> by highlighting the importance of providing shortcuts or accelerators to enhance efficiency for expert users while maintaining usability for novices.</p><p><strong>Informative Feedback</strong></p><p>This rule corresponds to Nielsen’s <strong>Visibility of System Status</strong> as both stress the need for systems to provide timely and informative feedback, ensuring that users are always aware of what is happening.</p><p><strong>Dialogue to Yield Closure</strong></p><p>While it is not an exact match with <strong>Nielsen’s Visibility of System Status</strong>, this heuristic covers the idea of providing feedback that ensures users know when a task has been completed, offering a sense of closure.</p><p><strong>Error handling</strong></p><p>With <strong>Nielsen’s Help Users Recognize, Diagnose, and Recover from Errors, b</strong>oth principles focus on ensuring that error messages are clear, informative, and help users correct their mistakes.</p><p>Additionally, while Shneiderman emphasizes error handling, <strong>Nielsen’s Error Prevention</strong> also highlights the importance of preventing errors from occurring in the first place through careful design.</p><p><strong>Permit reversal of actions</strong></p><p>This rule aligns perfectly with <strong>Nielsen’s User Control and Freedom</strong>, as both emphasize the importance of allowing users to easily undo actions, giving them a sense of control and reducing anxiety.</p><p><strong>Support internal locus of control</strong></p><p>This rule matches <strong>Nielsen’s User Control and Freedom</strong>, as both stress that users should feel in control of the system and their interactions, enhancing user satisfaction and motivation.</p><p><strong>Reduce short-term memory load</strong></p><p>This rule directly corresponds to <strong>Nielsen’s Recognition Rather Than Recall</strong>, as both advocate for reducing the user’s memory load by making options, actions, and objects visible, and minimizing the need for users to remember information across different parts of the interface.</p><p>While there is significant overlap between Shneiderman’s rules and Nielsen’s heuristics, each framework offers unique insights and areas of focus. Both sets of principles are crucial guidelines in user interface (UI) design to enhance usability and user experience (UX). As Shneiderman’s 8 Golden Rules align with Nielsen’s 10 Usability Heuristics, it can be said that Senarai has also implemented the 8 Golden Rules in its development.</p><h3>Providing Alternative Design Options</h3><p>Initially, our website is not a real-time spelling and capitalization checker. However, after several modifications, we successfully implemented a system that enables real-time checking. As a result, in the design, we removed the ‘Analyze’ button, as the spelling and capitalization checker now operates seamlessly in real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLJLWNzEh8a-5PCoI5Z0Jg.png" /><figcaption>Senarai’s original design (left) &amp; alternative design (right)</figcaption></figure><p><strong>Conclusion</strong></p><p>In conclusion, prioritizing user-centric design principles is essential for creating successful digital products and services. By adhering to best practices in UI design and implementing usability heuristics, designers can ensure that interfaces are intuitive, efficient, and engaging. From wireframing to prototype creation, every step of the design process contributes to refining aesthetics and functionality. Providing alternative design options and error prevention mechanisms empowers users to navigate interfaces with ease. Continual innovation and dedication to enhancing the user experience are key to driving success in the ever-evolving digital landscape.</p><p><strong>References</strong>:</p><ul><li><a href="https://www.nngroup.com/articles/ten-usability-heuristics/">Nielsen Norman Group — 10 Usability Heuristics for User Interface Design</a></li><li><a href="https://www.interaction-design.org/literature/article/shneiderman-s-eight-golden-rules-will-help-you-design-better-interfaces">Interaction Design Foundation — Shneiderman’s Eight Golden Rules Will Help You Design Better Interfaces</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0ff16649b05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effective React Component Testing Strategies: Leveraging Mocks and Stubs]]></title>
            <link>https://medium.com/@rahmaadinda/effective-react-component-testing-strategies-leveraging-mocks-and-stubs-f86c70191d31?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/f86c70191d31</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Thu, 23 May 2024 01:43:41 GMT</pubDate>
            <atom:updated>2024-05-23T01:43:41.963Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_v3Mu-llbqCXR-VmXmy7w.jpeg" /><figcaption>Image by Freepik</figcaption></figure><p>As a part of software development cycle, unit testing helps ensure code quality by testing the smallest functional unit of code in isolation. Unit test is designed to check that each block of code runs as expected. This approach encourages writing modular and reusable code, as units need to be tested independently. Furthermore, automated unit tests can quickly verify changes in the code, allowing developers to identify issues and make correction swiftly. This early detection of issues led to reduced cost and effort required for maintenance. As a result, well-tested code is easier to refactor and extend in the long-term.</p><p>In the realm of software testing, a crucial concept is the use of test doubles. This is a generic term used to describe any case where a component or object is replaced with a lightweight version for testing purposes. Test doubles are used to simulate the behavior of complex or external systems, allowing for controlled and predictable testing environments. There are various types of test doubles, such as mocks and stubs.</p><h3><strong>Mock</strong></h3><p>Mock is an object that are pre-programmed with expectations regarding which method will be called and with what parameters. It records method calls and asserting whether expected interaction took place. They can throw an exception if they receive a call they don’t expect and are checked during verification to ensure they got all the calls they were expecting.</p><p>Mocks are used to ensure proper interactions between the code being tested and other components or dependencies, excelling at verifying specific behaviors or interactions.</p><p><strong>Example usage of Mock</strong></p><p>Here is an example of mock implementation in Senarai Frontend project.</p><pre>test(&#39;UnderlineResult calls the appropriate functions&#39;, async () =&gt; {<br>  const mockEditor = {<br>    chain: jest.fn().mockReturnValue({<br>      setTextSelection: jest.fn().mockReturnValue({<br>        setMark: jest.fn().mockReturnValue({<br>          run: jest.fn(),<br>        }),<br>        unsetMark: jest.fn().mockReturnValue({<br>          focus: jest.fn().mockReturnValue({<br>            run: jest.fn(),<br>          }),<br>        }),<br>      }),<br>    }),<br>    commands: {<br>      unsetMark: jest.fn(),<br>    },<br>  };<br><br>  render(<br>    &lt;div&gt;<br>      &lt;TextEditorPage /&gt;<br>      &lt;UnderlineResult editor={mockEditor} result={[<br>          { offset: 0, deleteCount: 6, errorType: &#39;spelling&#39; },<br>          { offset: 0, deleteCount: 6, errorType: &#39;capitalization&#39; },<br>          { offset: 7, deleteCount: 9, errorType: &#39;spelling&#39; },<br>        ]} /&gt;<br>    &lt;/div&gt;<br>  );<br><br>  expect(mockEditor.chain).toHaveBeenCalledTimes(6); // 3 * 2 , 0 blur<br>  expect(mockEditor.chain().setTextSelection).toHaveBeenCalledTimes(6); // 3 * 2<br>  expect(mockEditor.chain().setTextSelection().setMark).toHaveBeenCalledTimes(3); <br>  expect(mockEditor.chain().setTextSelection().unsetMark).toHaveBeenCalledTimes(3);<br>  expect(mockEditor.commands.unsetMark).toHaveBeenCalled();<br>});</pre><p>This test used mock to simulate the behavior of text editor functions without using the actual object.</p><pre>const mockEditor = {<br>    chain: jest.fn().mockReturnValue({<br>      setTextSelection: jest.fn().mockReturnValue({<br>        setMark: jest.fn().mockReturnValue({<br>          run: jest.fn(),<br>        }),<br>        unsetMark: jest.fn().mockReturnValue({<br>          focus: jest.fn().mockReturnValue({<br>            run: jest.fn(),<br>          }),<br>        }),<br>      }),<br>    }),<br>    commands: {<br>      unsetMark: jest.fn(),<br>    },<br>  };</pre><p>A mock object named mockEditor is created using a plain JavaScript object to simulate the behavior of a text editor. This mock object contains nested functions, each of which is mocked using jest.fn() to simulate method calls.</p><pre>expect(mockEditor.chain).toHaveBeenCalledTimes(6); // 3 * 2 , 0 blur<br>  expect(mockEditor.chain().setTextSelection).toHaveBeenCalledTimes(6); // 3 * 2<br>  expect(mockEditor.chain().setTextSelection().setMark).toHaveBeenCalledTimes(3); <br>  expect(mockEditor.chain().setTextSelection().unsetMark).toHaveBeenCalledTimes(3);<br>  expect(mockEditor.commands.unsetMark).toHaveBeenCalled();</pre><p>The test then verifies various interactions with the mockEditor object using Jest&#39;s expect assertions. toHaveBeenCalled() is used to check if the methods within the mockEditor was called once. toHaveBeenCalledTimes() is used to ensure that certain methods of the mockEditor object are called a specific number of times during the test.</p><p>This test case demonstrates how mocks can be used to simulate the behavior of external dependencies, such as a text editor, without actually using the real object. By setting up expectations on method calls and parameters, the test ensures that the “UnderlineResult” component interacts with the text editor appropriately when rendering error results.</p><p><strong>Advantages of Mock</strong></p><ul><li><strong>Interaction Validation</strong>: Mock effectively validate interactions between components, ensuring that method calls occur as expected. This provides confidence in the collaborative behavior of the code.</li><li><strong>Deeper Testing</strong>: By tracking interactions with real objects, mocks can uncover hidden side effects and issues that may not be apparent from return values alone. This enables the detection of subtle bugs and corner cases.</li></ul><p><strong>Disadvantages of Mock</strong></p><ul><li><strong>Fragile</strong>: If tests rely too much on mocks, they can easily break. This happens when tests are too tied to how the mocks are set up, so even small changes in the code can cause them to fail.</li><li><strong>Adds Complexity</strong>: Using mocks makes tests and code more complicated. They can make things harder to understand, especially when they’re used to closely watch how different parts of the code interact. While they can find problems, they also make things more confusing.</li></ul><h3><strong>Stub</strong></h3><p>A stub provides predetermined responses to specific calls made during the test and typically does not respond to anything outside of what’s programmed for the test. Stubs are used to simulate parts of the system that are not under test and can return hard-coded values or objects pre-programmed to control the environment of the test, ensuring predictability.</p><p>Stub is ideal for scenarios where you’re more concerned with the behavior of the object under test than its interactions with other components. They typically do not consider external interactions.</p><p><strong>Example usage of Stub</strong></p><p>Here is an example of stub implementation in Senarai Frontend project</p><pre>jest.mock(&quot;../components/elements/SuggestionBar/SuggestionCard/mechanism&quot;, () =&gt; ({<br>  replaceWord: jest.fn(),<br>  rejectSuggestion: jest.fn(),<br>  handleHighlight: jest.fn(),<br>  handleRemoveHighlight: jest.fn(),<br>  unsetTextSelection: jest.fn(),  <br>}));</pre><p>It’s a Jest mock setup for the mechanism module, specifically stubbing out several functions within that module.</p><ul><li>The replaceWord, rejectSuggestion, handleHighlight, handleRemoveHighlight, and unsetTextSelection functions from the mechanism module are replaced with Jest mock functions created using jest.fn().</li><li>These mock functions serve as stubs for the original functions during testing. They allow you to control their behavior and track their calls without executing the actual implementation.</li></ul><p>Overall, this mock setup allows you to isolate and control the behavior of the functions within the mechanism module during testing, making it easier to focus on testing other parts of your codebase without worrying about the actual implementation details of these functions.</p><p><strong>Advantages of Stub</strong></p><ul><li><strong>Isolation of Testing</strong>: Stubs effectively isolate the unit being tested from its external dependencies. By replacing components with stubs, you can focus your test suite on specific functionality, minimizing external factors that could affect the outcome.</li><li><strong>Predictable Results</strong>: When using stubs during testing, you can expect consistent results. Stubs provide predetermined outcomes, ensuring that tests follow a reliable and repeatable path.</li></ul><p><strong>Disadvantages of Stub</strong></p><ul><li><strong>Potential for False Positives</strong>: Improperly configured stubs may lead to false positives. If the stub doesn’t accurately mimic the behavior of the dependency, tests might pass when they shouldn’t, giving a misleading sense of correctness.</li><li><strong>Limited Interaction Information</strong>: Stubs primarily focus on outcomes and may lack detailed interaction information. While they are useful for state testing, they might not provide sufficient insights into how your component interacts with its dependencies.</li></ul><p><strong>Differences Between Mock and Stub</strong></p><p>Stubs are primarily focused on state testing, emphasizing the outcome and behavior of the object under test. In contrast, mocks specialize in behavior testing, scrutinizing the interactions between components. Here’s a specific list of the differences between mocks and stubs provided by BairesDevBlog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*CbJ-GbUlipH7GWxJ28NmPQ.png" /><figcaption>Differences between stub and mock by BairesDevBlog</figcaption></figure><p><strong>Conclusion</strong></p><p>In conclusion, both mocks and stubs are powerful tools in the realm of software testing, each serving distinct purposes. Stubs are ideal for state testing, where the focus lies on the outcome and behavior of the object under test. On the other hand, mocks excel in behavior testing, emphasizing the interactions between components. While both facilitate effective testing, understanding the differences between them allows testers to choose the most appropriate tool for the specific testing scenario. By leveraging mocks and stubs effectively, developers can enhance code quality, identify issues early, and ensure the reliability and predictability of their software.</p><p><strong>References:</strong></p><ul><li><a href="https://www.geeksforgeeks.org/unit-testing-software-testing/">GeeksforGeeks — Unit Testing — Software Testing</a></li><li><a href="https://martinfowler.com/bliki/TestDouble.html">martinFowler.com — Test Double</a></li><li><a href="https://www.bairesdev.com/blog/stub-vs-mock/">BairesDevBlog — Stub vs Mock: Choosing the Right Test Double</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f86c70191d31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Flow: A Practical Approach for Development]]></title>
            <link>https://medium.com/@rahmaadinda/git-flow-a-practical-approach-for-development-b2153828b4ce?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2153828b4ce</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 11:05:49 GMT</pubDate>
            <atom:updated>2024-04-21T03:32:44.575Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*XIV5FuPzUikvBOb8kFdTpg.png" /><figcaption>Source: <a href="https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg">https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg</a></figcaption></figure><p>Git Flow is a popular branching strategy aimed at simplifying release management. Introduced by software developer Vincent Driessen in 2010, Git Flow has fallen in popularity and is now considered the best practice for modern continuous software development and DevOps practices. It offers a structured approach to managing Git repositories, enabling developers to streamline their workflows and collaborate more effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pfA6TdCf-N0wHa2D.png" /><figcaption>Source: <a href="https://blog.jetbrains.com/">https://blog.jetbrains.com/</a></figcaption></figure><p>Fundamentally, Git Flow involves isolating your work into different types of Git branches, each serving a specific purpose. Here, I will try to explain with some adjustments to the PPL requirements. The main branches in Git Flow include:</p><ol><li>Master/main</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*3pgRHwejc4C4dipXxY4JEA.png" /><figcaption>master branch of Senarai frontend</figcaption></figure><p>In Git flow, the master branch is created at the start of a project and is maintained throughout the development process. The purpose of this branch is to contain production-ready code that can be released– the tests are green, and all changes are verified. The master branch is protected, meaning direct commits are not allowed. The branch can be tagged at various commits to signify different versions or releases of the code, and other branches will be merged into the main branch after they have been sufficiently tested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*CuzLKwFeJWkakSVsJG22BA.png" /><figcaption>example of versioning in Senarai backend after sprint 1</figcaption></figure><p>2. Hotfix</p><p>Maintenance or hotfix branches are used to quickly patch production releases. This is the only branch that should fork directly off of master. As soon as the fix is complete, it should be merged back into master, and master should be tagged with an updated version number.</p><p>3. Staging</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*I_To6spqLjGiNODbRx2yxg.png" /><figcaption>staging branch in Senarai frontend</figcaption></figure><p>The staging branch is created at the start of a project and is maintained throughout the development process. It contains pre-production code with newly developed features that are in the process of being tested. This branch is also utilized for sprint reviews and can be considered equivalent to the develop branch in other practices.</p><p>4. Features</p><p>Created for developing new features or functionalities based on Product Backlog Item (PBI) taken in a Sprint. In PPL practice, these branches are named with the format PBI-&lt;no of PBI&gt;-&lt;name_product_backlog_item&gt; example: PBI-1-Register</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*bk2ZeFPynVrZ7jd0lfTF7g.png" /><figcaption>feature branches in Senarai frontend</figcaption></figure><p>5. Coldfix</p><p>This branch is created to revert changes made to all product backlog item branches. Such a rollback may occur during a sprint review if the product owner decides to reject one or multiple product backlog items that were initially planned for release.</p><p><strong>Best Practice in Git Flow Implementation</strong></p><ol><li><strong>Consistent Branch Naming</strong>: Adopt a standardized naming convention for branches to ensure clarity and organization.</li><li><strong>Regularly Merge Staging into Feature Branches</strong>: Keep feature branches up-to-date with the latest changes from the staging branch to minimize merge conflicts.</li><li><strong>Code Reviews and Pull Requests</strong>: Utilize code reviews and pull requests to maintain code quality and facilitate collaboration among team members.</li><li><strong>Versioning</strong>: Implement a versioning strategy to keep track of releases and hotfixes effectively.</li></ol><p><strong>Some Git commands to Help with the Workflow</strong></p><ul><li>git branch: List all local branches.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*aPxlJrHVy4itPb5BtAek5Q.png" /><figcaption>command to list all local branches</figcaption></figure><ul><li>git checkout <strong>-</strong>b &lt;branch_name&gt;: Creates a new branch and switch to that branch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*5YGPaPvWycpmSOc-mzKmxg.png" /><figcaption>example of creating and switching branch</figcaption></figure><ul><li>git checkout &lt;branch_name&gt;: Switch to an existing branch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*DVwXYfs2_saVIn9KCIpx6Q.png" /><figcaption>example of switching branch</figcaption></figure><ul><li>git branch -d &lt;branch_name&gt;: Delete a specified branch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*fCqq3qjJUYeRR0Y6kW1qmw.png" /><figcaption>example of deleting a specific branch</figcaption></figure><ul><li>git cherry-pick &lt;commit_hash&gt;: Apply a specific commit from one branch to another. For example, you have two branches: feature-branch and main. You can use cherry-pick when you want to apply a specific commit from feature-branch to main without merging the entire branch. The cherry-pick command should be executed in the main branch. After running the command, the main branch will apply the changes from that specific commit.</li></ul><p>For example, you have to branches as following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQSASMG4G8wCzeq0Mi-T2w.png" /><figcaption>file.txt in main branch</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_51EEB9SzqmzOBTlX55-iQ.png" /><figcaption>file.txt in feature-branch</figcaption></figure><p>Then, apply the commit above using cherry-pick in main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-muG0rP5JoEmDXF6B6gMw.png" /><figcaption>applying cherry-pick to main branch</figcaption></figure><p>Here is the result. The specified commit will applied to the main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJKI-YWkxYHYMTjbfnc1pg.png" /><figcaption>file.txt in main branch as the result</figcaption></figure><ul><li>git revert &lt;commit_hash&gt;: Create a new commit to undo changes made by a previous commit. Suppose you have a commit in the feature branch that you want to undo. Revert can be used to create a new commit that reverses its changes. After running the command, the feature branch will revert back to its state before that commit was made.</li></ul><p>Continuing the example above, if you want to undo the change in main branch, you can use revert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g0fMcCSEcxjmlBtYggykYg.png" /><figcaption>revert example</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWN9gsLuqMRL5AbJ4H0o6g.png" /><figcaption>file.txt in main branch as revert result</figcaption></figure><p>The commit history will be saved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0ccSYXjsNhKHUE3qCU2WA.png" /><figcaption>main commit history</figcaption></figure><ul><li>git merge: This command creates a new merge commit to combine changes from one branch into another while maintaining the original commit history of both branches. This command can be used when you want to combine feature branches into the main branch, or vice versa.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/0*9qsW43MBUnrxlv_H" /><figcaption>git merge visualization</figcaption></figure><ul><li>git rebase: This command moves or reapplies the commits of one branch onto another branch. It rewrites the commit history of the feature branch to appear as if it was branched off from the latest commit of the main branch. This command can be used when you want to update your feature branch with the latest changes from the main branch.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/0*8aJ1mDXj77L-k1V3" /><figcaption>git rebase visualization</figcaption></figure><ul><li>git reset: Move the HEAD pointer to a specified commit, effectively resetting the current branch to that commit. This command can be used to undo changes and reset the branch to a previous state. This command is useful when you want to undo commits that have not been pushed to a remote repository. It is important to note that git reset is a local operation and does not affect the remote repository.</li><li>git stash: Temporarily save changes that are not ready to be committed. This command is useful when you need to switch to a different task or branch without committing the current changes.</li><li>git stash pop: Apply the most recent stash and remove it from the stash list. After running this command, the changes saved in the most recent stash will be applied to your working directory, and that stash will be deleted from the stash list.</li></ul><p>References:</p><ul><li><a href="https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow">Atlassian — Gitflow workflow</a></li><li><a href="https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase">Atlassian — Git rebase</a></li><li><a href="https://blog.jetbrains.com/space/2023/04/18/space-git-flow/">JetBrains Blog — Introducing the Space Git Flow</a></li><li><a href="https://www.gitkraken.com/learn/git/git-flow">GitKraken — What is Git Flow</a></li><li><a href="https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html">GitLab — Command line Git</a></li><li><a href="https://git-scm.com/docs">Git Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2153828b4ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SonarCloud: A Comprehensive Overview of Static Analysis Features]]></title>
            <link>https://medium.com/@rahmaadinda/sonarcloud-a-comprehensive-overview-of-static-analysis-features-d39884df1cdd?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/d39884df1cdd</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 05:37:02 GMT</pubDate>
            <atom:updated>2024-04-21T01:54:04.410Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0DxRdVyXV32BWxng.png" /><figcaption>Source: <a href="https://www.resmo.com/">https://www.resmo.com/</a></figcaption></figure><p>Static analysis is a method of debugging that is done by automatically examining the source code without having to execute the program. SonarCloud is a cloud-based code analysis service designed to detect coding issues. With its comprehensive set of features, SonarCloud has become an indispensable tool in the Software Quality Assurance landscape. SonarCloud is designed to help developers achieve a state of Clean Code, that is code with attributes that contribute to making software reliable, maintainable, and secure.</p><p><strong>Key Features of SonarCloud</strong></p><ol><li><strong>Pull Request Analysis</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fOToZyADm1XTqN1M" /><figcaption>Source: <a href="https://docs.sonarsource.com/">https://docs.sonarsource.com/</a></figcaption></figure><p>SonarCloud integrates with popular version control systems like GitHub, GitLab, and Bitbucket to analyze code changes in pull requests. It automatically performs static analysis on the entire code and provides feedback directly within the pull request, enabling developers to address issues proactively before merging the code into the main branch.</p><p><strong>2. Code Quality Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kS-pBE6QCIQhpajLGZf7DQ.png" /><figcaption>example of code quality analysis results</figcaption></figure><p>SonarCloud performs an exhaustive analysis of the codebase to identify code smells, bugs, and other issues. It evaluates code against a predefined set of coding rules and guidelines, providing actionable insights and recommendations to help developers enhance the overall quality of the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD2m1saiJe4WLofODxIhUg.png" /><figcaption>example of issues feature result</figcaption></figure><p>SonarCloud’s Issues feature allows developers to track and manage code quality issues detected during static analysis. It categorizes issues based on severity, type, and impact, providing developers with a prioritized list of issues to address. The Issues feature facilitates collaboration among developers by enabling them to assign, track, and resolve issues efficiently, ensuring continuous improvement in code quality.</p><p><strong>3. Security Vulnerabilities Detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gN9lhHn-zByVbNKhnI8gEQ.png" /><figcaption>example of security vulnerability detection result</figcaption></figure><p>Security Hotspots in SonarCloud highlight areas of the codebase that may be prone to security vulnerabilities, such as input validation, authentication, and data encryption. It focuses on the intent of the code rather than the code’s behavior, helping developers identify and prioritize potential security risks early in the development lifecycle. SonarCloud provides detailed reports on identified vulnerabilities, along with recommendations and remediation guidance to strengthen the application’s security posture.</p><p><strong>4. Code Coverage Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugJzXAWdmI6f6C6dcz8jbA.png" /><figcaption>example of code coverage analysis result</figcaption></figure><p>SonarCloud integrates seamlessly with code coverage tools to provide insights into the percentage of code covered by automated tests. It highlights areas of the code that lack sufficient test coverage, enabling developers to prioritize testing efforts and improve the overall quality of the test suite.</p><p><strong>5. Technical Debt Management</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrqRncUCd7H9l9NNgx8LHQ.png" /><figcaption>example of technical debt management result</figcaption></figure><p>Technical debt refers to the accumulated cost of postponed refactoring or fixing issues in the codebase. SonarCloud quantifies technical debt and provides a visual representation of the debt distribution across the codebase. It helps developers prioritize refactoring efforts and allocate resources efficiently to reduce technical debt over time.</p><p><strong>6. Code Duplication Detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rk1lCQ86ca629I2CvpfMPQ.png" /><figcaption>example of code duplication detection result</figcaption></figure><p>Code duplication can lead to maintenance challenges and reduce code maintainability. SonarCloud identifies duplicate code blocks across the codebase and provides recommendations to refactor or eliminate redundancy. This helps in improving code quality and reducing the overall complexity of the codebase.</p><p><strong>Advantages of Using SonarCloud</strong></p><p>Here are some benefits from using SonarCloud for our project:</p><ul><li><strong>Support for All Major Programming Languages</strong>: SonarCloud supports a wide range of programming languages, making it adaptable to various development environments.</li><li><strong>Automatic Analysis</strong>: SonarCloud automates the code analysis process, saving time and effort for developers.</li><li><strong>Native Integration with DevOps Platforms</strong>: SonarCloud integrates seamlessly with popular DevOps platforms, facilitating continuous integration and delivery pipelines.</li><li><strong>Shared, Unified Configurations</strong>: SonarCloud allows developers to align with a consistent definition of code health and collaborate efficiently in making code clean and meeting code quality expectations.</li><li><strong>Actionable, Highly Precise Results</strong>: SonarCloud provides detailed and precise insights, enabling developers to take immediate and informed actions to improve code quality.</li></ul><p><strong>Setting up Project to SonarCloud</strong></p><p>Here, I will demonstrate how our Senarai project is set up to SonarCloud.</p><ol><li>Open the <a href="https://sonarcloud.io/login">SonarCloud Web</a> and Log In</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AWyxwLDuhVrGFL9KpVatgQ.png" /><figcaption>SonarCloud login page</figcaption></figure><p>Log in to your desired account. It’s preferable to use the account where the repository you want to configure resides. In this case, since the Senarai repository is hosted on GitLab CSUI, I’m logging in using GitHub.</p><p>2. Create a New Organization and Project:</p><p>-Upon logging in, you will be directed to the SonarCloud dashboard. As this is a team project, I chose to create a new organization first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TgJEMyfi9c_mPh7XxRilaA.png" /><figcaption>SonarCloud dashboard</figcaption></figure><p>Fill in the organization details and choose an appropriate plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zs7amcH9iNSlE-YMojHxLg.png" /><figcaption>create new organization form in SonarCloud</figcaption></figure><p>After creating the organization, you will be directed to the organization dashboard. Add a new project there and provide the necessary project details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fp13qzq-z_v1xW9YPOMWHw.png" /><figcaption>organization dashboard in SonarCloud</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPCLMcSGJWM0Gymaa7ectQ.png" /><figcaption>create new project form in SonarCloud</figcaption></figure><p>3. Configure the Repository</p><p>After the project is created, the project details will be displayed, but the project will still be empty. You need to configure the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZKuadqQ-bZ-pQ1D4VR0pAw.png" /><figcaption>project dashboard in SonarCloud</figcaption></figure><p>In the GitLab repository, add CI/CD variables as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-oGeascla4klTS1FLZhWQ.png" /><figcaption>CI/CD Variables in Senarai Frontend Repository</figcaption></figure><ul><li>Key: SONAR_HOST_URL, value: <a href="https://sonarcloud.io/">https://sonarcloud.io</a></li><li>Key: SONAR_TOKEN, value: Sonar Account Token</li></ul><p>Add a new job to .gitlab-ci.yml</p><pre>sonarcloud_check:<br>  image: sonarsource/sonar-scanner-cli<br>  stage: sonarcloud<br>  variables:<br>    SONAR_TOKEN: ${SONAR_TOKEN}<br>    SONAR_HOST_URL: &quot;https://sonarcloud.io&quot;<br>  script:<br>    - sonar-scanner<br>      -Dsonar.projectKey=senarai_fe<br>      -Dsonar.organization=senarai<br>      -Dsonar.sources=.<br>      -Dsonar.host.url=${SONAR_HOST_URL}<br>      -Dsonar.login=${SONAR_TOKEN}<br>      -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info<br>      -Dsonar.exclusions=src/__tests__/**<br>  except:<br>    - tags</pre><p>Note that the projectKey and organization values should be based on the setup used previously.</p><p>Here are the explanations for the code above:</p><p>sonarcloud_check is the job name. The next line specifies the Docker image to use for running the job. In this case, it uses sonarsource/sonar-scanner-cli, which is an official Docker image provided by SonarSource for running the SonarScanner CLI. The stage tag specifies that this job belongs to the sonarcloud stage in the CI/CD pipeline. Then, the environment variables used are defined.</p><p>Here are the explanation of the script:</p><ul><li>sonar-scanner: Executes the SonarScanner CLI tool to perform the analysis.</li><li>-Dsonar.projectKey=senarai_fe: Specifies the project key for identifying the project in SonarCloud.</li><li>-Dsonar.organization=senarai: Specifies the organization key in SonarCloud.</li><li>-Dsonar.sources=.: Indicates the source directory to analyze (the current directory .).</li><li>-Dsonar.host.url=${SONAR_HOST_URL}: Specifies the SonarCloud URL.</li><li>-Dsonar.login=${SONAR_TOKEN}: Specifies the SonarCloud authentication token.</li><li>-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info: Specifies the path to the coverage report in LCOV. format. LCOV (Lines of Code with Coverage) is a format used for representing code coverage data. This lcov.info file will contain the coverage data in LCOV format, including details about which lines of code were executed during the tests, along with coverage metrics and summary information.</li><li>-Dsonar.exclusions=src/__tests__/**: Specifies patterns to exclude from the analysis, in this case, the test files located in src/__tests__.</li></ul><p>The except specifies that this job should not run for Git tags. The except keyword with - tags means the job will only run for branches and merge requests, but not for tags.</p><p>The setup is now complete! SonarCloud analysis will run automatically when there is a new push to the repository. You can see an example of the analysis results below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2KWYx-sJTccyBcDYE124A.png" /><figcaption>project dashboard in SonarCloud</figcaption></figure><p>References:</p><ul><li><a href="https://www.perforce.com/blog/sca/what-static-analysis">Perforce — What Is Static Analysis?</a></li><li><a href="https://docs.sonarsource.com/sonarcloud/">SonarCloud — SonarCloud Documentation</a></li><li><a href="https://docs.sonarsource.com/sonarcloud/discovering-sonarcloud/what-sonarcloud-can-do/">SonarCloud — What SonarCloud can do</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d39884df1cdd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test-Driven Development (TDD) Implementation in React]]></title>
            <link>https://medium.com/@rahmaadinda/test-driven-development-tdd-implementation-in-react-44bd002363ae?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/44bd002363ae</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sat, 30 Mar 2024 14:16:10 GMT</pubDate>
            <atom:updated>2024-03-31T02:41:05.303Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dbLh_xowH5YjuVmE.jpg" /><figcaption>Source: <a href="https://www.perfecto.io/">https://www.perfecto.io/</a></figcaption></figure><p>Test-Driven Development (TDD) is an iterative method of software development that emphasizes writing test cases before implementing the actual functionality. It involves a series of short development cycles that combine building and testing.</p><p>As the picture shows above, a TDD cycle consists of three phases:</p><ul><li><strong>Red phase</strong>. In this initial phase, the developer adds a new test to the test suite without any code implementation. They then run all tests to ensure that the new test fails as expected.</li><li><strong>Green phase. </strong>Following the red phase, the developer writes program code based on the test created earlier. The goal of this phase is to make the test pass successfully.</li><li><strong>Refactor phase</strong>. After successfully passing the test in the green phase, the developer refines and improves the code while ensuring that all tests remain green (passed)</li></ul><p>This systematic approach helps ensure the correctness of the code. Additionally, TDD offers several other advantages:</p><ul><li><strong>Higher coverage in less time.</strong> TDD can achieve comprehensive test coverage more efficiently.</li><li><strong>Reduced debugging costs</strong>. The time and money spent on debugging during later stages are minimized.</li><li><strong>Bug prevention and reduced coupling.</strong> TDD helps in identifying and preventing bugs early in the development process, reducing code coupling.</li><li><strong>Facilitates refactoring and rewriting.</strong> With a comprehensive test suite in place, refactoring and rewriting become easier and faster.</li></ul><p>Here, I will demonstrate an example of TDD implementation in the Senarai Frontend project.</p><p><strong>Step 1: Red Phase</strong></p><p><strong>Creating the Test</strong></p><p>First, I create the test to evaluate the renderHTML and parseHTML functions. I implement both positive and negative test cases for each function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*G489vxSZ0G4DE7V-jDrk2w.png" /><figcaption>example of react test</figcaption></figure><p><strong>Initial Test Run</strong></p><p>Upon running the test initially, it fails, as expected, since the actual code implementation is yet to be done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*mZV2HtMseL9beYXjfkdypA.png" /><figcaption>failed test result</figcaption></figure><p><strong>Committing the Test</strong></p><p>I commit the test to the repository, tagging it with [RED] to indicate that the test is currently failing and needs implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1DVkedSCBXD0eud_hTugPg.png" /><figcaption>red commit message</figcaption></figure><p><strong>Step 2: Green Phase</strong></p><p><strong>Implementing the Code</strong></p><p>The next step involves creating the actual implementation for the functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*eL9PwZwI8f45kb0UbLWZOg.png" /><figcaption>code implementation based on test</figcaption></figure><p><strong>Test Re-run</strong></p><p>After implementing the code, I run the test again. This time, it passes successfully, indicating that the implementation is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*R2RnJxdMy_i3oqosUffQHQ.png" /><figcaption>passed test result</figcaption></figure><p><strong>Committing the Code</strong></p><p>I then commit the updated code to the repository, tagging it with [GREEN] to signify a successful test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bG7kA4WBOyK8VtqmZwUDdg.png" /><figcaption>green commit mesage</figcaption></figure><p><strong>Coverage Result</strong></p><p>The coverage result can be seen in Sonarcloud for our front-end project. It will show the extent of the code covered by the tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VWRdaQRIvmS_ykXWBt2B2Q.png" /><figcaption>SonarCloud result for a file</figcaption></figure><p><strong>Step 3: Refactor Phase</strong></p><p>The last thing that should be done is refactoring, if there are bugs or code smells in the code. To indicate that the code has been refactored, I use the [REFACTOR] tag when committing the changes to the repository. However, I didn’t perform refactoring this time because the results above indicate that there are no bugs or code smells in the code.</p><p>Initially, I found this method challenging to implement because I had to write the test before writing the code. However, after practicing it a few times, I began to understand why TDD is widely used. Over time, I have adapted to this method and find it beneficial for developing high-quality code.</p><p>References:</p><p><a href="https://testdriven.io/test-driven-development/">TestDriven.io — What is Test-Driven Development?</a></p><p><a href="https://www.techtarget.com/searchsoftwarequality/definition/test-driven-development">TechTarget Network — test-driven development (TDD)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44bd002363ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principle in React Development]]></title>
            <link>https://medium.com/@rahmaadinda/solid-principle-in-react-development-f2ce06559969?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2ce06559969</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 13:05:29 GMT</pubDate>
            <atom:updated>2024-04-21T13:58:57.758Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*2iTbog5aPjIrRpQby5Wq8w.png" /><figcaption>Source: <a href="https://www.freelogovectors.net/react-logo/">https://www.freelogovectors.net/react-logo/</a></figcaption></figure><p>The SOLID principle is a popular design principle used in object-oriented design (OOD) principles by Robert C. Martin. SOLID is an acronym, and it stands for five key design principles:</p><ul><li><strong>Single Responsibility Principle (SRP)</strong>. This principle states that every class should have one, and only one, reason to change (responsibility).</li><li><strong>Open-closed Principle (OCP)</strong>. This principle states that objects or entities should be open for extension, but closed for modification.</li><li><strong>Liskov Substitution Principle (LSP)</strong>. This principle states that objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.</li><li><strong>Interface Segregation Principle (ISP)</strong>. This principle states that clients should not be forced to depend upon interfaces that they do not use, so it’s better to have many small interfaces (specific to the needs of each client) than a few large (generalized) ones.</li><li><strong>Dependence Inversion Principle (DIP)</strong>. This principle states that entities must depend upon abstractions, not concretions.</li></ul><p>These principles ensure practices that will develop software with consideration for maintaining and extending as the project grows.</p><p>React is a widely used JavaScript library for building user interfaces. It provides developers with an efficient way to build modern web applications with rich user interfaces. React follows a component-based architecture, where UIs are composed of small, reusable components. These components encapsulate their logic and state, making it easier to manage and maintain complex UIs.</p><p>In React development, implementing SOLID principles can lead to more maintainable, scalable, and testable code. Here’s how React’s best practices often align with SOLID principles:</p><ul><li><strong>Single Responsibility Principle</strong>: React component should have a single responsibility, focusing on rendering UI elements or managing specific aspects of the application’s behavior as its state, but not both. Components will remain focused, easier to understand, and less prone to unintended side effects. Here is an example of the Single Responsibility Principle applied in Senarai Frontend development.</li></ul><p>src/components/pages/registerPage/RegisterPage.js :</p><pre>import React from &#39;react&#39;;<br>import { images } from &#39;../../constants&#39;;<br>import RegisterForm from &#39;../../elements/RegisterForm&#39;;<br><br>function RegisterPage() {<br>  return (<br>    &lt;div className=&#39;flex flex-col lg:flex-row  min-h-screen relative overflow-auto&#39;&gt;<br>        &lt;div className=&#39;flex w-full lg:w-1/2 flex-col items-center&#39;&gt;<br>            &lt;div className=&quot;absolute bottom-0 left-0&quot;&gt;<br>                &lt;div className=&#39;flex justify-center mb-[.5cm]&#39;&gt;<br>                    &lt;img<br>                        src={images.senarai}<br>                        alt=&quot;senarai&quot;<br>                        style={{ width: &quot;230px&quot;, height: &quot;45px&quot; }}<br>                    /&gt;<br>                &lt;/div&gt;<br>                &lt;img<br>                    src={images.register}<br>                    alt=&quot;register&quot;<br>                /&gt;<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>        &lt;RegisterForm /&gt;<br>    &lt;/div&gt;<br>  );<br>}<br>export default RegisterPage;</pre><p>The RegisterPage component is responsible for one single task, that is rendering the UI layout of the registration page, including images and the RegisterForm component.</p><ul><li><strong>Open-closed Principle</strong>: React components should be open for extension but closed for modification. <strong>Open for extension</strong> means you can add new behaviors, functionalities, and features to a component without having to change how it already works. <strong>Closed for modification </strong>means after you’ve created and implemented a React component, you should avoid directly manipulating its source code unless it is inevitable. By composing components together and passing props to configure their behavior, it allows for easy extension and customization without directly modifying the existing component’s code. Here is an example of the Open-closed Principle applied in React development.</li></ul><p>Let’s say we have a Button component that renders a button with different styles based on its variant prop:</p><pre>import React from &#39;react&#39;;<br><br>const Button = ({ variant, children, ...props }) =&gt; {<br>  const styles = {<br>    primary: {<br>      backgroundColor: &#39;#007bff&#39;,<br>      color: &#39;#ffffff&#39;,<br>    },<br>    success: {<br>      backgroundColor: &#39;#28a745&#39;,<br>      color: &#39;#ffffff&#39;,<br>    },<br>  };<br>  const buttonStyle = styles[variant] || styles.primary;<br>  return (<br>    &lt;button style={buttonStyle} {...props}&gt;<br>      {children}<br>    &lt;/button&gt;<br>  );<br>};<br>export default Button;</pre><p>Now, let’s say we want to add a new button variant called warning. Instead of modifying the existing Button component, we can extend it by creating a new component:</p><pre>import React from &#39;react&#39;;<br>import Button from &#39;./Button&#39;;<br><br>const WarningButton = (props) =&gt; {<br>  return &lt;Button variant=&quot;warning&quot; {...props} /&gt;;<br>};<br>export default WarningButton;</pre><p>In this example, the Button component is closed for modification because we didn&#39;t have to change its code to add a new button variant (warning). The Button component is open for extension because we can easily create new button variants by extending the existing component.</p><p>By following the Open/Closed Principle, we can maintain the existing functionality of the Button component while easily adding new features or variants without altering its code, making the system more flexible, maintainable, and scalable.</p><ul><li><strong>Liskov Substitution Principle</strong>: Child components in React should be able to replace their parent’s components without affecting the correctness of the program. This ensures that components can be composed and reused in various contexts. Here is an example of the Liskov Substitution<strong> </strong>Principle applied in Senarai Frontend development.</li></ul><p>src/components/elements/TextEditor/MenuBar/index.jsx :</p><pre>import &#39;remixicon/fonts/remixicon.css&#39;;<br>import &#39;./menu-bar.css&#39;;<br><br>export const MenuBar = ({ editor, onAnalyze }) =&gt; {<br>  if (!editor) {<br>    return null<br>  }<br>  return (<br>    &lt;div className=&#39;stickyBottom&#39;&gt;<br>      // bold button<br>      &lt;button<br>        onClick={() =&gt; editor.chain().focus().toggleBold().run()}<br>        className={`btn ${editor.isActive(&#39;bold&#39;) ? &#39;is-active&#39; : &#39;&#39;}`}<br>      &gt; &lt;i className=&quot;ri-bold&quot;/&gt;<br>      &lt;/button&gt;<br>      // italic button<br>      &lt;button<br>        onClick={() =&gt; editor.chain().focus().toggleItalic().run()}<br>        className={`btn ${editor.isActive(&#39;italic&#39;) ? &#39;is-active&#39; : &#39;&#39;}`}<br>      &gt;<br>        &lt;i className=&quot;ri-italic&quot;/&gt;<br>      &lt;/button&gt;<br>      ...<br>      // ordered list button<br>      &lt;button<br>        onClick={() =&gt; editor.chain().focus().toggleOrderedList().run()}<br>        className={`btn ${editor.isActive(&#39;orderedList&#39;) ? &#39;is-active&#39; : &#39;&#39;}`}<br>      &gt;<br>        &lt;i className=&quot;ri-list-ordered&quot;/&gt;<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><p>The MenuBar component is focused on rendering a menu bar with buttons for various text formatting options like bold, italic, headings, bullet lists, and ordered lists. The component takes an editor prop to interact with and manipulate the text in the editor.</p><p>The MenuBar component is designed in a way that allows for extension (e.g., adding new menu options) and substitution (e.g., using with different editor implementations) without modifying its core code. The component’s functionality is encapsulated within its own context, and it can interact with external dependencies (like the editor prop) through clearly defined interfaces (e.g., button click handlers).</p><ul><li><strong>Interface Segregation Principle</strong>: React components can implement only the props and methods they need, avoiding unnecessary dependencies and keeping interfaces focused and minimal. It’s better to have many small components (specific to the needs of each client) than a few large (generalized) ones. This allows for greater flexibility and reduces the probability of unintended side effects when making changes. Here is an example of the Interface Segregation Principle applied in Senarai Frontend development.</li></ul><p>src/components/pages/landingPage/LandingPage.js :</p><pre>import React from &#39;react&#39;;<br>import { Navbar } from &#39;../../elements/Navbar&#39;;<br>import { Footer } from &#39;../../elements/Footer&#39;;<br>import { Header } from &#39;../../elements/Header&#39;;<br>import { Info } from &#39;../../elements/Info&#39;;<br><br>const LandingPage = () =&gt; {<br>  return (<br>    &lt;div data-testid = &#39;landing-page&#39;&gt;<br>      &lt;Navbar /&gt;<br>      &lt;Header /&gt;<br>      &lt;Info /&gt;<br>      &lt;div className=&#39;mt-[.5cm]&#39;&gt;<br>        &lt;Footer /&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}<br>  <br>export default LandingPage;</pre><p>Interface Segregation Principle applied by breaking down the UI into smaller, more focused components and then composing them together in higher-level components.</p><p>The LandingPage component is a container component that renders the main layout of a landing page by assembling several smaller components. Each of the Navbar, Header, Info, and Footer components has a specific responsibility and functionality. They don&#39;t contain unnecessary or unrelated functionalities, which means they have specific interfaces. Also, in the LandingPage component, we’re only inserting the necessary components to build the overall landing page layout. This ensures that the LandingPage component depends only on the interfaces of the specific components it uses, aligning with the principle of not forcing clients to depend on unnecessary interfaces.</p><ul><li><strong>Dependency Inversion Principle</strong>: React components should not directly depend on other components, but both should depend on a common abstraction. React’s use of props and context provides a mechanism for dependency injection, allowing components to depend on abstractions rather than concrete implementations. Here is an example of the Dependency Inversion Principle applied in React development.</li></ul><p>Lets say we want to build a payment processing system that supports multiple payment methods such as credit card, PayPal, and bank transfer. Here is the initial implementation.</p><pre>class CreditCardPayment {<br>  processPayment(amount) {<br>    // process payment using credit card<br>  }<br>}<br><br>class PayPalPayment {<br>  processPayment(amount) {<br>    // process payment using paypal<br>  }<br>}<br><br>class PaymentProcessor {<br>  constructor(paymentMethod) {<br>    this.paymentMethod = paymentMethod;<br>  }<br>  process(amount) {<br>    if (this.paymentMethod instanceof CreditCardPayment) {<br>      this.paymentMethod.processPayment(amount);<br>    } else if (this.paymentMethod instanceof PayPalPayment) {<br>      this.paymentMethod.processPayment(amount);<br>    }<br>  }<br>}</pre><p>In this implementation, the PaymentProcessor class depends directly on the specific payment methods (CreditCardPayment and PayPalPayment). If we want to add a new payment method (e.g., bank transfer), we need to modify the PaymentProcessor class, violating the Open/Closed Principle and causing tight coupling between the PaymentProcessor and the specific payment methods.</p><p>A better approach would be to define an abstraction (interface) for the payment methods and have the PaymentProcessor depend on this abstraction, rather than specific implementations.</p><pre>// abstraction for payment methods<br>class IPaymentMethod {<br>  processPayment(amount) {<br>    // to be implemented by the concrete payment methods<br>  }<br>}<br><br>// concrete implementation for credit card payment<br>class CreditCardPayment extends IPaymentMethod {<br>  processPayment(amount) {<br>    // process payment using credit card<br>  }<br>}<br>// concrete implementation for paypal payment<br>class PayPalPayment extends IPaymentMethod {<br>  processPayment(amount) {<br>    // process payment using paypal<br>  }<br>}<br>class PaymentProcessor {<br>  constructor(paymentMethods) {<br>    this.paymentMethods = paymentMethods;<br>  }<br>  process(amount) {<br>    this.paymentMethods.forEach(method =&gt; {<br>      method.processPayment(amount);<br>    });<br>  }<br>}</pre><p>In this corrected implementation, the PaymentProcessor class depends on the IPaymentMethod abstraction, not on specific implementations like CreditCardPayment or PayPalPayment. We can easily add new payment methods by creating new implementations of the IPaymentMethod interface without modifying the existing PaymentProcessor class.</p><p>By adhering to the Dependency Inversion Principle, we create a flexible and maintainable design where high-level and low-level modules depend on abstractions, allowing for easier extensibility, testability, and reduced coupling between components.</p><p>While React’s best practices align with SOLID principles, it’s important to note that React development also has its specific patterns and practices that may not directly in accordance to all aspects of SOLID. For example, Component Structure, Props and PropTypes, Conditional Rendering, Component Lifecycle, etc. However, by applying SOLID principles alongside React’s conventions and patterns, developers can create well-structured, maintainable, and scalable React applications. This leads to improved code quality, better developer productivity, and enhanced user experiences.</p><p><strong>References:</strong></p><ul><li><a href="https://www.thepowermba.com/en/blog/what-are-the-solid-principles">ThePower — What are the 5 Solid principles? What is SOLID and what is it for?</a></li><li><a href="https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design">DigitalOcean — SOLID: The First 5 Principles of Object Oriented Design</a></li><li><a href="https://konstantinlebedev.com/solid-in-react/">Konstantinlebedev — Applying SOLID principles in React</a></li><li><a href="https://www.everydayreact.com/articles/solid-principles-in-react">Everydayreact — SOLID Principles in React</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2ce06559969" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximizing Team Efficiency using Tools]]></title>
            <link>https://medium.com/@rahmaadinda/maximizing-team-efficiency-using-tools-026b19cc0681?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/026b19cc0681</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 07:03:26 GMT</pubDate>
            <atom:updated>2024-03-30T06:50:53.200Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOOvKP9ef7ZXHwi4KRIHrQ.jpeg" /><figcaption>Source: <a href="https://www.freepik.com/">https://www.freepik.com</a></figcaption></figure><p>Maximizing team efficiency is crucial to achieve success in software development projects. Fortunately, advancements in technology have provided tools and platforms that will empower teams to work better. There are a few strategies for maximizing team efficiency using a variety of tools and technologies.</p><p><strong>Communication</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ivMvgq7zgEXo9gTGu3Y6Q.png" /><figcaption>Source: <a href="https://discord.com/branding">https://discord.com/branding</a></figcaption></figure><p>There are some platforms that could help to build an efficient team environment, such as Discord and LINE. This environment includes communication strategies and task delegation. Moreover, it will open communication channels, providing regular updates on each member’s progress, and seeking assistance or clarification when needed.</p><p><strong>Version Control and Collaboration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*XIV5FuPzUikvBOb8kFdTpg.png" /><figcaption>Source: <a href="https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg">https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg</a></figcaption></figure><p>Other essentials for collaborative software development are version control systems, like Git, and collaboration platforms such as GitHub, GitLab, or BitBucket. These platforms offer some features, such as</p><ul><li>Making commit, this will help in maintaining a clear and informative commit history, including writing descriptive commit messages that summarize the changes made and referencing relevant issues or tasks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDfPprhLZCKNLwqTCRwWhg.png" /><figcaption>Commit History in Senarai Backend Repository</figcaption></figure><ul><li>Code review and feedback, will help in ensuring code quality and identifying issues. Code review can be done after the Pull Request is made and before changes are merged to the main codebase, feedback is provided through comments and discussion on the code changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtbcaPV8YOYwPMvX6fVxig.png" /><figcaption>Code Review in Senarai Backend Repository</figcaption></figure><ul><li>Continuous integrations, will help in ensuring that code changes are continuously validated, reducing the risk of integration error, and enabling faster delivery of reliable software.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ESdlh9VmYRyZeft9yvu_w.png" /><figcaption>Continuous Integration in Senarai Frontend Repository</figcaption></figure><p><strong>Project Management Tools</strong></p><p>Software development also needs effective project management to do planning, task prioritization, and progress tracking. Tools like Jira, Trello, or Asana will help in creating user stories, organizing tasks into sprints, and utilizing backlogs to manage workflow. As for Senarai, we use more general tool that is easier to use, Google Sheets. While it might not offer the same level of visual elegance as dedicated project management tools, Google Sheets provides a flexible and customizable platform for managing tasks and tracking progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkH48PP7Bs_zq6fA5RZIKw.png" /><figcaption>Scrum Board in Google Sheets for Senarai</figcaption></figure><p>While Google Sheets may lack some of the advanced features found in dedicated project management tools, its simplicity and ease of use make it a viable option for teams looking for a lightweight Scrum board solution. Additionally, we can always enhance its functionality by integrating it with other tools or by using add-ons available in the Google Workspace marketplace.</p><p><strong>Why do we need to use these tools?</strong></p><p>Some of the benefits we get if we use these tools are:</p><ul><li>Improve accuracy</li><li>Save time and effort</li><li>Help reduce errors</li><li>Help provide access to information and services at any time</li><li>Make tasks automated</li><li>Facilitate remote work</li></ul><p>However, mastering teamwork with tools involves not only technical proficiency with collaboration and version control tools, but also effective communication.</p><p>To achieve successful collaboration, we need seamless integration of tools and technologies that empower teams to communicate, coordinate tasks, and manage projects efficiently. There are so many tools dan we can use to collaborate according to its function. Our group uses Discord and LINE as our main platform to communicate. We also use organization in GitLab CSUI as our version control system so all of our team members can actively participate in the development process.</p><p><strong>References:</strong></p><ul><li><a href="https://www.simplilearn.com/software-development-tools-article">Simplilearn — Software Development Tools Every Developer Should Master</a></li><li><a href="https://www.appsierra.com/blog/software-development-tools">AppSierra — What is the Role of the Best Tools for Software Development</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=026b19cc0681" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying React to Vercel]]></title>
            <link>https://medium.com/@rahmaadinda/deploying-react-to-vercel-827b41f095f7?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/827b41f095f7</guid>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 02:21:15 GMT</pubDate>
            <atom:updated>2024-03-30T06:48:41.906Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is a part of Individual Review PPL CSUI Even Semester 2023/2024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTniHbBOrJcW0JRES91hYA.png" /><figcaption>Source: <a href="https://logowik.com/vercel-vector-logo-9512.html">https://logowik.com/vercel-vector-logo-9512.html</a></figcaption></figure><p>In the first week, our team decided to use React as our frontend library. There are two different ways to deploy React Application to Vercel.</p><p><strong>Vercel for Git</strong></p><ol><li>Push your code to git repository (GitHub, GitLab, BitBucket).</li><li>Import your React project (git repository) to Vercel through Vercel Dashboard.</li></ol><p>Vercel will detect your project and will enable the correct setting for your deployment automatically. Then, your application is deployed. It is indeed the simple way.</p><p><strong>Vercel CLI (Command Line Interface)</strong></p><p>Vercel CLI can be used to deploy React Application. This involves installing the Vercel CLI, logging in to your Vercel account, and running some related commands.</p><p>First, add CI/CD Pipeline Script to .gitlab-ci.yml :</p><pre>default:<br>  image: node:16.16.0<br><br>deploy_preview:<br>  stage: deploy<br>  except:<br>    - master<br>  script:<br>    - npm install --global vercel<br>    - vercel pull --yes --environment=preview --token=$VERCEL_TOKEN<br>    - vercel build --token=$VERCEL_TOKEN<br>    - vercel deploy --prebuilt  --token=$VERCEL_TOKEN<br><br>deploy_production:<br>  stage: deploy<br>  only:<br>    - master<br>  script:<br>    - npm install --global vercel<br>    - vercel pull --yes --environment=production --token=$VERCEL_TOKEN<br>    - vercel build --prod --token=$VERCEL_TOKEN<br>    - vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN</pre><p>This pipeline has two jobs, that is deploy_preview that will run in all branches except the master branch, and deploy_production that will run only in master branch. So the two triggers are:</p><ul><li>One that creates preview environments on commits pushed to a git branch</li><li>Another that creates production environments on commits to the master branch</li></ul><p>Then, add the required values from Vercel as CI/CD variables in GitLab repository.</p><p>To do this, there are some things to do.</p><ol><li>Retrieve your Vercel Access Token.</li></ol><p>From your Personal Account Dashboard, go to Settings Tab. Then, navigate to Account Tokens page.</p><ul><li>Click <strong>Create </strong>to open the create token modal.</li><li>Enter a descriptive name and click <strong>Create Token</strong>.</li><li>Choose the scope of access for the token from the dropdown.</li><li>Make a note of the token created as it will <strong>not be shown again</strong>.</li></ul><p>2. Create new project through Vercel CLI.</p><p>To install Vercel CLI, run the following command in your Command Prompt (assumed you use npm):</p><pre>npm i -g vercel</pre><p>To confirm that the download has finished successfully, you can verify it by executing this command:</p><pre>vercel --version</pre><p>If the output displays the version of the Vercel CLI similar to the following, then the download has been successful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*fIu-rVNywMKYLSLGluQzxg.png" /></figure><p>Next, you’ll need to log in with your preferred account. Please use the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*5FIzBrntjnrhPSF14W6qwg.png" /></figure><p>You can continue based on your preferred account.</p><p>After logging in, navigate to the directory of your project where you want to deploy it using the Command Prompt, and then execute the following command:</p><pre>vercel link</pre><p>Running this command will initiate the creation of a new Vercel project. During this process, you’ll be prompted to enter some configuration settings based on your project requirements. After completing the configuration, a new .vercel folder will be created in your project directory. Inside this folder, you&#39;ll find a README file and a project.json file. Be sure to save the projectId and orgId from the project.json file.</p><p>3. In the GitLab repository, add CI/CD variables as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xblZZ-XgAY9mZAgWQJ_PMw.png" /><figcaption>CI/CD Variables in Senarai Frontend Repository</figcaption></figure><ul><li>Key: VERCEL_TOKEN, value: Vercel Access Token</li><li>Key: VERCEL_ORG_ID, value: orgId value</li><li>Key: VERCEL_PROJECT_ID, value: projectId value</li></ul><p>It is quite complex than the first way, because some manual configuration is needed in the repository.</p><p>Our project were deployed using Vercel CLI, because our frontend repository is in GitLab CSUI, not the basic GitLab, we can’t just import the repository to Vercel. After doing some research, we can actually deploy repository from GitLab CSUI, as a self-managed GitLab, to Vercel, that is using Vercel CLI to create new Vercel project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axFZrk633Jqn3jYJIYE6vg.png" /><figcaption>Senarai Frontend Deployment in Vercel</figcaption></figure><p>Deploying a React application to Vercel using the Vercel CLI helps me to understand more about deployment process, including configuring deployment settings and managing environment variables. I become more familiar with a few commands in the Vercel CLI. I also have a better understanding of setting up continuous deployment workflows, where changes pushed to specific branches automatically trigger deployments to Vercel, ensuring a seamless development and deployment process.</p><p><strong>References:</strong></p><ul><li><a href="https://vercel.com/guides/deploying-react-with-vercel">Vercel — How to Deploy a React Site with Vercel</a></li><li><a href="https://vercel.com/guides/can-i-use-self-managed-gitlab-with-vercel">Vercel — Can I use self-managed GitLab with Vercel?</a></li><li><a href="https://vercel.com/guides/how-can-i-use-gitlab-pipelines-with-vercel">Vercel — How can I use GitLab Pipelines with Vercel?</a></li><li><a href="https://vercel.com/guides/how-do-i-use-a-vercel-api-access-token">Vercel — How do I use a Vercel API Access Token?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=827b41f095f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BizzIT Final Competition: Last Step to the Trophy]]></title>
            <link>https://medium.com/compfest/bizzit-final-competition-last-step-to-the-trophy-98f0f7652cca?source=rss-7fd47c994171------2</link>
            <guid isPermaLink="false">https://medium.com/p/98f0f7652cca</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[business-it]]></category>
            <category><![CDATA[business-technology]]></category>
            <category><![CDATA[compfest]]></category>
            <category><![CDATA[competition]]></category>
            <dc:creator><![CDATA[Rahma Adinda Putri]]></dc:creator>
            <pubDate>Wed, 30 Nov 2022 04:33:46 GMT</pubDate>
            <atom:updated>2022-11-30T04:33:46.977Z</atom:updated>
            <content:encoded><![CDATA[<p>COMPFEST 14, Depok — Lima tim yang terdiri dari tiga orang maju ke kompetisi final Business IT Competition (BizzIT). Final BizzIT dilaksanakan secara luring pada Sabtu, 29 Oktober di gedung baru Fakultas Ilmu Komputer Universitas Indonesia dan Minggu, 30 Oktober 2022 di Gedung Kementerian Perindustrian Republik Indonesia. Mari cek keseruannya!</p><p><strong>Day 1 — Mentoring</strong></p><p>Acara dimulai dengan pembukaan dari MC Dylan dan Raffi, setelah para finalis melakukan registrasi ulang. Sesi mentoring pertama dari Kak Heri Fauzan, Cloud Solutions Architect &amp; Infrastructure dari Accenture, yang memberikan materi tentang “Cloud Computing dan Business Insight”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6GfWAzKJGk3Xq_ou" /></figure><p>Kak Heri memulai dengan penjelasan tentang arsitek <em>cloud solution</em>. Sesuai tema BizzIT, Kak Heri menyinggung tentang perspektif bisnis terhadap teknologi dan juga sebaliknya. Ia mencontohkan beberapa contoh transformasi teknologi yang berhasil dilakukan dan pola pikir di baliknya. Diskusi mengenai <em>cloud computing</em> tidak akan lengkap tanpa menyebut XaaS (<em>Anything as a Service</em>). Heri memberikan beberapa penjelasan dengan contoh, beberapa hal yang dijelaskannya adalah jaringan, IoT, AI/ML, dan data. Sesi dilanjutkan dengan tanya jawab dengan para finalis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pxYclAEurJ2sOcL-" /></figure><p>Hari berlanjut! Mentoring kedua adalah dari Kak Vincent Oktavian Kaulika, CEO dari AturKuliner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GHaO1xuE3m0xle3S" /></figure><p>Kak Vincent menyatakan, “teknologi tidak sama dengan solusi. Solusi adalah kombinasi dari orang, proses, dan teknologi.” Ia juga menjelaskan tentang lanskap XaaS dalam perangkat lunak, platform, dan infrastruktur. Untuk mempersiapkan para finalis menyelesaikan studi kasus mereka, Kak Vincent menjelaskan tentang <em>design thinking</em>, pendekatan yang lebih prosedural untuk mengembangkan ide. Dia berkata, “ide-ide bagus datang dari berpikir secara ‘ajaib’ dan dengan pengetahuan teknis,” lalu ia juga membagikan cara untuk mendapatkan keduanya. Sesi mentoring ini juga diakhiri dengan tanya jawab dengan para finalis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lKAvCuqy8cCo7L-W" /></figure><p><strong>Day 2 — Present your work!</strong></p><p>Final yang sebenarnya dimulai! Hari terakhir dimulai dengan registrasi ulang para finalis dan dilanjutkan dengan <em>technical meeting</em> untuk final. Agenda hari ini adalah <em>pitching</em>. <em>Pitching</em> akan dilakukan secara tertutup untuk setiap tim dengan para juri. Dengan studi kasus yang sama, masing-masing tim akan mempresentasikan karyanya selama lima belas menit, dilanjutkan dengan sesi tanya jawab dan pemberian umpan balik dari juri selama delapan belas menit.</p><p>Tim pertama yang melakukan presentasi adalah Minion, dilanjutkan Mumbay Tech, kemudian Chemisthree Consulting Group (CCG) sebagai tim ketiga. Tim Ecstatic mempresentasikan karyanya sebelum ditutup dengan presentasi The A-Team. Setelah itu, para juri mengevaluasi setiap tim dan merundingkan pemenangnya.</p><p><strong>The Winners: Chemisthree Consulting Group (CCG)</strong></p><p>Akhirnya, diumumkan pemenangnya adalah tim CCG yang terdiri dari Gary, Marsellius, dan Felicia dari UGM. Kami berkesempatan mewawancarai mereka. Mereka berbagi kegembiraan atas kemenangan mereka. Menurut mereka, studi kasusnya cukup menantang dan mereka menyebutkan bagaimana mereka belajar banyak untuk berpartisipasi dalam kompetisi ini. Mereka menyatakan bahwa kompetisi ini membantu mereka untuk mengembangkan beberapa keterampilan seperti manajemen waktu, berpikir kritis, dan pemecahan masalah.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F2jV6rVsThqL4xlg" /></figure><p>Kami juga berkesempatan mewawancarai salah satu dari empat juri BizzIT, Pak Irving Hutagalung, Country Engineering Lead di Microsoft. Pak Irving membagikan pandangannya tentang bagaimana Teknologi Informasi (TI) sudah menjadi bagian penting dalam bisnis. Implementasinya hanya berbeda berdasarkan kebutuhannya. Menurutnya, penerapan TI dalam bisnis di Indonesia sudah cukup baik. Hal ini karena orang-orang Indonesia sadar akan teknologi dan fleksibel sehingga implementasinya dapat dilakukan secara cepat. Terakhir, ia berharap agar generasi muda Indonesia terus berinovasi dan tidak ragu. “Jika ingin terjun ke dunia <em>startup</em>, jangan takut gagal. Inovasi Anda bisa apa saja, jika tidak berhasil, Anda hanya perlu menciptakan sesuatu yang baru,” ujarnya.</p><p>Jangan lewatkan update kami, ikuti media sosial kami di @COMPFEST di <a href="https://www.instagram.com/compfest/">Instagram</a>, <a href="https://twitter.com/compfest">Twitter</a>, <a href="https://www.facebook.com/COMPFEST/">Facebook</a>, <a href="https://www.linkedin.com/company/compfest/">LinkedIn</a>, dan situs kami <a href="http://compfest.id/">compfest.id</a>. Baca artikel selengkapnya di <a href="https://medium.com/compfest/press/home">Medium</a> halaman untuk informasi lebih lanjut tentang Competition. (Editorial Marketing/Rahma)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98f0f7652cca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/compfest/bizzit-final-competition-last-step-to-the-trophy-98f0f7652cca">BizzIT Final Competition: Last Step to the Trophy</a> was originally published in <a href="https://medium.com/compfest">COMPFEST</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>