<?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 Kshish on Medium]]></title>
        <description><![CDATA[Stories by Kshish on Medium]]></description>
        <link>https://medium.com/@Kshish_Ashish?source=rss-b4a0c1999138------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8Qx09HUgcez_CVGD-aes5Q.jpeg</url>
            <title>Stories by Kshish on Medium</title>
            <link>https://medium.com/@Kshish_Ashish?source=rss-b4a0c1999138------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:49:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Kshish_Ashish/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[JUnit Testing in Angular: A Comprehensive Guide]]></title>
            <link>https://medium.com/@Kshish_Ashish/mastering-junit-testing-in-angular-a-comprehensive-guide-a35b65ea3085?source=rss-b4a0c1999138------2</link>
            <guid isPermaLink="false">https://medium.com/p/a35b65ea3085</guid>
            <category><![CDATA[junit]]></category>
            <category><![CDATA[karma]]></category>
            <category><![CDATA[jasmine]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[Kshish]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 05:19:45 GMT</pubDate>
            <atom:updated>2024-03-21T06:08:18.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Unit testing is an essential aspect of modern software development, ensuring that individual units of code function as expected. In the realm of Angular development, unit testing plays a crucial role in maintaining code quality, preventing regressions, and facilitating a smooth development process. In this guide, we’ll delve into the fundamentals of unit testing in Angular, exploring best practices and leveraging insights gained from our experience with MRTM GUI, a product developed by Comviva.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*hecKCehkdnvEiZXuKYoDZA.png" /></figure><p><strong>Understanding JUnit Testing in Angular:</strong></p><p>Angular, a widely-used framework for building web applications, provides robust support for unit testing through tools like Jasmine and Karma. Jasmine, a behavior-driven development framework, serves as the primary testing framework for Angular applications. It offers a clean and expressive syntax for defining test cases and assertions, making it easier for developers to write and maintain tests.</p><p>Karma, on the other hand, is a test runner that executes Jasmine tests in various browsers, providing valuable feedback on the test results. Together, Jasmine and Karma form a powerful duo for unit testing Angular applications.</p><p><strong>Anecdote: Learning Through Experience</strong></p><p>During a recent project, I encountered an issue with JUnit testing in an Angular application. One of the test cases was failing due to a `TypeError`, which stemmed from improper initialization of dependencies. Upon further investigation, I learned the importance of correctly injecting dependencies in Angular services to prevent such errors. This experience highlighted the significance of understanding Angular’s dependency injection system and its implications on testing.</p><p><strong>Best Practices for JUnit Testing in Angular:</strong></p><p>1. <strong>Isolation and Mocking:</strong> When writing unit tests for Angular components and services, it’s crucial to isolate the unit under test and mock its dependencies. This ensures that tests remain focused and independent of external factors, leading to more reliable and maintainable test suites.</p><p>2. <strong>Arrange-Act-Assert Pattern:</strong> Following the Arrange-Act-Assert (AAA) pattern helps structure test cases in a clear and organized manner. The Arrange step involves setting up the test environment, the Act step performs the actual operation being tested, and the Assert step verifies the expected outcome.</p><p><strong>Anecdote: Implementing the AAA Pattern</strong></p><p>In a recent code review, I encountered a test case that lacked proper structure and organization. By refactoring the test case to adhere to the AAA pattern, I was able to improve its readability and maintainability significantly. This experience reinforced the importance of adopting established testing patterns for writing effective unit tests.</p><p><strong>Practical Examples:</strong></p><p>Let’s consider a simple example of testing an Angular service using JUnit. Suppose we have a `CalculatorService` responsible for performing basic arithmetic operations.</p><blockquote>typescript<br>import { CalculatorService } from ‘./calculator.service’;</blockquote><blockquote>describe(‘CalculatorService’, () =&gt; {<br> let service: CalculatorService;</blockquote><blockquote>beforeEach(() =&gt; {<br> service = new CalculatorService();<br> });</blockquote><blockquote>it(‘should add two numbers’, () =&gt; {<br> const result = service.add(3, 5);<br> expect(result).toEqual(8);<br> });</blockquote><blockquote>it(‘should subtract two numbers’, () =&gt; {<br> const result = service.subtract(10, 4);<br> expect(result).toEqual(6);<br> });<br>});<br>```</blockquote><p>In this example, we create test cases to verify the `add` and `subtract` methods of the `CalculatorService`. We instantiate the service in the `beforeEach` block to ensure a fresh instance for each test case.</p><p>Let’s see how we used this learning to write tests for ListService in our MRTM UI application:</p><ol><li>To effectively test the ListService, we delved into the TestBed module provided by Angular. Additionally, we employed the spyOn method to mock dependencies such as DataService and DefaultLayoutService, enabling us to isolate the behavior of the ListService and focus solely on its functionality.</li></ol><blockquote>import { TestBed } from ‘<a href="http://twitter.com/angular/core">@angular/core</a>/testing’;<br>import { ListService } from ‘./list.service’;<br>import { DataService } from ‘./data.service’;<br>import { DefaultLayoutService } from ‘./default-layout.service’;<br>import { of } from ‘rxjs’;</blockquote><blockquote>describe(‘ListService’, () =&gt; {<br> let service: ListService;<br> let dataServiceSpy: jasmine.SpyObj&lt;DataService&gt;;<br> let layoutServiceSpy: jasmine.SpyObj&lt;DefaultLayoutService&gt;;</blockquote><blockquote>beforeEach(() =&gt; {<br> dataServiceSpy = jasmine.createSpyObj(‘DataService’, [‘fetchData’]);<br> layoutServiceSpy = jasmine.createSpyObj(‘DefaultLayoutService’, [‘getLayoutData’]);</blockquote><blockquote>TestBed.configureTestingModule({<br> providers: [<br> ListService,<br> { provide: DataService, useValue: dataServiceSpy },<br> { provide: DefaultLayoutService, useValue: layoutServiceSpy }<br> ]<br> });<br> service = TestBed.inject(ListService);<br> });</blockquote><blockquote>it(‘should be created’, () =&gt; {<br> expect(service).toBeTruthy();<br> });<br>});</blockquote><p>2. We wrote tests to validate the creation of the ListService instance, ensuring that it initialized correctly and was ready to handle data operations.</p><blockquote>it(‘should fetch data from DataService’, () =&gt; {<br> const testData = [{ id: 1, name: ‘Item 1’ }, { id: 2, name: ‘Item 2’ }];<br> dataServiceSpy.fetchData.and.returnValue(of(testData));</blockquote><blockquote>service.fetchData();</blockquote><blockquote>expect(service.data).toEqual(testData);<br>});</blockquote><p><strong>Conclusion:</strong></p><p>JUnit testing in Angular offers developers a powerful framework for validating the behavior and functionality of their applications. By embracing best practices, leveraging practical examples, and learning from real-world experiences, developers can master the art of writing effective unit tests. With a solid foundation in JUnit testing, Angular developers can enhance the quality, reliability, and maintainability of their codebases, ultimately delivering superior user experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a35b65ea3085" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leaderline application and Scroll Management in Angular]]></title>
            <link>https://medium.com/@Kshish_Ashish/leaderline-application-and-scroll-management-in-angular-f82a3e48fe8?source=rss-b4a0c1999138------2</link>
            <guid isPermaLink="false">https://medium.com/p/f82a3e48fe8</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Kshish]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 08:18:19 GMT</pubDate>
            <atom:updated>2023-03-31T04:17:36.761Z</atom:updated>
            <content:encoded><![CDATA[<p>Many times in an interactive environment we require visual cues connecting related data points, one way to do so in Angular is via npm package called leader-line. It allows you to create a connection between two elements on the user interface, and opens up a wide world of possibilities for animations and functionalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*eQSKTtnx-JDAhz9DKV44Iw.jpeg" /></figure><p>$ npm install leader-line</p><p>To connect two elements using a line, we install the leader-line package, which requires the reference HTML elements to be passed as argument to the LeaderLine constructor. First argument refers to the element from which our leaderline emerges, and the second argumentis the destination element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3EGu3Mos5WowbPI2Ag21AA.jpeg" /></figure><p>To customize the output of the line, for example</p><blockquote>● the color of line</blockquote><blockquote>● the style of the line</blockquote><blockquote>● where exactly it starts and ends in relation to the respective HTML elements</blockquote><blockquote>● path labels</blockquote><p>These are all the options that you can pass to the constructor. We have the setOptions method that needs an object to be passed as argument to set the color, style, etc for the line. <a href="https://github.com/anseki/leader-line#options">Check out the documentation here</a></p><p>In my experience, I have used it to map elements in one dynamic list to another.</p><p>Commonly faced issues with leaderline are handling scrolls, especially when data changes in real time on your product UI. Two major issues I faced in scrolling components with leader line:</p><blockquote>● Leaderlines may still be visible outside your component</blockquote><blockquote>● Leaderlines may not respond to scroll and stay in the same place while your element moves away.</blockquote><p>After spending many days trying to implement existing solutions like <a href="https://jsfiddle.net/op2gnk0t/">iframes</a> or <a href="https://github.com/anseki/leader-line/issues/13">z-indexes</a>, for our particular application we had be a little creative. Hope this helps you.</p><p>We have applied an intersection observer on the container component. So every time leader line crosses the intersection, its hidden and if its already hidden and the intersection is observed, then it reappears.</p><p>For our product, we have a set of sources and destination elements and their ids are dynamically generated. For yours you could have a static list of singular items, all you need is a loop to traverse the elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*ljB6xRzNhfCOl27axMKC_A.jpeg" /></figure><p>Generation of leader lines, Every leaderline you create, you push it to an array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*SqV0tRArrazij5hVXMfMzQ.jpeg" /></figure><p>Now you need to specify the box where you are trying to containerize the data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*09B2OFlfGEu93aTuaAWJtA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*qytNY65QzxL4vb2fVsUSKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*NlYUJO74DPhma1jWPdxjdw.png" /></figure><p>Rest is taken care of by our utility class LeaderLineUtils function ‘handlingScrollEvent’</p><p>In this particular function, we need the container (SrcScrollerBox), whether the line is currently visible(set to false), the leader line, and the element being scrolled (can be either source or target).</p><blockquote>declare const LeaderLine: any;</blockquote><blockquote>declare const AnimEvent: any;</blockquote><blockquote>private observer: IntersectionObserver;</blockquote><blockquote>private lineObserver: IntersectionObserver;</blockquote><p>Step 1: Add an Event Listener for ‘scroll’, and for every scroll reposition the leaderline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*NG3eEdxUlE12dE1zkTwcGg.png" /></figure><p>Step 2: Add an intesection Observer, to check if the leaderline is entering or exiting the sourcebox.As soon as intersection happens, either show or hide the leaderline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*YYj0Vi_lh1rEnyKwU5pkIw.png" /></figure><p>Though the development takes time, and the set up is much more elaborate and suited for larger projects, it is a robust modular solution for single container scroll management of leaderlines. It would also work if containers of source and target are different and scrollable, with few modifications, however we have yet to implement the same.</p><p>Thank you for taking out the time to read my article, feel free to share your feedback</p><p><em>Sources </em><a href="https://angular.io/"><em>https://angular.io/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f82a3e48fe8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qlik Sense: Modern Day Analytics]]></title>
            <link>https://medium.com/@Kshish_Ashish/qlik-sense-modern-day-analytics-3a021d10e999?source=rss-b4a0c1999138------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a021d10e999</guid>
            <category><![CDATA[qlik-sense]]></category>
            <category><![CDATA[qlik]]></category>
            <category><![CDATA[technical-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Kshish]]></dc:creator>
            <pubDate>Tue, 08 Feb 2022 07:27:39 GMT</pubDate>
            <atom:updated>2022-02-08T07:27:39.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>Qlik Sense Enterprise</h3><p>Qlik Sense can be installed and managed on a dedicated server. It is a powerful analytic tool that can be leveraged to create multiple reports and dashboards. These visualizations provide different levels of aggregation. Specifically service based businesses utilize this tool to get key insights of plans and products their customers are availing, how the usage of products climb or decline with effect of local market conditions.</p><p>While it is generally confused with QlikView which is their first generation analytics platform. Qlik Sense offers modern analytic solutions.</p><h3>Automated task scheduling and Reporting</h3><h3>Data Connections</h3><p>The variety of options for data connections including but not limited to ODBC, OLEDB, Postgres, different types of files and folders to extract or store the data on the dedicated server where Qlik sense is installed. We can access apps, databases, cloud services, and use the same to create comprehensive visualizations and reports.</p><p>The cloud services can be further extended to analyze how a product is performing on social media.</p><h3>Importance of separating daily data injection and visualization</h3><p>Creating Execute, Transform and Load scripts</p><ul><li>We have the Task Scheduler available in Qlik Management Console, it can be used to monitor the follow of data in the reports regularly. Depending on deployment, Qlik Sense scheduler can work as a node or manager.</li><li>The status can be retrieved for individual jobs, i.e. Running, Aborted, etc. and once a task is success or failure, we can also download relevant logs.</li></ul><h3>Application &amp; Sheets</h3><p>Individual pages of an application dedicated to analyze different parameters of a particular dataset. It’s an object at application level. An application can have multiple sheets each focusing on a specific KPI.</p><p>The data load editor can be used to create reports of basic as well as advanced data analytics</p><p>depending on your expertise and business requirements.</p><h3>Visualizations</h3><p>There are endless possibilities, it might take you some time to find out what works best for your requirement but the frameworks are elegant and versatile. In my experience I have worked with several combinations, including but not limited to Bar graphs, tables, pivot tables, KPIs, line charts and Custom objects as a combination of multiple visuals. I look forward to exploring many others.</p><h3>Dimensions and Measures</h3><ul><li>In any data connection, we may have multiple sources of data, mapping the fields of those data sets in the qlik sense is referred to as dimensions.</li><li>Accumulating those dimensions or performing operations on them for the purpose of analytics in the qlik sense is referred to as measures.</li></ul><h3>Security and Management</h3><h3>Nodes</h3><p>Multiple Node set ups to accommodate load balancing and maintenance. As a company grows, so do their customer base, data and analytics requirements. We can set up clusters of one or more servers/nodes and connect them to a common repository or a central node.</p><p>Qlik Management Console provides the ability to monitor node failure and management of tasks by alternative nodes in case of such failure.</p><h3>Authorization</h3><p>The security and management of rights</p><ul><li>Streams and workspace</li><li>Access allocations via License Management and Rules</li><li>Who can view the stream or report</li><li>Who can edit the stream or report</li><li>Who can view the Qlik Console</li><li>Who can manage the authorization and licenses</li></ul><p>Customized rules can be set up for almost any functionality in Qlik Sense.</p><h3>License Management</h3><p>There are two license models: the serial and control number and the signed license key. These models define the terms of your license and the access types that you can allocate to users.</p><p>With a signed license key, you need internet access (direct or through a proxy) to access the cloud-based license backend, for user assignments, analytic time consumption, and product activations.</p><h3>Why choose Qlik Sense over other Market competitors?</h3><h3>Qlik Sense Alternatives</h3><ul><li><em>Tableau</em></li><li><strong>Tableau </strong>has faster, responsive, and visually aesthetic dashboarding capabilities compared to Qlik Sense, but the Qlik Sense has an easy to use interface.</li><li>With Qlik, we can use multiple data sources with enormous data sets and transform them into sophisticated workflows.</li><li><strong>Tableau </strong>functions best when we use multiple ETL and jobs in the backend to transform the data set and then feed the application transformed/clean data. This complicates management of large data sets and processing/adding maintenance to the backend. Once we accomplish that, we simply drag and drop the interface to Tableau.</li><li>Tableau has come up with Tableau Prep (a tool to clean the data), but Qlik Sense is ahead of it at the moment.</li><li><em>Power BI</em></li><li>Power Bi can be termed as majorly a higher level business tool whereas qlik sense is also a self service tool to design reports and dashboards.</li><li>Qlik sense is very user friendly whereas for power bi the user/non developers also must have hands on knowledge.</li></ul><p>Personally going through setup and the resources for learning and development, I felt that Qlik might need more work at developers end but it is a great budget solution because it does the same job at 1/10th business expense than other tools.</p><p>Sources:</p><p><a href="https://www.qlik.com/">https://www.qlik.com/</a></p><p><a href="https://www.trustradius.com/">https://www.trustradius.com/</a></p><p><a href="https://help.qlik.com/">https://help.qlik.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a021d10e999" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>