Identifying and avoiding Tautological tests in Ruby on Rails applications

Writing unit tests is more of an art than a skill, and understanding what to test for comes with experience and/or mistakes. We look for the percentage of test coverage for examining the health of an application. However, the "coverage percentage" might be misused or overlooked. In particular, it falls victim to Goodhart’s law, which says: “When a measure becomes a target, it ceases to be a good measure”. Whenever we start writing test cases for the sake of improving the code coverage, we miss the whole point of testing and rather introduce Tautological Tests - poorly designed

What inspires me at work? A candid chat with Karan Valecha.

Karan Valecha believes that the secret of great work, is the love you have for your work. In this chat, Karan shares about his experiences, learning and culture at Kiprosh.

Ruby's Global Scope is Not Really Global

Ruby does not have any entry point to the code it is executing. Compare that to other languages like C, C++, Java, etc., which has a main() method in some way. And this main() is the entry point to the code. But in Ruby, we can open a file with a .rb extension and write our code at the top-level like: foo = 'Great Scott!' puts foo # => Great Scott!... and Ruby will execute the file for us. You'll get introduced to this top-level scope as global scope throughout most tutorials. Even though the intention is correct, the terminology as

Creating API using Netlify functions

Netlify offers free static website hosting with features like continuous deployment services, user-authentication, and form-handling. But static sites have limitations to perform server-side operations. These limitations have been addressed by Netlify by providing features to create Serverless Functions. In this blog, we'll create a simple application that displays a positive quote when we click the button. The quote displayed is returned from the API we'll create using netlify lambda function and deploy it. So let's get started. What is Serverless Computing? Serverless computing (or commonly referred to as serverless) is an execution model where cloud providers execute the piece of

Introduction to React Fiber

React was released with an update to React's core (Reconciler) algorithm. This new algorithm is called Fiber. Before diving deep into what is Fiber and how it works, it is must to know the React's reconciler algorithm as Fiber is nothing but the re-implementation of this previous algorithm. You can refer to the reconciler algorithm on React Official doc here. React ReconciliationIt's an algorithm that React uses to diff one tree with another to find which parts need to be updated in the next update. E.g. whenever the component's props or state gets updated, whether to make an actual

Sign API request using Postman pre-request scripts

When we are about to test a dynamic API request via Postman and realize that we need to pass a freshly generated signature in the headers, what do we generally do? For each request, we generate the signature using server-side code and copy-paste it in the headers. Sounds like a tedious job, doesn’t it? We faced a similar situation in our application where we had to pass a signature in the headers while testing an API. The signature was generated by encoding all the request parameters using the user's secret key. If any of the request parameters changed, we

What keeps me motivated at work? A quick chat with Mamta Kukreja

Mamta Kukreja, a vibrant Kiprosher and a food lover at heart shares insights, regarding her work and career choices. Q: You have worked earlier as a freelancer and remotely, before joining Kiprosh. How do you feel about switching to a full-time job? Mamta: The opportunities to grow are very slim when you are working as a freelancer, as you do not have a team or mentor to guide you. In the case of a full-time job, an individual is a part of a team or project, where the mentoring relationship with the team leads, help the more experienced coder/associate

How to Rock a Remote Team Retrospective

A decade back, remote retrospective used to happen via conference calls. But now trends are changing. Companies are becoming more and more remote-friendly. Also, because of technology, now the world is very well connected. When we work with remote teams, we feel it might be challenging to conduct a retrospective effectively. However, in today's time, it is much more comfortable because we have better video conferencing services and online tools such as the sticky-note like comments for the retrospective. Some companies work full-time remote and some provide partial remote, like our company Kiprosh. Hence, there is a good probability of

Understanding react-native-reanimated: A hands-on approach - Part 2

In Part 1 we learned some fundamentals of react-native-reanimated, its declarative syntax and its working under the hood by creating a simple Accordion. If you missed the first part, it will be better if you visit it and come back here as lots of concepts covered there will be referred here in this article. In this blog, we'll understand how to perform translation transformation by creating a shiny effect on the progress bar using react-native-reanimated. So, let's get started. Pre-requisites: Basic knowledge of react-native Basic knowledge of react-native-reanimated from the previous article Initialize project: Let's create our project by running:

Handling Timezone in MySQL queries in a Rails application

Handling timezones in Rails applicationsIn the Rails application, we may have two different timezones. Application timezoneDatabase timezoneIn most of the cases database timezone is set to UTC, but application timezone could be different from database timezone. How to set application timezone?Set timezone at the application levelWe can set  config.time_zone configuration in config/application.rb file. ActiveRecord fetches UTC from the database and converts it to the timezone specified in config.time_zone. Refer this article in case you need help with setting up timezone at application level. 2. Set the timezone based on the one specified by