<?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 Ganiilhamirsyadi on Medium]]></title>
        <description><![CDATA[Stories by Ganiilhamirsyadi on Medium]]></description>
        <link>https://medium.com/@ganiilhamirsyadi?source=rss-e9f674a560ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hlCqSgwroIRHYnRo</url>
            <title>Stories by Ganiilhamirsyadi on Medium</title>
            <link>https://medium.com/@ganiilhamirsyadi?source=rss-e9f674a560ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:17:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ganiilhamirsyadi/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[Introduction of React Hooks]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/introduction-of-react-hooks-30a6a5f141fb?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/30a6a5f141fb</guid>
            <category><![CDATA[hooks]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Thu, 26 May 2022 05:18:19 GMT</pubDate>
            <atom:updated>2022-05-26T05:18:19.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aNYqi5QvkNzudjhB.png" /><figcaption>source: <a href="https://user-images.githubusercontent.com/47307889/116921331-826bbe80-ac5c-11eb-9f48-d8fbde144b04.png">https://user-images.githubusercontent.com/47307889/116921331-826bbe80-ac5c-11eb-9f48-d8fbde144b04.png</a></figcaption></figure><h3>What is React?</h3><p>React is a library for building user interface. React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.</p><p>With React we can build encapsulated components that manage their own state. We can compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, we can easily pass rich data through our app and keep state out of the DOM.</p><h4>React Code Sample</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ebacdf038ff144f96e77a18007a883e/href">https://medium.com/media/3ebacdf038ff144f96e77a18007a883e/href</a></iframe><p>Code sample above is a functional component, because it is written in function instead of class (the old school one). A component in React can have one or more props, data that is passed to a component. For example, the Home component above has a name props. We can pass the props to our html and show it to user.</p><p>Code sample above is quite simple, we can improve it by creating a state that keep an input value. We will also create a handler for the onChange event of the input.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d0c1d09816f05ba98787fb4b664a243/href">https://medium.com/media/7d0c1d09816f05ba98787fb4b664a243/href</a></iframe><p>I used the useState function to manage the dateOfBirth state. This function is one of the <strong>hooks </strong>features that functional component has. <strong>Hooks </strong>is a special function in React functional component. Hooks are the functions which “hook into” React state and lifecycle features from function components.</p><p>I will not explain you about the React lifecycle features in this article. For you who are not familiar with React lifecycle features, you can read it on the React official docs <a href="https://reactjs.org/docs/react-component.html">here</a>.</p><h3>React Hooks</h3><p>In this section, I will explain 6 of the most common and useful hooks for a React component.</p><h4>useState</h4><p>It is the most important and often used hook. The purpose of this hook to handle reactive data, any data that changes in the application is called state, when any of the data changes, React re-renders the UI. The example is code sample above when we maintain the value state of an input element and change the state each time the input change.</p><h4>useEffect</h4><p>The Effect Hook, useEffect, adds the ability to perform side effects from a function component. It serves the same purpose as componentDidMount, componentDidUpdate, and componentWillUnmount in React classes, but unified into a single API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a206d03de0e93966fa07c6a8a5cff55/href">https://medium.com/media/5a206d03de0e93966fa07c6a8a5cff55/href</a></iframe><h4>useContext</h4><p>Accepts a context object (the value returned from React.createContext) and returns the current context value for that context. The current context value is determined by the value prop of the nearest &lt;MyContext.Provider&gt; above the calling component in the tree.</p><p>When the nearest &lt;MyContext.Provider&gt; above the component updates, this Hook will trigger a rerender with the latest context value passed to that MyContext provider.</p><p>Code example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65dc598ff3acd34a466a6f8cdfef594d/href">https://medium.com/media/65dc598ff3acd34a466a6f8cdfef594d/href</a></iframe><h4>useRef</h4><p>The useRef returns a mutable ref object whose .current property is initialized to the passed argument (initialValue). The returned object will persist for the full lifetime of the component.</p><p>A common use case is to access a child imperatively:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/28ba5d088e577331c8daf0236fb9d54f/href">https://medium.com/media/28ba5d088e577331c8daf0236fb9d54f/href</a></iframe><h4>useMemo</h4><p>It returns a <a href="https://en.wikipedia.org/wiki/Memoization">memoized</a> value. Pass a “create” function and an array of dependencies. useMemo will only recompute the memoized value when one of the dependencies has changed. This optimization helps to avoid expensive calculations on every render.</p><pre>const memoizedValue = useMemo(() =&gt; computeExpensiveValue(a, b), [a, b]);</pre><h4>useCallback</h4><p>It is similar to useMemo, but for a callback. It returns a <a href="https://en.wikipedia.org/wiki/Memoization">memoized</a> callback. It pass an inline callback and an array of dependencies. useCallback will return a memoized version of the callback that only changes if one of the dependencies has changed. This is useful when passing callbacks to optimized child components that rely on reference equality to prevent unnecessary renders.</p><pre>const memoizedCallback = useCallback(<br>  () =&gt; {<br>    doSomething(a, b);<br>  },<br>  [a, b],<br>);</pre><p>useCallback(fn, deps) is equivalent to useMemo(() =&gt; fn, deps).</p><h3>React Hooks in Action</h3><p>In this term, I took the Software Engineering Project course on my university. My team and I built a cryptocurrency mobile app using React Native. We used a lot of react hooks on the project, here are some of the examples:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c00663c607e23ac794220fa0994946b/href">https://medium.com/media/3c00663c607e23ac794220fa0994946b/href</a></iframe><p>The PromiseButton component is a component that take a promise function. When the promise has not resolved, the button will show a loading animation and it will be disabled.</p><p>The useState hook is used to maintain the loading state of the button. The useEffect has the same purpose of componentDidUpdate lifecycle. Using the useEffect it will execute the callback function inside it if the loading state and promise function changed. The callback inside the useEffect will check the loading state value is true and will set it to false after the promise function has been resolved.</p><h3>References</h3><ul><li><a href="https://reactjs.org/">https://reactjs.org/</a></li><li><a href="https://dev.to/abhisheknaiidu/10-react-hooks-explained-3ino">https://dev.to/abhisheknaiidu/10-react-hooks-explained-3ino</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30a6a5f141fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying and Maintaining Application with Gitlab-CI, Docker, and ELK]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/deploying-and-maintaining-application-with-gitlab-ci-docker-and-elk-f23ed7a0b70c?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/f23ed7a0b70c</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Wed, 25 May 2022 18:15:45 GMT</pubDate>
            <atom:updated>2022-05-26T03:37:16.903Z</atom:updated>
            <content:encoded><![CDATA[<p>Pada semester ini, saya mengambil mata kuliah Proyek Perangkat Lunak. Saya dan teman sekelompok saya mendapat tugas dari klien kami <a href="https://ajaib.co.id/">Ajaib</a> untuk membuat sebuah aplikasi <em>mobile </em>untuk transaksi <em>cryptocurrency.</em></p><p>Arsitektur yang kami gunakan adalah <em>client-server architecture</em>. Aplikasi <em>mobile </em>sebagai <em>client </em>dibuat menggunakan <em>framework React Native, </em>sedangkan untuk sisi <em>server</em>/<em>backend,</em> kami menggunakan <em>NodeJS </em>dengan <em>framework fastify.</em></p><p>Aplikasi yang kami buat tentunya perlu untuk di-<em>deploy </em>agar dapat diakses melalui internet. Dalam melakukan <em>deployment, </em>kami menggunakan <em>Continuous Integration (CI) </em>dan <em>Continuous Delivery (CD) </em>dengan memanfaatkan <em>Gitlab pipelines</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K0gJrnWG5Xw3nvIH.png" /><figcaption><a href="https://about.gitlab.com/images/ci/ci-cd-test-deploy-illustration_2x.png">https://about.gitlab.com/images/ci/ci-cd-test-deploy-illustration_2x.png</a></figcaption></figure><h4>Continous Integration vs Continuous Development</h4><p>CI adalah proses automasi untuk <em>test, build, </em>dan <em>merge </em>suatu fitur baru atau perubahan baru pada sebuah <em>codebase, </em>dalam kasus ini adalah <em>repository Gitlab</em>. CD adalah ekstensi dari CI, dengan menambahkan satu proses automasi, yaitu <em>deployment.</em></p><p>Berikut adalah contoh <em>script CI/CD </em>yang digunakan oleh kelompok kami untuk <em>repository backend </em>yang menggunkana NodeJS,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9af2d4bf934a9faa96946e42676cdac/href">https://medium.com/media/b9af2d4bf934a9faa96946e42676cdac/href</a></iframe><p>Mari kita kupas masing-masing bagian dari <em>script </em>tersebut,</p><p>Pada CI/CD tersebut, <em>image </em>yang digunakan adalah <em>docker</em> (kita akan bahas mengenai <em>docker </em>di bagian selanjutnya). Kemudian didefinisikan beberapa <em>variables </em>yang akan digunakan pada proses CI/CD. <em>Keyword</em> services menyatakan <em>docker image </em>yang dijalankan yang terhubung dengan <em>docker </em>yang didefinisikan oleh <em>keyword </em>image.</p><pre>image: docker:latest</pre><pre>variables:<br>  REPOSITORY_URL: 781315367039.dkr.ecr.ap-southeast-1.amazonaws.com/ajaibdex-backend<br>  REGION: ap-southeast-1<br>  PORT: 8080</pre><pre>services:<br>  - docker:dind</pre><p><em>Keyword </em>before_script berisi perintah yang akan dijalankan sebelum proses CI/CD dimulai. Pada <em>script </em>tersebut dijalankan perintah untuk menginstall beberapa <em>packages</em>, yaitu curl, jq, python3, py3-pip.</p><pre>before_script:<br>  - apk add --no-cache curl jq python3 py3-pip</pre><p>Terdapat empat tahap/<em>stages, </em>yaitu <strong><em>test, build, code-quality, </em></strong><em>dan </em><strong><em>deploy.</em></strong></p><pre>stages:  <br>  - test  <br>  - build  <br>  - code-quality  <br>  - deploy</pre><p>Pada tahap <em>test</em>, dijalankan perintah untuk melakukan tes menggunakan perintah npm test. Selain itu didefinisikan juga beberapa konfigurasi lain, seperti <em>regex pattern </em>untuk perhitungan <em>coverage, docker image </em>yang digunakan untuk proses <em>testing</em>, serta <em>file </em>apa yang ingin disimpan sebagai <em>cache.</em></p><pre>test:<br>  coverage: &#39;/All files[^|]*\|[^|]*\s+([\d\.]+)/&#39;<br>  image: node:lts-alpine<br>  stage: test<br>  script:<br>    - npm ci --prefer-offline --no-audit<br>    - npm test<br>  cache:<br>    key:<br>      files:<br>        - package-lock.json<br>    paths:<br>      - node_modules/<br>  artifacts:<br>    expire_in: 1 hour<br>    paths:<br>      - coverage/<br>  except:<br>    - merge_requests</pre><p>Tahap selanjutnya adalah <em>build</em>, pada tahap ini dibuat <em>docker image baru </em>untuk aplikasi. Setelah selesai proses <em>build</em>, d<em>ocker image </em>tersebut kemudian di-<em>push</em> ke <em>repository </em>pada <em>server.</em></p><pre>build-staging:<br>  image: docker:20-dind<br>  variables:<br>    DOCKER_HOST: tcp://docker:2375<br>    DOCKER_DRIVER: overlay2<br>    DOCKER_TLS_CERTDIR: &quot;&quot;<br>  services:<br>    - name: docker:20-dind<br>      alias: docker<br>      command: [&quot;--tls=false&quot;]<br>  stage: build<br>  script:<br>    - pip3 install awscli<br>    - $(aws ecr get-login --no-include-email --region &quot;${REGION}&quot;)<br>    - IMAGE_TAG=&quot;$(echo $CI_COMMIT_SHA | head -c 8)&quot;<br>    - echo &quot;Building image...&quot;<br>    - echo &quot;$REPOSITORY_URL&quot;<br>    - docker build -t $REPOSITORY_URL:latest .<br>    - echo &quot;Tagging image...&quot;<br>    - docker tag $REPOSITORY_URL:latest $REPOSITORY_URL:staging<br>    - echo &quot;Pushing image...&quot;<br>    - docker push $REPOSITORY_URL:staging<br>  only:<br>    - staging</pre><p>Setelah proses <em>build</em>, dijalankan tahap <em>code-quality </em>yang akan mengunggah data <em>code quality, coverage </em>dan hasil test ke <em>Sonar Scanner. </em>Terdapat dua jenis implementasi tahap <em>code-quality, </em>untuk <em>branch</em> utama <em>(master</em> dan <em>staging) </em>dan untuk <em>branch</em> pada proses pengembangan. Perbedaannya adalah pada parameter branch.target.</p><pre>SonarScanner Dev:<br>  stage: code-quality<br>  image:<br>    name: sonarsource/sonar-scanner-cli:latest<br>    entrypoint: [&quot;&quot;]<br>  dependencies:<br>    - test<br>  variables:<br>    SONAR_USER_HOME: &quot;${CI_PROJECT_DIR}/.sonar&quot; # Defines the location of the analysis task cache<br>    GIT_DEPTH: &quot;0&quot; # Tells git to fetch all the branches of the project, required by the analysis task<br>  cache:<br>    key:<br>      files:<br>        - package-lock.json<br>    paths:<br>      - node_modules/<br>    policy: pull<br>  script:<br>    - sonar-scanner<br>      -Dsonar.projectKey=ppl2022-d-ajaib_backend<br>      -Dsonar.sources=.<br>      -Dsonar.host.url=<a href="https://pmpl.cs.ui.ac.id/sonarqube">https://pmpl.cs.ui.ac.id/sonarqube</a><br>      -Dsonar.login=${SONAR_TOKEN}<br>      -Dsonar.branch.name=${CI_COMMIT_REF_NAME}<br>      -Dsonar.branch.target=staging<br>      -Dsonar.test.inclusions=&quot;tests/**/*.test.ts,tests/**/*.test.tsx&quot;<br>      -Dsonar.exclusions=&quot;node_modules/**,README.md&quot;<br>      -Dsonar.testExecutionReportPaths=&quot;coverage/test-report.xml&quot;<br>      -Dsonar.javascript.lcov.reportPaths=&quot;coverage/lcov.info&quot;<br>  except:<br>    - merge_requests<br>    - master<br>    - staging<br>  allow_failure: true</pre><pre>SonarScanner:<br>  stage: code-quality<br>  image:<br>    name: sonarsource/sonar-scanner-cli:latest<br>    entrypoint: [&quot;&quot;]<br>  dependencies:<br>    - test<br>  variables:<br>    SONAR_USER_HOME: &quot;${CI_PROJECT_DIR}/.sonar&quot; # Defines the location of the analysis task cache<br>    GIT_DEPTH: &quot;0&quot; # Tells git to fetch all the branches of the project, required by the analysis task<br>  cache:<br>    key:<br>      files:<br>        - package-lock.json<br>    paths:<br>      - node_modules/<br>    policy: pull<br>  script:<br>    - sonar-scanner<br>      -Dsonar.projectKey=ppl2022-d-ajaib_backend<br>      -Dsonar.sources=.<br>      -Dsonar.host.url=<a href="https://pmpl.cs.ui.ac.id/sonarqube">https://pmpl.cs.ui.ac.id/sonarqube</a><br>      -Dsonar.login=${SONAR_TOKEN}<br>      -Dsonar.branch.name=${CI_COMMIT_REF_NAME}<br>      -Dsonar.test.inclusions=&quot;tests/**/*.test.ts,tests/**/*.test.tsx&quot;<br>      -Dsonar.exclusions=&quot;node_modules/**,README.md&quot;<br>      -Dsonar.testExecutionReportPaths=&quot;coverage/test-report.xml&quot;<br>      -Dsonar.javascript.lcov.reportPaths=&quot;coverage/lcov.info&quot;<br>  only:<br>    - master<br>    - staging<br>  allow_failure: true</pre><p>Tahap terakhir adalah deploy, pada tahap ini akan dijalankan <em>script </em>pada deploy.sh. Isi <em>script</em> tersebut adalah sebagai berikut:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b84286197fe2b28d656b8521fb9ca07f/href">https://medium.com/media/b84286197fe2b28d656b8521fb9ca07f/href</a></iframe><p><em>Script </em>tersebut berisi perintah untuk mengambil <em>docker image </em>yang sudah di-<em>build </em>dan di-<em>push. </em>Kemudian <em>service </em>pada <em>docker image </em>tersebut dijalankan menggunakan perintah docker compose up -d. Perintah terakhir berfungsi untuk melakukan migrasi ke <em>database</em>.</p><p>Berikut adalah contoh hasil proses CI/CD pada <em>Gitlab,</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*53UVmmTf-YnL1MSjpRHBKA.png" /></figure><h4>Docker Saves Us</h4><p>Pada pengerjaan aplikasi ini, khususnya pada <em>backend, </em>diperlukan <em>database </em>untuk menjalankan aplikasi. <em>Database </em>yang digunakan adalah <em>PostgreSQL</em>. Terdapat kesulitan, yaitu menjaga agar versi dan konfigurasi <em>database </em>yang digunakan bisa sama untuk semua <em>developer </em>ketika aplikasi dijalankan. Oleh karena itu, digunakan <em>docker </em>untuk menjalankan <em>database</em>. <em>Image </em>yang digunakan adalah timescaledb.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f90806d7cf2ddde8e0e8359aad15f24/href">https://medium.com/media/4f90806d7cf2ddde8e0e8359aad15f24/href</a></iframe><h4>Monitoring The App</h4><p>Setelah aplikasi ter-<em>deploy</em>, langkah selanjutnya adalah menjaga agar aplikasi tetap berjalan sesuai dengan ekspektasi kita. Meskipun demikian, tidak ada aplikasi yang sempurna, suatu saat bisa muncul masalah/<em>bug</em> pada aplikasi. Untuk dapat menyelesaikan masalah tersebut, dibutuhkan data.</p><p>Di sinilah fungsi dari <em>monitoring tools, </em>yaitu untuk mengirimkan data, status, atau log dari aplikasi yang berjalan ke suatu sistem untuk divisualisasikan. Salah satu <em>stack </em>yang terkenal adalah <em>Elastic Search, Kibana, and Logstash (ELK)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*h5itKiy-bAghx1CP.png" /></figure><p>Bagaimana ELK bekerja?</p><p><strong>Log<br></strong>Merupakan sebuah pesan yang dikirimkan oleh aplikasi. Log biasa berisi request dan parameternya yang diterima oleh aplikasi. Log juga dapat berupa error yang terjadi pada aplikasi.</p><p><strong>Logstash<br></strong>Berfungsi untuk memproses data yang masuk, pada kasus ini adalah log yang dikirim oleh aplikasi. Pada ELK, data yang masuk diproses agar dapat digunakan oleh ElasticSearch.</p><p><strong>ElasticSearch<br></strong>Berguna dalam <em>indexing</em> data agar pengguna dapat mencari data dengan cepat.</p><p><strong>Kibana</strong><br>Merupakan bagian dari ELK yang berfungsi untuk memvisualisasikan data, termasuk grafik-grafik yang kompleks.</p><h4>Implementasi pada Proyek</h4><p>Pada proyek, saya menggunakan Logit.io sebagai penyedia <em>service </em>ELK. Berikut adalah tahapan yang saya lakukan,</p><ul><li>Install package yang dibutuhkan</li></ul><pre>npm install winston@3.3.3<br>npm install winston-logstash-transport</pre><ul><li>Setelah mendapatkan <em>host</em> dan <em>port </em>dari Logit.io, konfigurasi dimasukkan ke objek <em>logger </em>(pada implementasi ini bernama winston).</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/902bcec662647aeeed84484f98f2da42/href">https://medium.com/media/902bcec662647aeeed84484f98f2da42/href</a></iframe><ul><li>Logger ditambahkan pada bagian <em>code</em> yang ingin dibuatkan lognya. Contohnya pada <em>url </em>berikut, setiap <em>request </em>yang masuk akan dikirim lognya.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29aaee85caedd67113971849ac082d64/href">https://medium.com/media/29aaee85caedd67113971849ac082d64/href</a></iframe><ul><li>Tampilan pada Kibana</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZRQZ28JE5Y25hmp3lwjTfQ.png" /></figure><h4>Referensi</h4><ul><li><a href="https://www.elastic.co/what-is/elk-stack">https://www.elastic.co/what-is/elk-stack</a></li><li><a href="https://logit.io/sources/configure/nodejs">https://logit.io/sources/configure/nodejs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f23ed7a0b70c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be Good to Yourself before Trying to Be Good to Other]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/be-good-to-yourself-before-trying-to-be-good-to-other-43216a51831d?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/43216a51831d</guid>
            <category><![CDATA[people-management]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Thu, 12 May 2022 23:20:44 GMT</pubDate>
            <atom:updated>2022-05-13T00:07:45.462Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*N0crBTa9oozVAhyB" /></figure><p>As a computer science student, doing all the stuff without having a communication with someone else is almost impossible. No matter how smart you are, how high skilled you are, you will need to communicate with another person.</p><p>Let’s take an example, Now I am taking Software Engineering Project course. In this project, Me and my teammates have to build a mobile app with cryptocurrency functionalities, such as receive/send token, watchlist, portfolio, and many more.</p><p>This project is not only about developing an application. We need to communicate with the lecturer, clients, teaching assistants, someone to be our User Acceptance Testing participant, someone to review our code, and probably many more.</p><p>Communication has a big role in the software engineering, in this article I will share my journey about how I develop my communication skill as a computer student and share some tips that might help you.</p><h4>Before trying to be good to another person, be good to yourself</h4><p>At the first time I went to university, I felt like no one want to be friend with me. I had a thought like that because I came from a small town in Central Java. I had a “<em>medok</em>” accent that seems not normal in Jakarta (Indonesia’s capital city). I couldn’t think I will make any friend here, but THAT IS THE MISTAKE.</p><p>The first friend you have is you. Before you can have someone else to be your friend, you must be friend with yourself, don’t hate yourself/think yourself as an enemy. If you have accepted yourself and embrace it, you will have more confidence that will help you to make some friends.</p><h3>Making Friends</h3><blockquote>We have two ears and one mouth so that we can listen twice as much as we speak.<br> — <strong>Epictetus</strong></blockquote><p>Once you have the confidence, you can start making friends. My life lesson about making friend is “Be a good listener first and wait for your turn to share your idea”.</p><p>The good thing about computer science students is they are so diverse, you can find a gamer, anime lovers, athlete, content creator, genius guy, and much more. It is a fun experience to try to talk with people with different interest. I can learn and know new things.</p><p>Enjoy the diversity and try to find someone who has the same interest with you!</p><h4>How to Keep the Friendship</h4><p>When I finally have friends, I want it to last longer. Keeping a friendship is like keeping a boat to keep sailing. If you want the boat to keep sailing, both of the passengers need to row the boat. In biology, we learnt about <em>symbiosis mutualism, </em>a relationship where two species helping each others. We need that type of relationship to keep a friendship long lasting. I always try to be a helpful person to my friends and I will try my best to help them if they need my help.</p><p>Another lesson I learnt about keeping a friendship is to mind your words before you say it. Mouth is useful to share a great idea, funny things, motivation, but at the same time it can be a weapon. If you say something that hurt someone’s feeling it will be a weapon that shoot a bullet to your friend’s heart.</p><h4>The World is Not Revolving Around You</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*gODm1f8vvOwuR2g7.jpg" /></figure><p>We as a human have ideas, opinions, beliefs, and principles. What we should know is, other human also have theirs and it can be completely different with us. A simple example, I really don’t like durian, doesn’t mean all person on this earth don’t like it too. Some people may say durian is their most favorite food. We need to respect their opinion.</p><p>Another example, we live in Indonesia that have different races, cultures, and religions. Even with all of those differences, every human are equal and we have to treat them equally.</p><p>In my opinion, as long as their difference doesn’t hurt/harm people, we have to respect them. Hating people because they are not the same as you is the worst thing you can do as a social human being.</p><h3>Work on a Team</h3><p>In my software engineering project course, I work on a team of 7 people. We have to build a cryptocurrency mobile app while keep a good communication with the client, lecturer, and teaching assistants. We also do the Scrum event, such as Sprint Planning, Standup, UAT, Sprint Review, and Sprint Retrospective. There are a lot of works, communications, and responsibilities on this project.</p><p>How to be a good and supportive member that help the team to achieve its goal?</p><h4>Do Your Task that has been Assigned to You as Soon as Possible</h4><p>This is my first lesson, doing the task ASAP will help you with several reason,</p><ol><li>If you get into a problem, you have more time to solve it. It also means you have more time to discuss it with your teammates.</li><li>If you can finish early, you can help your friend who have problems.</li><li>You have more time to do something else, such as doing a research about team’s future task.</li></ol><h4>Break the Ice!</h4><p>Coding is a fun thing to do, until you have to do it continuously, restless, and facing into so many bugs. As a team member, you can give some support to your teammates, like sharing some memes :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KkCS8dIagmlrL4wM.png" /></figure><h4>Be Helpful and Fast Response</h4><p>When doing a project, it’s a common thing to face an issue. If one of your teammate struggle with an issue, try offering some help. It can be as simple as googling the issue and share the result to your friends.</p><p>Another thing that you can do is be fast response. My team’s member are busy, some of them do an internship, organization, competition, etc. Time is money and they don’t want to waste their time. Being fast response is really helpful because it can reduce the time to solve an issue.</p><h4>Having some Idea? Share It!</h4><p>The good thing about a team is we try to achieve something together. If a team is a processor, then it is a multi core processor. It has more than one brain to produce ideas, to solve a problem, and to achieve the goals.</p><p>All members in a team can share their ideas, opinions, researches, even memes! It make a team full of innovations and solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43216a51831d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Tips to Develop React Native Project Cleanly]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/some-tips-to-develop-react-native-project-cleanly-2160dbcf905a?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/2160dbcf905a</guid>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Thu, 12 May 2022 21:02:54 GMT</pubDate>
            <atom:updated>2022-05-12T21:10:23.895Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you clean your code?</p><blockquote>Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write. <strong>(Robert C. Martin)</strong></blockquote><p>When I came across this quote on the internet, i can relate to it. Currently, I am working on a company as Frontend Engineer and sometimes I found a short old code that took me almost an hour just to understand what it does. That is a perfect example of a functioning code, but not a “friendly” code.</p><p>As an engineer, we can’t just write a functioning code, but also a “nice, gentle, and friendly” code. “What do you mean Gani?”. It is a type of code which, if someone read your code they can read it like a bedtime story, clear and easy to understand. The programmer community called this code as a “Clean Code”.</p><p><em>It looks promising and nice, how to make a code be a clean code?</em></p><p>We will learn through it with an example of a React Native project. It is my current project on Software Development Course at my university.</p><h3>Project Structure</h3><p>A clean project structure is the start line of a clean code. We can work on this by creating a folder for a functionality instead of throwing everything in just a single main folder. By doing this, developer will find a file easier and it gives the developer the general purpose of a file. Let’s take a look at my current project,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*9LBkJSFF-MOAqfd6jQdtIw.png" /><figcaption>Project Structure</figcaption></figure><p>As I mentioned before, my project structure has several folders that represent every function/category from the project. The screens contains all of the main screen for the app. Each main screen will contains one or more components, those components kept in a different folder. This approach will help developers if they want to reuse the same component.</p><h3>Using TypeScript instead of Javascript</h3><p><strong>TypeScript is</strong> a strongly typed programming language that builds on JavaScript. It similar to other strongly typed programming language, such as Java. Because of this characteristic, it can help another programmer to understand your code better, by giving them the type of parameters and return of a function, variables, and object so they can expect the input and output more clearly.</p><p>The common example is props in a React component,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31WK4V2gTZ6yHPKg3XRn7g.png" /><figcaption>Props Interface</figcaption></figure><h3>Format The Code (Do It Automatically)</h3><p>Clean code, also means the code look nice and clean in text. It includes the consistent indentation, spacing, line width, same type of quotes, consistent comma or semicolon, and much more. Let’s first take a look at “Not” a Clean Code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*EfCKclFSrhlM4ZZdsLUy5w.png" /><figcaption>Not a Clean Code</figcaption></figure><p>The code above works perfectly without a bug, but most of you must be confused when reading the codes. There is no consistency <strong>at all</strong>. Let’s try to fix it,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHtOKrAsUk2voEEg04-6XQ.png" /><figcaption>Clean Code</figcaption></figure><p>It is much better, isn’t it?</p><p>Fixing a few lines of code like that is not a hard job, until it is not just “a few” anymore, but hundreds of lines. This is where a formatting tools came into place. In my project, we use <strong>Prettier</strong> to do the formatting works. For a VSCode user, you can press <strong>F1</strong> and type “Format Document”, <em>voila</em><strong><em>!</em></strong></p><h3>Some Must Follow Guidelines when You Writing Codes</h3><p>We have talked about some tips for a clean code in “general”. We haven’t jump into the code itself. These are some “must follow” guidelines to make your code clean and easy to read,</p><h4>Intuitive Variable Names</h4><p>A variable should tell what data it saved, as an example:</p><pre>// Example 1<br>x = data.filter(x =&gt; x.gender == &#39;male&#39;)</pre><pre>// Example 2<br>maleUserData = data.filter(x =&gt; x.gender == &#39;male&#39;)</pre><p>Me personally prefer a long variable name that describe what data and type the variable saved instead of short variable name but it is not clear what data it saved.</p><h4>Self Explanatory Function</h4><blockquote>Don’t use a comment when you can use variable and function. <strong>(Robert C. Martin)</strong></blockquote><p>Some people will argue that we must give a comment for every function we made. The fact is, writing a comment for every function takes a lot of time and cost. It doesn’t mean we don’t need any comment at all, but most of the time we don’t.</p><p>A function that written with a clean code will be easy to read. The name and the implementation should be enough to tell developer what it is doing.</p><p>Let’s take a look at code below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOulAtefhuuaAoPY14TADQ.png" /><figcaption>Self Explanatory Function</figcaption></figure><p>The name of the function has told us what it does, to convert any error string to a meaningful message that user can understand. The implementation of the function is also clear, it will check for specific substring to generate the message.</p><h4>Use Typing</h4><p>Typing is a powerful feature of a language, such as Typescript. It can prevent a future bug that caused by human error. It make the code predictable too. One great benefit of using typing is <strong>intellisense</strong>. It is a feature on some code editor to predict the name of a variable/function while we start typing.</p><h3>Start Write a Clean Code from Now</h3><p>Writing a clean code not only help developers to understand your code better, but also reduce the cost of a project. The time needed to read and understand a code is much more than write the code itself. By applying clean code to a project, it will cut the time and developers can focus on improving and make enhancements of on going feature.</p><p>Start your clean code journey now!</p><h4>Reference</h4><ul><li>Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2160dbcf905a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mock and Stub in React Native Testing]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/mock-and-stub-in-react-native-testing-3fa8ce2b0aca?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fa8ce2b0aca</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[mock]]></category>
            <category><![CDATA[stub]]></category>
            <category><![CDATA[test]]></category>
            <category><![CDATA[mocking]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Mon, 11 Apr 2022 01:52:29 GMT</pubDate>
            <atom:updated>2022-04-11T07:16:56.670Z</atom:updated>
            <content:encoded><![CDATA[<p>Mocking, Stubbing, Joking(?)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*12i6IeQtrJlPFqxY.jpg" /></figure><p>Before we jump into mock and stub, let’s discuss about <strong>Test Double</strong>. Test Double is a generic term for any case where you replace a production object for testing purposes (Martin Fowler, 2006). There a several kind of it: Dummy, Fake, Stubs, Spies, and Mocks. We will focus on Stubs and Mocks. If you are interested to know the rest you can visit this <a href="https://martinfowler.com/bliki/TestDouble.html">article</a>.</p><h3>Mocks vs Stubs</h3><ul><li>Mock is a Test Double variant which has a purpose to verify object’s behaviors/functions. You mock a function but not a state.</li><li>Stub has a purpose to verify object’s state/context. You stub a state not a function.</li></ul><h3>Why do we need to mock / stub?</h3><p>Production function can be hard to test, especially when they have side-effect, such as API Call to another server which need an internet connection. Mocking a function means, we only care about specific parts of the function, such as its return or exception.</p><p>Let’s say we have a function called getBooks() which will call an API to get list of books. The production function will depend on the server and internet, if one of those thing have an issue it can break the test. Even though, its functionality is correct. You can mock getBooks() to return the data directly without the need to calling the real API.</p><p>The same thing goes for stubbing, sometime to get to a particular state, you need to do several steps first. In testing, you need to reduce the testing time as much as possible. Instead of simulating the steps to get to that state, you can directly stub the state to match your needs.</p><h4>Isolate The Test</h4><p>The goals of mock/stubs in general is to isolate the test from the real production environment. So it can be done safely but still test the functionality.</p><h3>Real World Example</h3><p>Let’s take a look at my Ajaib React Native project and get a real example of Mock and Stub,</p><h4>Mocking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7B-IVKiogSQGrKzT-qaaQ.png" /></figure><p>I have a function useConnector, the real implementation is to call third party crypto API to get data linked to current login user, such as his wallet data. As I’ve mentioned before if we don’t mock the function, It will depend on the internet connection. If the internet/third party api have an issue, the test will be failed. To prevent it, you can mock its return, to return the data you needs directly.</p><h4>Stubbing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*H01XQSEjqiNB4VFNLeBhOw.png" /></figure><p>Here I stub the wallet state to match my need for testing purpose. If I have to change state by action manually, I need to simulate the register and login step that take much time.</p><p>References:<br>- <a href="https://martinfowler.com/bliki/TestDouble.html">https://martinfowler.com/bliki/TestDouble.html</a><br>- <a href="https://www.huzefril.com/posts/testing/mock_vs_stub">https://www.huzefril.com/posts/testing/mock_vs_stub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fa8ce2b0aca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Refactor Like a Doctor]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/refactor-like-a-doctor-825d54c686cc?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/825d54c686cc</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[refactoring]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Sun, 10 Apr 2022 18:24:57 GMT</pubDate>
            <atom:updated>2022-04-10T20:36:28.691Z</atom:updated>
            <content:encoded><![CDATA[<p>Writing code is not easy, but writing an efficient, simple, and clean code is even harder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zfk1jCx39dpT1P73.jpg" /></figure><p>Refactoring is a systematic process of improving codewithout creating new functionality that can transforma mess into clean code and simple design (<a href="https://refactoring.guru/refactoring">refactoring.guru</a>).</p><p>Refactoring’s purpose is to fight “technical debts”. It is not the same with your bank account debts, but it is something that you also have to pay (with time and effor). Technical debts is messy and dirty codes that accumulated during the development process. Refactoring can turn those messy codes into clean codes, like a doctor cures an ill person to become a healthy person.</p><h3>Clean Code</h3><p>What is a clean code anyway? Based on refactoring.guru, a clean code has these criterias:<br>- Other programmers can understand it well and easily<br>- It doesn’t have duplication<br>- It contains minimal moving parts<br>- Clean codes pass all the tests<br>- It is easier and cheaper to maintain.</p><h3>Code Smell (React)</h3><p>A dirty code is basically the opposite of a clean code. Just like a dirty trash, you can also smell it (bad smell). A code smell is a characteristic of a dirty code. What are they?</p><h4>Bloaters</h4><p>Bloaters are codes, methods, or classes that are too long and hard to maintain. Here is an example of a bloaters in a react project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzls8M0372IPvysa9mrLTA.png" /><figcaption>Bloaters ilustration</figcaption></figure><p>Instead of throwing all the data to a single component, you can extract it to several components, such as &lt;Navbar/&gt;, &lt;Header/&gt;, and &lt;Content/&gt;.</p><h4>Dispensable</h4><p>Back in my internship time, I found a file with half of the codes is a commented out codes. I asked my teammates about it and no one was really sure why the commented codes exists. At the end, I figured it out that it was a test code and deleted it. It is an example of a dispensable code, a code that is pointless and unneeded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*afn6rj3re3BOIwpQE7AlTg.png" /><figcaption>Dispusable ilustration</figcaption></figure><h4>Couplers</h4><p>A couple is two individuals of the same sort considered together. They are connected to each other. Sometime, one also depend on another. Couple is a sweet thing in world, but it’s not when coming to a code. Too much dependency among the codes are hard to maintain and prone to be a bug in the future.</p><p>In a react project, one of the common example of couplers are deep props chaining. If the props structure changed, you have to recheck the component with that props and all of its chain to make sure the change won’t affect its functionality.</p><h3>Some Techniques of Refactoring</h3><p>We have talked about what makes a code be a dirty code. Let’s find out how to fix those type of codes.</p><h4>Composing Methods</h4><p>Composing a methods means breaking down a long method to smaller methods that are easy to understand.</p><h4>Organizing Data</h4><p>This technique help you on how to handle the data effectively, such as replacing an array with an object to enrich the meaning of a data.</p><h4>Simplifying Conditional Expressions</h4><p>Converting deep nesting if else statement with a simple and easy to understand conditional expression is the goal of this technique.</p><h4>Simplifying Method Calls</h4><p>Take a look at this method calls generateData(name, age, school, date_created, is_teacher, address, phone_number, gender, date_of_birth);. What can we do to simplify it. We can create a Class/Interface/Type to represent the data, as an example Person {name, school, is_teacher, address, phone_number, gender, date_of_birth}. You might be wondering, where is the date_created and age. Both of those data can be generated automatically, so you can remove those from parameters.</p><h3>Real World Example</h3><p>Let’s take a look at some examples from my Ajaib project. In the last sprint I looked at the Sonarqube and found out that the project has more than 10 code smells detected. I will provide some of the example and try linking it back with what we’ve learnt before.</p><h4>Unneeded Assertion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EEQIWE4a_VlB-m5fjX422Q.png" /></figure><p>The assertion of that line can be removed because this.wallet will always return a valid object. This code smell can be categorized as “Dispensable”.</p><h4>Never give two variables the same name</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T-31gm4FqGB8CMDDHKIUcg.png" /></figure><p>In this change, I change storeRecord to storedRecord because storeRecord has been declared on the upper scope. Even though this issue won’t affect the functionality of the program, it can cause ambiguity for other developers.</p><h4>Remove unused import</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZOg15iCn3clTTdEdIckWA.png" /></figure><p>This type of code smell is the most common mistake I found on the report. It simply import statement that unused or a “Dispensable” code.</p><p>Reference:<br>- <a href="https://refactoring.guru/">https://refactoring.guru</a><br>- Fowler, M. (2000, July). Refactoring. In TOOLS</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=825d54c686cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TDD | How to do it?]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/tdd-how-to-do-it-40d0895789d1?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/40d0895789d1</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[test]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 04:21:14 GMT</pubDate>
            <atom:updated>2022-05-09T13:45:28.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1rFMy7kvUAwUtIU1.png" /><figcaption>source: <a href="https://marsner.com/wp-content/uploads/test-driven-development-TDD.png">https://marsner.com/wp-content/uploads/test-driven-development-TDD.png</a></figcaption></figure><p>TDD atau Test Driven Development adalah suatu pendekatan dalam <em>software development, </em>di mana sebelum mulai mengimplementasikan fitur/fungsionalitas pada sebuah <em>software</em>, <em>programmer </em>membuat <em>test </em>yang akan memvalidasi apa yang akan dilakukan oleh <em>code </em>yang akan dibuat. <em>Test cases </em>untuk setiap fungsionalitas dibuat terlebih dahulu dan dijalankan. Jika suatu <em>test </em>gagal, maka <em>programmer</em> menuliskan <em>code </em>agar <em>test </em>tersebut lewat.</p><h3>Permasalahan pada Traditional Testing</h3><p><em>Traditional testing </em>yang saya maksud kali ini adalah pembuatan <em>test </em>setelah suatu fitur diimplementasikan. Pendekatan ini memunculkan suatu permasalahan, yaitu <em>developer </em>dituntut untuk membuat <em>test </em>agar seluruh <em>code </em>untuk fitur yang dia buat ter-<em>test</em> secara keseluruhan.</p><p>Hal ini akan menjadi semakin parah apabila <em>developer </em>tersebut ternyata <strong><em>over engineering</em></strong><em> </em>ketika mengerjakan fiturnya. <em>Over engineering </em>adalah istilah untuk pengimplementasian <em>code </em>yang terlalu berlebihan dibanding spesifikasi awalnya. Alhasil <em>test </em>yang perlu dibuat pun semakin banyak dan kompleks.</p><p>Permasalahan ini seharusnya dapat dihindari apabila TDD diterapkan. <em>Test </em>yang dibuat disesuaikan dengan spesifikasi program, kemudian tugas <em>developer </em>adalah menuliskan <strong>cukup</strong> <em>code </em>hanya untuk melewati <em>test </em>tersebut. Dengan demikian, <em>code </em>yang ditulis hanyalah <em>code </em>yang diperlukan, tanpa keluar dari <em>test scope.</em></p><h3>TDD vs Traditional Testing</h3><p>Selain mengatasi permasalahan pada <em>traditional testing </em>yang sudah dibahas sebelumnya, TDD juga memiliki beberapa keunggulan dibanding <em>traditional testing</em>:</p><ul><li>Dengan <em>traditional testing</em>, jika sebuah <em>test</em> sukses, belum tentu <em>code </em>yang sudah ditulis bebas dari <em>defect</em> atau <em>bug </em>karena bisa jadi ada baris <em>code </em>yang belum dites. Pada TDD, jika suatu <em>test </em>gagal, artinya kita membuat progress dan perlu membuat implementasi agar <em>test </em>tersebut berhasil.</li><li>TDD dapat memastikan <em>code </em>yang ditulis sesuai dengan <em>requirement</em> yang ada. Hal ini dikarenakan <em>test </em>pada TDD didasarkan pada <em>requirement</em>.</li><li>Pada TDD, fokus utamanya adalah bagaimana membuat <em>production code </em>yang dapat memverifikasi <em>test </em>yang dibuat. Sebaliknya, pada <em>traditional testing</em> fokusnya menjadi bagaimana mendesain <em>test</em> yang baik dan dapat meng-<em>cover</em> seluruh <em>code </em>yang sudah dibuat.</li><li>Jika TDD dilakukan dengan benar, maka akan selalu didapatkan 100% <em>test coverage</em>. Hal ini mungkin karena <em>code </em>yang ditulis hanya untuk membuat suatu <em>test</em> berhasil.</li></ul><h3>Bagaimana proses dari TDD?</h3><p>TDD merupakan sebuah siklus yang terdiri dari 3 tahap, yaitu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/0*rljGcwsvRupHAFh7.png" /><figcaption>source: <a href="https://www.guru99.com/test-driven-development.html">https://www.guru99.com/test-driven-development.html</a></figcaption></figure><ol><li>Pembuatan <em>test</em></li><li>Penulisan implementasi <em>code </em>agar <em>test</em> berhasil</li><li><em>Refactor</em></li></ol><p>Tiga tahapan tersebut juga sering dikenal sebagai <strong>RED, GREEN, REFACTOR</strong>. Mari bahas lebih lanjut masing-masing tahapannya.</p><h4>RED</h4><p>Ketika spesifikasi untuk suatu fitur sudah didapatkan, hal pertama kali yang perlu dilakukan adalah membuat sebuah <em>unit test </em>yang merepresentasikan fungsionalitas dari sebagian fitur tersebut. Contohnya, terdapat fitur untuk membuat sebuah <em>navbar</em>. <em>Test </em>pertama yang bisa dibuat adalah mengecek apakah menu-menu pada <em>navbar </em>sudah tampil. Ketika <em>test</em> tersebut dijalankan, dapat dipastikan <em>test </em>tersebut akan <em>failed.</em></p><h4>GREEN</h4><p>Setelah dibuat <em>test</em> yang sudah disebutkan pada tahap RED, maka tahap selanjutnya adalah membuat implementasi <em>code </em>yang dapat membuat <em>test </em>tersebut lolos. Artinya, <em>developer </em>perlu membuat komponen <em>navbar </em>yang berisi menu-menu pada <em>test</em>. Apabila <em>test </em>dijalankan kembali, seharusnya <em>test</em> tersebut berhasil.</p><h4>REFACTOR</h4><p>Pada tahap <em>refactor, code </em>yang sudah dibuat dapat diperbaiki/di-<em>improve, </em>tetapi tetap lolos <em>test </em>yang sudah dibuat. Pada kasus <em>navbar </em>misalnya, proses <em>refactor </em>dapat berupa perbaikan <em>styling</em> pada komponen. Tentunya mengubah warna tulisan pada <em>navbar </em>tidak akan mengubah status <em>test </em>yang sudah ada.</p><p>Setelah satu siklus tersebut selesai, kita dapat lanjut ke siklus baru. Contohnya dalam kasus <em>navbar </em>di atas, kita dapat menambahkan <em>test</em> baru yang akan menguji fungsionalitas dari <em>navbar </em>(contoh: ketika suatu menu diklik maka url harus pindah). Setelah <em>test </em>tersebut dibuat maka dapat dilanjutkan ke tahap GREEN dan REFACTOR. Siklus TDD tersebut akan terus diulang hingga keseluruhan fitur pada <em>requirements </em>dibuat.</p><h3>Contoh penerapan TDD</h3><p>Pada contoh kali ini, fitur yang akan dibuat adalah <em>navigation button </em>yang akan mengubah isi konten dari suatu halaman. Fitur tersebut merupakan bagian dari sebuah proyek React Native. <em>Test </em>dibuat menggunakan <em>react native testing library. </em>Proyek ini disimpan dalam sebuah <em>gitlab repository </em>dan terdapat <em>CI/CD </em>yang akan menjalankan <em>test </em>untuk setiap <em>commit</em>.</p><p>*Tambahan mengenai <em>commit</em>, biasanya nama <em>commit </em>disertai dengan tahapan TDD-nya, misalnya [RED] Add test for navigation button</p><h4>Tahap RED</h4><p>Pada tahap ini, dibuat <em>test </em>yang akan mengecek dua hal: halaman dapat di-<em>render </em>dan tombol navigasi bekerja sesuai fungsinya (mengubah konten halaman).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6193e2fe6b0b3a487bdb020d032849e/href">https://medium.com/media/d6193e2fe6b0b3a487bdb020d032849e/href</a></iframe><p>Apabila <em>test </em>dijalankan seharusnya masih belum lolos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFS3OmwTM2jJRl32LuqDiA.png" /><figcaption>test failed</figcaption></figure><h4>Tahap GREEN</h4><p>Pada tahap ini, dibuat <em>code </em>implementasi yang membuat <em>test </em>sebelumnya lolos. Contoh <em>code </em>implementasinya adalah sebagai berikut:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46ba0404100a3d32dbada15e4dd3fa92/href">https://medium.com/media/46ba0404100a3d32dbada15e4dd3fa92/href</a></iframe><p>*<strong>OnramperScreen</strong>,<strong> SendScreen</strong>,<strong> </strong>dan <strong>ReceiveScreen </strong>merupakan komponen yang berisi konten halaman.</p><p>Apabila <em>test </em>dijalankan kembali, seharusnya sudah lolos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmqu9v9ziIkCPf7H7KBmSQ.png" /><figcaption>test passed</figcaption></figure><h4>Tahap REFACTOR</h4><p>Di tahap ini, yang saya lakukan hanyalah mengubah <em>code styling </em>atau gaya penulisan <em>code</em>, tanpa mengubah fungsionalitas dari <em>code </em>yang sudah ada. Pada tahap ini, <em>test </em>harus tetap lolos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtfimrSHEWLi0T53ppLYRQ.png" /><figcaption>test is still passed</figcaption></figure><h3>Bonus: Jenis-jenis tes pada pengembangan sebuah software</h3><p>Dilihat dari skala dan alurnya, tes dapat disusun dengan urutan berikut <strong>unit test</strong>, <strong>integration test</strong>, <strong>functional test</strong>, <strong>end to end test</strong>, <strong>acceptance test</strong>, dan <strong>performance test</strong>.</p><h4>Unit test</h4><p>Tes ini bertujuan untuk menguji pada level method atau class yang dibuat dalam sebuah module/service. Unit test dapat dilakukan dengan sangat cepat dan tidak memerlukan banyak biaya.</p><h4>Integration test</h4><p>Pada sebuah aplikasi tidak jarang memiliki beberapa services/modules sekaligus. Tes ini bertujuan untuk memastikan antar services/modules dapat berjalan dan berintegrasi sesuai dengan tujuannya.</p><h4>Functional test</h4><p>Jika kedua tes sebelumnya masih berfokus pada isi dari program itu sendiri, functional test berfokus pada pengujian fungsionalitas dari suatu aplikasi dalam segi bisnis, contohnya menguji untuk mendaftarkan akun.</p><h4>End to end test</h4><p>End to end test menguji fungsionalitas dari aplikasi secara keseluruhan. Jenis tes ini berusaha untuk mereplika perilaku pengguna di dunia nyata dalam menggunakan aplikasi.</p><h4>Performance test</h4><p>Jenis tes ini tidak berfokus pada fungsionalitas dari suatu aplikasi tetapi performa yang dihasilkannya. Sebagai contoh, bagaimana aplikasi tersebut menangani beban request yang tinggi.</p><h3>Referensi</h3><ul><li><a href="https://www.guru99.com/test-driven-development.html">https://www.guru99.com/test-driven-development.html</a></li><li><a href="https://www.konsepkoding.com/2020/06/apa-itu-test-driven-development-tdd.html">https://www.konsepkoding.com/2020/06/apa-itu-test-driven-development-tdd.html</a></li><li><a href="https://www.linkedin.com/pulse/kenapa-test-driven-development-tdd-adhytia-wana-putra/?originalSubdomain=id">https://www.linkedin.com/pulse/kenapa-test-driven-development-tdd-adhytia-wana-putra/?originalSubdomain=id</a></li><li><a href="https://medium.com/koding-kala-weekend/tdd-the-series-part-1-apa-itu-test-driven-development-tdd-ff92c95c945f">https://medium.com/koding-kala-weekend/tdd-the-series-part-1-apa-itu-test-driven-development-tdd-ff92c95c945f</a></li><li><a href="https://www.perfecto.io/resources/types-of-testing#:~:text=Functional%20testing%20types%20include%20unit,how%20well%20the%20app%20works">https://www.perfecto.io/resources/types-of-testing</a></li><li><a href="https://www.atlassian.com/continuous-delivery/software-testing/types-of-software-testing">https://www.atlassian.com/continuous-delivery/software-testing/types-of-software-testing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40d0895789d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Berkenalan dengan Scrum dan Agile]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/berkenalan-dengan-scrum-dan-agile-2c0ffd81c740?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c0ffd81c740</guid>
            <category><![CDATA[scrum-master]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[product]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 04:15:08 GMT</pubDate>
            <atom:updated>2022-05-09T14:30:30.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ZMb0A_5U5UctU8Am" /></figure><h3>Apa itu A<em>gile</em>?</h3><p>Untuk dapat me-<em>manage</em> suatu proyek dengan efisien, manajer dan tim proyek perlu menerapkan sebuah metodologi yang sesuai dengan proyek yang akan dikerjakan. Salah satu metodologi yang cukup terkenal adalah <em>agile</em>.</p><p>Sesuai dengan namanya, metodologi <em>agile </em>memiliki ciri khas yang “lincah” dan “tangkas”. Metode ini berusaha untuk meminimalkan resiko ketika suatu fungsionalitas baru ditambahkan. Pada <em>agile</em>, <em>software </em>dikembangkan secara iteratif dan untuk setiap iterasinya terdapat fungsionalitas baru yang ditambahkan. Oleh karena itu, metodologi <em>agile </em>cocok digunakan pada proyek yang kontinu dan selalu ada perubahan/penambahan fungsionalitas baru.</p><p>Metodologi <em>agile</em> memiliki beberapa penerapan yang cukup terkenal, contohnya <em>scrum, crystal, extreme programming (XP), </em>dan <em>feature-driven development</em> <em>(FDD)</em>. Pada blog ini, saya akan membahas lebih dalam mengenai <em>scrum</em>.</p><h3>Apa itu Scrum?</h3><p><em>Scrum </em>adalah sebuah kerangka kerja <em>(framework) </em>dalam mengembangkan sebuah produk, khususnya perangkat lunak <em>(software)</em>. <em>Scrum </em>membantu sebuah tim untuk menghasilkan <em>value</em> melalui solusi adaptif dalam menyelesaikan permasalahan yang kompleks.</p><h3><strong>Scrum Events</strong></h3><p>Pada saat tim mengadopsi <em>framework scrum, </em>terdapat beberapa <em>events</em> atau <em>ceremonies</em> yang dilakukan oleh tim setiap <em>sprint. Events </em>tersebut biasanya dikategorikan menjadi 4 macam jenis, antara lain sebagai berikut:</p><h4>1. Mengorganisasikan <em>backlog</em></h4><p>Pengorganisasian <em>backlog</em> atau <em>backlog g</em>Pengorganisasian <em>backlog</em> atau <em>backlog grooming</em> adalah <em>event </em>yang menjadi tanggung jawab <em>product owner.</em> Tanggung jawab utama dari seorang <em>product owner </em>adalah untuk memastikan bahwa produk yang sedang dikembangkan oleh tim sesuai dengan <em>goal </em>produk yang ditetapkan di awal. <br>Selain itu, <em>product owner</em> juga harus mampu untuk selalu <em>keep up</em> dengan kebutuhan market dan keinginan <em>customer.</em> Oleh karena itu, <em>product owner</em> mengatur <em>backlog</em> dengan memanfaatkan <em>feedback</em> dari user dan tim pengembang untuk membantu dalam membuat skala prioritas dan menyusun <em>backlog</em> sejelas mungkin.</p><h4><em>2. Sprint Planning</em></h4><p>Pada <em>event </em>ini, tim akan mendefinisikan pekerjaan yang akan dikerjakan atau <em>scope</em> untuk <em>sprint</em> yang akan berlangsung. Penentuan dan pendefinisian <em>scope </em>biasanya dibahas oleh seluruh tim pengembang dalam sebuah rapat yang dipimpin oleh <em>scrum master</em>. Dalam rapat ini juga lah, <em>sprint goal </em>ditentukan dan disepakati oleh seluruh tim. Setelah itu, tim akan menambahkan <em>user story </em>tertentu dari <em>product backlog</em>.</p><p><em>User story </em>adalah deskripsi mengenai <em>system requirements</em> setiap fitur dalam bahasa yang sederhana dan mudah dipahami <em>user</em> yang mungkin belum begitu canggih dalam menggunakan teknologi. <em>User story </em>yang digunakan juga harus sejalan dengan tujuan <em>sprint</em> dan disepakati oleh seluruh tim pengembang. Jika pengembang merasa <em>user story </em>yang digunakan tidak <em>feasible</em> untuk diimplementasikan selama <em>sprint</em>, maka <em>user story </em>tersebut tidak akan disetujui.</p><p>Pada akhir <em>sprint planning, </em>setiap anggota dari tim pengembang harus memiliki gambaran yang jelas akan <em>deliverables </em>yang harus diselesaikan pada akhir <em>sprint</em> dan bagaimana cara menyelesaikan <em>deliverables</em> tersebut.</p><h4><em>3. Sprint</em></h4><p><em>Sprint </em>adalah waktu dimana tim pengembang bekerjasama untuk menyelesaikan <em>deliverables</em> yang akan diselesaikan dalam <em>deadline</em> yang telah ditentukan. Biasanya, <em>sprint</em> berlangsung selama 2 minggu. Akan tetapi, lama <em>sprint </em>sangatlah beragam, mulai dari seminggu hingga sebulan tergantung oleh proyek yang sedang dikerjakan. Selama <em>sprint</em>, <em>scope</em> dalam <em>sprint </em>masih dapat dinegosiasikan antara <em>product owner</em> dan tim pengembang jika terjadi perubahan yang tidak diduga.</p><h4><em>4. Daily scrum </em>atau <em>stand up</em></h4><p><em>Daily scrum </em>adalah rapat yang super singkat yang diikuti oleh seluruh tim. Biasanya, <em>daily scrum </em>atau <em>stand up </em>dilakukan pada setiap pagi hari dan hanya berdurasi 15 menit. Tujuan dari <em>daily scrum </em>adalah untuk agar semua tim dapat <em>keep in track </em>dan berprogress dalam menyelesaikan <em>sprint goal</em>, selain itu <em>daily scrum </em>juga mungkin membahas rencana atau <em>work plan </em>untuk 24 jam kedepan.</p><p>Beberapa pertanyaan yang biasanya diajukan pada <em>stand up </em>adalah:<br>- Apa yang Anda kerjakan kemarin?<br>- Apa yang akan Anda kerjakan hari ini?<br>- Adakah kendala atau kesulitan yang sedang Anda hadapi?</p><h4><em>5. Sprint review</em></h4><p>Ketika <em>sprint </em>berakhir, seluruh tim akan berkumpul untuk mengadakan <em>demo </em>atau menganalisis bersama <em>increment</em> yang telah diselesaikan. Setelah tahap pengecekkan selesai dilakukan, masing-masing anggota tim akan menunjukkan <em>backlog items</em> yang mereka kerjakan kepada tim pengembang dan juga <em>stakeholders.</em></p><h4><em>6. Sprint retrospective</em></h4><p><em>Retrospective</em> adalah saat dimana seluruh anggota tim berkumpul untuk mendiskusikan apa yang berhasil dilakukan dan apa yang gagal dalam <em>sprint</em> yang telah diselesaikan. Semua hal terkait <em>sprint</em>, mulai dari <em>deadline </em>pengerjaan, masing-masing anggota tim, <em>tools, </em>bahkan <em>events </em>tertentu dievaluasi oleh tim secara keseluruhan. Hasil dari evaluasi tersebut kemudian didokumentasikan sehingga tim dapat mendiskusikan apa yang sukses dikerjakan dan apa yang perlu diperbaiki untuk <em>sprint </em>selanjutnya.</p><h3><strong>Tiga peran penting pada Scrum</strong></h3><h4><strong><em>Scrum product owner</em></strong></h4><p><em>Product owner</em> adalah orang yang berfokus untuk memahami bisnis, pelanggan, kebutuhan pasar, dan memprioritaskan pekerjaan yang harus diselesaikan oleh tim pengembang sesuai tujuan awal. Seorang <em>product owner</em> tidak selalu memegang peran sebagai <em>product manager.</em></p><p>Jika dibandingkan dengan <em>product manager, product owner</em> lebih berfokus untuk memastikan tim pengembang berhasil membuat <em>deliverables</em> yang sangat menguntungkan bisnis. <em>Product owner</em> biasanya hanya seorang diri karena jika ada dua <em>product owner </em>atau lebih, perbedaan pendapat atau arahan dari kedua <em>product owner</em> tersebut dapat menunda <em>sprint</em> mencapai tujuan akhirnya.</p><p>Berikut adalah beberapa tanggung jawab dari seorang<em> product owner:</em></p><ul><li>Membuat dan mengatur <em>product backlog.</em></li><li>Bekerjasama dan menjalin hubungan yang erat dengan bisnis dan tim untuk memastikan bahwa semua anggota tim memahami dengan jelas setiap <em>work items </em>pada <em>product backlog.</em></li><li>Memberikan instruksi dan panduan yang jelas kepada tim terkait fitur yang akan diluncurkan.</li><li>Menentukan kapan produk akan diluncurkan sesuai dengan <em>planning</em> dan kesiapan tim.</li></ul><h4><strong><em>Scrum master</em></strong></h4><p><em>Scrum master </em>adalah ketua dari keseluruhan proyek <em>scrum</em>. Sebagai seorang <em>scrum master,</em> ia bertugas memberi pelatihan terkait proses pada <em>scrum </em>kepada tim pengembang, bisnis, dan bahkan <em>product owner</em>. <em>Scrum master </em>juga diberi tanggung jawab untuk memperbaiki proses pengerjaan <em>scrum </em>pada tim sehingga dapat dilakukan se-efisien mungkin.</p><p>Seorang <em>scrum master</em> harus mampu untuk memahami secara mendalam dan menyeluruh tugas yang sedang dikerjakan oleh tim. Tidak hanya itu, ia harus mampu untuk membantu tim mengoptimalisasikan pekerjaannya untuk memperlancar proses <em>delivery flow</em>. <em>Scrum master</em> juga bertugas untuk mengatur kebutuhan yang diperlukan oleh tim untuk <em>events</em> pada <em>scrum</em> yang terdiri dari <em>sprint planning, stand-up, sprint review, </em>dan <em>sprint retrospective.</em></p><p>Selain pengalaman, pengetahuan, dan sertifikasi yang mewadahi, skill komunikasi secara verbal dan tertulis sangat dibutuhkan untuk menjadi seorang <em>scrum master</em>. Hal ini dikarenakan <em>scrum master</em> memiliki peran krusial sebagai <em>main communicator</em> yang mewakili tim pengembang di hadapan <em>product owner, </em>dan <em>key stakeholders </em>lainnya.</p><p>Secara umum, <em>scrum master </em>memiliki beberapa tanggung jawab sebagai berikut:<br>- Memberi pelatihan kepada anggota tim.<br>- Memimpin <em>daily scrum </em>atau <em>stand-up meetings.<br>- </em>Membantu <em>product owner</em> dalam pembuatan <em>product backlog.<br>- </em>Mengajar dan menerapkan prinsip-prinsip <em>scrum </em>pada <em>sprint.<br>- </em>Membantu menanggulangi kesulitan yang terjadi selama <em>sprint.</em></p><h4><strong><em>Scrum development team</em></strong></h4><p><em>Scrum development team</em> biasanya hanya terdiri dari 5 sampai 7 anggota saja. Akan tetapi, jumlah anggota tim yang sedikit ini malah mempermudah komunikasi dan meningkatkan kinerja antar anggota tim. Walaupun sedikit, masing-masing anggota tim dalam <em>scrum</em> memiliki kemampuan yang beragam dan berbeda antara satu dengan yang lainnya. Dengan demikian, anggota tim dapat saling melatih anggota tim lainnya sehingga tidak ada anggota yang menjadi beban untuk tim tersebut.</p><p><em>Scrum development team </em>yang baik akan mampu untuk mengatur pekerjaannya sendiri karena mereka memiliki kerjasama yang baik dalam menyelesaikan proyek. Selain itu, masing-masing anggota tim seharusnya saling membantu untuk mencapai tujuan <em>sprint. </em>Tim <em>scrum </em>bekerjasama untuk membuat rancangan terhadap setiap <em>sprint. </em>Mereka memperkirakan berapa banyak tugas yang dapat mereka selesaikan dalam jangka waktu tertentu berdasarkan dari dokumentasi <em>sprint-sprint</em> sebelumnya.</p><p>Semakin banyak <em>sprint </em>yang dilakukan oleh tim, semakin banyak dokumentasi hasil evaluasi yang dimiliki oleh tim. Dengan demikian, tim dapat semakin memprediksi dan membuat perencanaan yang baik.</p><h3>Contoh Implementasi SCRUM</h3><p>Saat sedang menulis blog ini, penulis sedang mengerjakan Proyek Perangkat Lunak sebagai mata kuliahnya. Berikut adalah beberapa implementasi Scrum di dunia nyata.</p><h4>1. Mengorganisasikan <em>backlog</em></h4><p>Bersama dengan Scrum Master, tim mendaftarkan <em>task </em>dan isu yang kemungkinan akan dikerjakan pada <em>sprint </em>yang akan datang. Pada tahap ini juga ditentukan prioritas dari setiap <em>task </em>yang ada. <em>Tools </em>yang dipakai adalah <em>Gitlab Boards. </em>Alasan utama pemilihan <em>Gitlab Boards </em>selain <em>free to use </em>adalah terintegrasi langsung dengan <em>repository </em>Gitlab yang ada.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QeijsZ6wgf6JTxudDqmGug.png" /><figcaption>Gitlab Boards</figcaption></figure><h4>2. Sprint Planning</h4><p>Setelah daftar <em>task</em> sudah didapatkan beserta dengan prioritasnya, Scrum bersama dengan <em>developer </em>menentukan <em>story point </em>setiap <em>task</em>. Untuk menentukan <em>story point, </em>aplikasi yang digunakan adalah Scrum Poker yang dapat ditemukan pada <a href="https://www.scrumpoker-online.org/">tautan berikut</a>. Kemudian diakhiri dengan membagikan/<em>assign task </em>tersebut ke <em>developer </em>secara merata. Berakhirnya <em>sprint planning </em>menandai bahwa <em>sprint </em>telah dimulai.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ycMAQQ6yli89pVBfzJg_Q.png" /><figcaption>Scrum Poker</figcaption></figure><h4>3. Daily Standup</h4><p>Pada pengerjaan Proyek Perangkat Lunak penulis, <em>daily standup </em>dilakukan seminggu dua kali, setiap selasa dan jumat. Kegiatan tersebut dipimpin oleh <em>Scrum Master </em>dan setiap <em>developer </em>melaporkan progress, rencana, dan halangan yang dialaminya. Penulis menggunakan aplikasi <a href="http://meet.google.com/">google meet</a> untuk sarana komunikasi selama <em>daily standup</em>.</p><h4>4. User Acceptance Test (UAT)</h4><p>Terdapat satu kegiatan berbeda yang terdapat dalam proses Scrum penulis, yaitu <em>User Acceptance Test (UAT).</em> Tujuan utama adanya tahap ini adalah untuk memastikan progres yang berjalan masih sesuai dengan tujuan dari <em>sprint </em>sehingga tidak terdapat kesalahpahaman ketika <em>Sprint Review</em>. Pada UAT, dibuat sebuah dokumen yang berisi seluruh <em>task </em>pada sprint yang berjalan beserta deskripsi <em>test</em> dan <em>acceptance criteria-</em>nya.</p><h4>5. Sprint Review</h4><p>Pada <em>Sprint Review, </em>tim penulis akan mempresentasikan hasil pengerjaannya selama satu <em>sprint </em>kepada pihak dosen dan <em>client</em>. Pihak <em>client </em>akan memberikan penilaian dan hal apa saja yang dapat diperbaiki selanjutnya.</p><h4>6. Sprint Restropective</h4><p>Tahap akhir dari <em>sprint</em> ini adalah dengan melakukan evaluasi terhadap tim. Evaluasi tersebut meliputi hal baik, hal buruk, hal yang perlu dimulai, dan hal yang perlu dihentikan untuk <em>sprint </em>berikutnya. Untuk memudahkan kegiatan ini, tim penulis menggunakan aplikasi <a href="http://metroretro.io/">metroretro.io</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eDvAovlXxuPtOo28.jpg" /><figcaption>Metro Retro</figcaption></figure><h3>Analisis empiris Scrum pada penerapan projek</h3><p>Pada implementasinya, kinerja dari metode Scrum perlu diukur dan dianilisis agar pada sprint/waktu ke depannya menjadi lebih baik dan lebih efisien, terdapat beberapa bentuk analisis empiris untuk Scrum, di antaranya:</p><h4>Burndown/Burnup Chart</h4><p>Burndown chart menggambarkan banyaknya task/issues yang ada dari waktu ke waktu, sedangkan burnup menunjukkan task/issues yang sudah diselesaikan dalam waktu ke waktu, scope kedua chart ini biasanya adalah satu sprint.</p><p>Dengan mengetahui chart ini, dapat diketahui apakah task dikerjakan secara merata dalam waktu yang diberikan ataukan cenderung terjadi blocking sehingga baru dapat dikerjakan di akhir sprint.</p><p>Berikut adalah contoh pada projek yang penulis kerjakan menggunakan Gitlab,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWFu3pYBewlOW4dr_pE4AQ.png" /><figcaption>Burndown/Burnup Chart</figcaption></figure><h4>Scrum Velocity</h4><p>Velocity adalah pengukuran seberapa banyak beban/weight atau biasa disebut sebagai story point yang dapat diselesaikan oleh sebuah team dalam satu sprint. Biasanya nilai velocity diambil dari rata-rata story point yang berhasil diselesaikan dalam beberapa sprint terakhir.</p><p>Dengan mengetahui Scrum velocity, team dapat mengestimasi jumlah task yang dapat dikerjakan dan estimasi waktu secara lebih tepat.</p><p>Contoh pada projek penulis, berikut adalah banyak issues dan weight yang tertera pada gitlab untuk 3 sprint terakhir:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*ejmXWVqQ07aOnVzMFQHcWw.png" /><figcaption>Sprint 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*fT61SEyFUCwEd1KjnMId5g.png" /><figcaption>Sprint 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*93tHfmOsIdxlxXXDdG77Gw.png" /><figcaption>Sprint 3</figcaption></figure><p>Dapat disimpulkan bahwa kemampuan tim penulis dalam satu sprint adalah untuk menyelesaikan 6 issues dengan total weight 20.</p><h4>Scrum Maturity</h4><p>Scrum maturity mengukur leveldari tim Scrum, lebih lengkapnya sesuai dengan gambar berikut,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YiP9u6hwy4kLNFdf.png" /><figcaption>source: <a href="https://jaseyb.files.wordpress.com/2016/05/screenshot-2016-05-08-09-08-22.png">https://jaseyb.files.wordpress.com/2016/05/screenshot-2016-05-08-09-08-22.png</a></figcaption></figure><p>Semakin mature sebuah tim semakin baik pula hasil yang didapat pada setiap Sprint. Tim yang belum mature biasanya masih terorganisasi dengan buruk dan tidak terkontrol. Sebaliknya, tim yang sudah mature sudah dapat mengerjakan task dengan baik serta melakukan pengembangan lebih lanjut.</p><p>Pada pengaplikasian Scrum penulis, pada mulanya tim berada pada tingkatan low maturity, tetapi seiring bertambahnya waktu dan adanya Sprint Review serta Retrospective tim menjadi lebih mature dan bekerja dengan lebih baik dan efisien.</p><h3>Referensi</h3><ul><li><a href="https://www.synopsys.com/blogs/software-security/top-4-software-development-methodologies/">https://www.synopsys.com/blogs/software-security/top-4-software-development-methodologies</a></li><li><a href="https://www.scrum.org/resources/what-is-scrum">https://www.scrum.org</a></li><li><a href="https://www.atlassian.com/agile/scrum">https://www.atlassian.com/agile/scrum</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c0ffd81c740" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Persona —Apa pentingnya?]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/persona-apa-pentingnya-a4ba026cab66?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ba026cab66</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 15:24:48 GMT</pubDate>
            <atom:updated>2022-03-20T16:17:53.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*HogU1Qnm47j8XtRr" /><figcaption>sumber: <a href="https://unsplash.com/photos/sibVwORYqs0">https://unsplash.com/photos/sibVwORYqs0</a></figcaption></figure><p>Dalam membuat sebuah aplikasi, tidak jarang <em>developer </em>hanya berfokus pada bagaimana cara membuat sebuah aplikasi. Padahal perlu diingat bahwa aplikasi dibuat untuk mengatasi permasalahan orang-orang “tertentu”.</p><p>Jika diibaratkan, sebuah pengrajin kursi mungkin dapat membuat kursi yang secara estetis indah, menggunakan bahan yang terbaik, tetapi ternyata tidak nyaman dipakai oleh orang yang memesannya. Misalnya sebuah kursi yang dijual untuk pemain basket nasional Amerika dengan postur yang tinggi, tetapi spesifikasi yang dibuat menyesuaikan ukuran tubuh orang Indonesia.</p><p>Untuk itulah dibutuhkan riset terlebih dahulu, siapakah calon pengguna dari aplikasi yang akan dibuat, bagaimana karakteristik pengguna tersebut, apa saja hal yang disukai dan tidak disukainya.</p><h3>Bagaimana persona ditemukan?</h3><p>Pertama kali dikenalkan pada tahun 1998 oleh Alan Cooper, saat itu dia sedang mengembangkan sebuah <em>software, </em>dia mewawancarai beberapa koleganya yang kemungkinan menjadi pengguna <em>software </em>yang sedang dia buat mengenai ide-ide yang bisa dia implementasikan ke dalam <em>software</em>-nya.</p><blockquote>You tend to canvas the user community, collect their requests for functions, and then provide them a product containing all of those functions. I call this the sum of all desired features. — Alan Cooper</blockquote><p>Tanpa dia sadari, Cooper memposisikan dirinya sebagai <em>product manager</em>. Dia mendapatkan inspirasi dari salah satu kolega yang dia wawancarai. Aktivitas yang dilakukannya ternyata sangat efektif untuk menjawab pertanyaan-pertanyaan desain seputar fungsionalitas dan interaksi. Cooper merasa terbantu untuk memahami apa saja yang diperlukan dan tidak diperlukan dalam <em>software </em>yang dikembangkannya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*xXJRiRP76c1hUxGd" /></figure><h3>Apa <em>sih</em> Persona itu?</h3><p>Persona adalah narasi dan cerita tentang karakter imajinasi/buatan, <em>yaps </em>bukan “orang asli”. Meskipun demikian, karakter tersebut dapat mewakili perilaku dan karakteristik dari kelompok orang-orang yang lebih luas.</p><p>Persona menjadi dokumen yang dipersiapkan sebelum pengembangan aplikasi dimulai. Keputusan desain baik <em>User Interface </em>dan <em>User Experience </em>akan sangat dipengaruhi oleh persona yang dibuat.</p><h3>Seberapa pentingnya Persona?</h3><p>Persona dapat menjawab salah satu pertanyaan terpenting dalam pembuatan sebuah produk, “Untuk siapa produk ini kita desain?”. Persona membantu tim desain dalam memahami ekspektasi, motivasi, dan pertimbangan dari pengguna yang menjadi target produk. Sebagai hasilnya, pengguna akan merasa lebih puas dan kebutuhannya terpenuhi.</p><p>Manfaat lainnya dengan adanya persona adalah:</p><h4>Membangun empati</h4><p>Persona membantu desainer dalam memahami dan berempati dengan pengguna aplikasi. Desainer dapat memposisikan dirinya sebagai pengguna dan memahami pengguna yang berbeda dapat memiliki perspektif yang berbeda pula.</p><p>Contohnya adalah dalam menentukan pemilihan tema dan warna, desainer tidak hanya memikirkan preferensinya sendiri. Aplikasi untuk anak-anak tentu akan memiliki tema yang berbeda dengan aplikasi yang target penggunanya adalah pebisnis.</p><h4>Memberikan arah dalam menentukan keputusan desain</h4><p>Bagaikan jalan yang bercabang, desainer juga dapat menjumpai kondisi di mana dia dihadapkan dengan beberapa pilihan/keputusan desain. Adanya persona, dapat membantu desainer untuk memilih keputusan yang paling sesuai dengan kebutuhan pengguna. Persona juga dapat membantu desainer dalam menentukan prioritas fitur-fitur yang akan dibuatnya, berdasarkan seberapa dibutuhkannya fitur tersebut oleh pengguna.</p><p>Misalnya dalam menentukan ukuran tombol, ada pendapat bahwa ukurannya terlalu kecil. Keputusan mengenai pendapat tersebut dapat menjadi lebih valid jika terdapat persona yang memang sesuai dengan pendapatnya. Contohnya, persona “Gani” sering berada dalam transportasi umum dan akan sulit apabila tombol yang ada kurang mudah untuk dijangkau.</p><h4>Sebagai jembatan komunikasi dan pemahaman</h4><p>Dalam sebuah tim produk, terdapat banyak pihak yang memiliki tujuan dan keahliannya masing-masing. Persona menjadi acuan yang dapat menghubungkan kepentingan antar pihak yang terlibat dalam tim.</p><h3>Mari kita lihat contohnya</h3><p>Desain dan <em>template </em>dari persona dibuat sesuai dengan kebutuhan masing-masing aplikasi. Sebagai contoh aplikasi perbankan mungkin memerlukan info perilaku finansial dan pengeluaran bulanan. Namun demikian, terdapat beberapa bagian penting yang sebaiknya ada dalam setiap Persona.</p><p>Kita akan mencoba untuk membedah komponen dari Persona dengan contoh studi kasus aplikasi jual beli aset <em>cryptocurrency,</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wo0IdCoXr27ub3nVFogt9A.png" /><figcaption>Contoh Persona 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qgbQkdFKqgMZ35IvIzQYyQ.png" /><figcaption>Contoh Persona 2</figcaption></figure><h4>Foto</h4><p>Foto dalam sebuah persona penting karena dapat memberikan gambaran atas persona secara sekilas. Seorang anak-anak dan orang dewasa dapat dibedakan dengan cepat melalui fotonya. Demikian juga seorang dokter dan atlet olahraga.</p><h4>Nama dan biodata</h4><p>Sebelum mengenal lebih dalam sebuah persona, perlu diketahui biodata yang menggambarkan persona tersebut secara umum. Hal ini membantu desainer dalam memahami ekspektasi awal dari persona dan sebagai dasar dalam pemahaman perilaku dari persona lebih jauh.</p><h4>Tujuan</h4><p>Penting untuk mengetahui tujuan yang ingin dicapai pengguna dari aplikasi. Dengan diketahuinya tujuan, penentuan fitur-fitur yang akan dibuat menjadi lebih jelas sehingga tidak ada fitur yang terbuat “sia sia”.</p><h4>Kebutuhan dan Ekspektasi</h4><p>Desainer dapat memprioritaskan fitur mana yang memang “perlu” dan fitur yang hanya “pelengkap” dengan adanya komponen Persona ini.</p><h4><em>Pain points </em>dan <em>frustations</em></h4><p>Selain mencoba untuk membuat desain yang sesuai kebutuhan, desainer juga perlu menghindari desain yang menjadi permasalahan/menyulitkan pengguna. Contohnya adalah alur yang terlalu kompleks atau waktu <em>loading </em>yang lama.</p><h3>Kesimpulan</h3><p>Persona merupakan alat yang sangat <em>powerful. </em>Persona yang dibuat dengan baik dapat membuat proses desain menjadi lebih mudah, efektif, dan sesuai dengan kebutuhan pengguna. Desainer akan sangat terbantu dalam menentukan keputusan-keputusan desain. Selain itu, Persona juga bisa manjadi pemersatu ide dan tujuan pihak-pihak yang terlibat dalam pengembangan produk.</p><h3>Referensi</h3><ul><li><a href="https://xd.adobe.com/ideas/process/user-research/putting-personas-to-work-in-ux-design/#:~:text=Personas%20help%20designers%20to%20create,have%20different%20needs%20and%20expectations">https://xd.adobe.com/ideas/process/user-research/putting-personas-to-work-in-ux-design/</a></li><li><a href="https://www.keepitusable.com/blog/personas-why-is-it-important-to-understand-your-users/">https://www.keepitusable.com/blog/personas-why-is-it-important-to-understand-your-users/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ba026cab66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dockerize React Native Expo App]]></title>
            <link>https://medium.com/@ganiilhamirsyadi/dockerize-react-native-expo-app-152c1e65e76c?source=rss-e9f674a560ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/152c1e65e76c</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[expo]]></category>
            <dc:creator><![CDATA[Ganiilhamirsyadi]]></dc:creator>
            <pubDate>Sat, 19 Mar 2022 10:49:28 GMT</pubDate>
            <atom:updated>2022-03-20T11:08:33.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*eV5TPu_MjF21fk4p.png" /><figcaption>Expo React Native + Docker</figcaption></figure><p><a href="https://expo.dev/">Expo</a> is a framework and a platform for universal React applications. It is a set of tools and services built around React Native and native platforms that help to develop, build, deploy, and quickly iterate on iOS, Android, and web apps from the same JavaScript/TypeScript codebase.</p><p>The Expo has Expo CLI that can be installed on your local machine. However, using Docker container, you can create a stand-alone development environment. That way you can make sure the development environment can be consistent across different machines.</p><p>In this post I will show you how to create a docker container that will allow you to develop React Native applications.</p><h3>Prerequisites</h3><p>Before we dive in, you should install <strong>Docker Desktop</strong>, <strong>docker compose</strong>, and <strong>Node.js</strong> on your machine.</p><p>After installing Node.js, install the expo-cli package globally using this command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5956631ab96a97e69b041aba31d10cf9/href">https://medium.com/media/5956631ab96a97e69b041aba31d10cf9/href</a></iframe><h3>Initializing Expo Project</h3><p>Initialize the expo project using this command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ae36bb8a3de95dc7652394fe06d7cd9/href">https://medium.com/media/0ae36bb8a3de95dc7652394fe06d7cd9/href</a></iframe><p>This command will create a new folder named react_native_app with expo project inside and install all required dependencies using npm (because of the —-npm flag).</p><h3>Creating Dockerfile</h3><p>A <strong>Dockerfile</strong> is a text document that contains all the commands that will be called on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.</p><p>Let’s create the Dockerfile for our expo project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/16fa4def58211323629e3cbb33065470/href">https://medium.com/media/16fa4def58211323629e3cbb33065470/href</a></iframe><h3>Running Docker</h3><p>Let’s build the docker container using this command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3612dfcde0d96286eb2d2c6343f128bd/href">https://medium.com/media/3612dfcde0d96286eb2d2c6343f128bd/href</a></iframe><p>*to see the build log you can add --no-cache --progress=plain tags.</p><p>Run the docker container:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d95cb6b80c14bb9eeeac8fb8260f2c3/href">https://medium.com/media/7d95cb6b80c14bb9eeeac8fb8260f2c3/href</a></iframe><p>Let’s break the command down:</p><ul><li>docker run : starts the docker container</li><li>-it : starts with interactive mode so we can kill it using CTRL+C</li><li>--rm : remove the container after it stopped</li><li>--name : the name of the container</li><li>-p portA:portB : bind the docker container’s portB to our localhost portA</li><li>-v pathA:pathB : mounts the project folder (pathA) to docker container’s working directory (pathB), the delegated and notused keywords</li></ul><h3>Creating Docker Compose</h3><p>It will be a nightmare to type command above every time you want to run the docker container. Alternatively, you can create docker-compose.yml equivalent for it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39ea298769b17b4013a939836366d052/href">https://medium.com/media/39ea298769b17b4013a939836366d052/href</a></iframe><p>Using docker-compose commands:</p><ul><li>docker-compose build : build the container</li><li>docker-compose up : run the container, add -d flag to run it on background</li></ul><h3>Launch The App!</h3><p>Check on localhost:19006 , you should see your expo react native web app running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnEXEimX6RgUAM0R3NhsrQ.png" /></figure><p>You can find the source code of the project here: <a href="https://github.com/ganiirsyadi/expo-docker-example">https://github.com/ganiirsyadi/expo-docker-example</a></p><h4>References:</h4><ul><li><a href="https://docs.docker.com/engine/reference/builder/">https://docs.docker.com/engine/reference/builder/</a></li><li><a href="https://www.rockyourcode.com/how-to-run-react-native-expo-web-in-a-docker-container/">https://www.rockyourcode.com/how-to-run-react-native-expo-web-in-a-docker-container/</a></li><li><a href="https://haseebmajid.dev/blog/running-react-native-in-docker">https://haseebmajid.dev/blog/running-react-native-in-docker</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=152c1e65e76c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>