Copy Paste Error with Rspec

software ruby on rails

Everyone loves laughing with others about their mistakes. Let’s laugh at me for a second here.

I test my Rails applications with RSpec. While editing the users factory for 2 new user types, I copied lines 19-23 in the image below. I changed the factory name to the 2 added user types, saved and closed the file. I then proceeded to update the users controller spec to test the permissions of these two new user types. Between not being confident in my RSpec skills and getting some false positives, I couldn’t figure out why some tests passed and some failed. After way too long, I finally found the problem. Can you?

Copy/Paste normally saves time but in this case it definitely didn’t. Always double check your code, friends. 🤦‍♂️

Chris Francis
Software Developer, BiteSite

Developer Productivity Tools

tools software software development

Every developer has their own environment. Take a peek into the environment I use to create software. Most of these are independent of the software I create and can be used by anyone.

1. GitLens Visual Studio Code Extension

Visual Studio Code - commonly referred to as vscode - is a free to use code editor created by Microsoft available on all operating systems. With its large popularity, if you are a developer you probably already use this everyday.

On the surface vscode is a code editor that allows you to edit files. Its power lies in the extensions it offers and the customizability of your programming environment. If there is a way to optimize your coding experience an extension for it probably exists.

How does it increase productivity?

My most used (and all time favourite) extension that improves productivity is the GitLens extension. With 59.43 million downloads and an overall rating of 4.8/5 stars, I am confident this will be one of your most used extensions. Overall this extension allows you to use Git inside your code editor.

If you open your project in its root folder, Vscode is smart enough to recognize the branch you are currently on as well as all previous repository information. The days of needing to be a command line wizard are long gone with the ability to do all source control commands straight from your code editor’s GUI. As seen in the image below, the source control menu contains multiple submenus such as commits, repositories, file history, branches, etc. The use of these sub-menus could be a full article itself but I will focus on the source control section since I use it the most.

The source control section is a list of all files changed since your last commit. Each file can be selected to show a side by side ‘Working Tree’ highlighting the removals and additions you did to each file. Picture either git diff or the Files Changed section of a PR on GitHub.

Before I commit and push my code for a PR review I use this file changes section to go through all the changes I made on the current branch to make sure when I create my PR it is clean and only contains changes I made to complete the feature.

Website: https://gitlens.amod.io/

2. GitHub Actions

GitHub Actions is a relatively new feature GitHub provides. This feature automates workflows through the use of action scripts. Action scripts are used to run some code when different things happen in your repository. This could be anything from welcoming a new user, to a full CI/CD pipeline.

How does it increase productivity?

Actions increase productivity by allowing developers to automate workflows in their projects. This is not a new concept as seen in well known tools such as Travis, Jenkins, CircleCI, and many others but if you already have your repository in GitHub it does further centralize your development process.

A nice feature Actions provides that helps with developer productivity is the ability to see whether all tests have passed before merging a pull request. If set up to run on pull request creation, GitHub will run the tests when a pull request is created. This then will stop the reviewers from merging the pull request until all tests have been completed. If there are failing tests it will display this information above the ‘Merge pull request’. This can restrict failing tests from getting into the main branch.

A repository’s workflows are stored in .yml files that contain the instructions for Actions to follow. GitHub provides many great examples here if you would like a base file to start with.

Website: https://github.com/features/actions

3. OhMyZsh Z Shell Framework

With the release of MacOS Catalina, Apple switched from bash to Z shell(zsh) as their default login shell. This was due to the licensing around using bash. The licensing for zsh is much easier for Apple to keep their shell environment updated to the latest version for their new releases.

OhMyZsh is a Z shell framework used to easily install plugins and themes. With its massive popularity there is a large community of developers that have created content to help you understand its features as well as help you through any problems you might encounter.

I would suggest this framework to anyone who doesn’t want to worry about small details and would rather have a quick and easy way to customize their shell. You can have all these features with the default Z shell but it will take more time to set up.

How does it increase productivity?

As every developer knows, getting the right theme for a text editor is almost as important as writing good code. OhMyZsh brings the same ability to your terminal through the use of themes.

Here are some features the simple theme in the image below contains:

  • The current branch is displayed beside the directory path. No more needing to type $ git branch to see if you're pushing to master.
  • The X beside the current branch shows that you have uncommitted changes.
  • Double clicking tab will allow you to tab through the options available. Depending on how long you name your branch names this could save seconds of your day.

Okay, none of these are life changing but it's a nice visual upgrade from the default black and white terminal.

Depending on your developer needs, the plugins are where you can actually save time without having to configure shell scripts yourself. There are around 300 different plugins you can choose from to add aliases to your terminal without you having to write the shell scripts yourself. It’s as simple as adding the plugin name to your ~/.zshrc file in the form plugins=(... <NAME>).

Out of all tools mentioned in this article I believe this one is the most variable in its helpfulness. I am glad it's available as I use it myself but I can see how a developer would view it as being overkill for what is essentially a few shell scripts.

Website: https://ohmyz.sh/

4. React DevTools Extension

Although all the other tools in this list could be used by any developer, this tool is specifically for React developers. React DevTools is a Chrome and Firefox extension that provides a component tree hierarchy in the dev tools. Picture the ‘elements’ tab but with your component names rather than html tags. Each component can be selected to show it’s props, state, and hooks.

How does it increase productivity?

This extension is really helpful when trying to debug what components have been rendered as well as what their current variables are assigned to. I like using this extension to manually edit props or state variables in my components to see the result.

This is also helpful when starting a new feature that I am not sure where in the codebase I will be working from. I can use this extension in the app's feature location to find what the affected component names are, then start developing in the code base from there.

Website: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi

5. Microsoft Azure Virtual Machines

While at work I use MacOS but I have helped develop a Windows service. To test this I needed access to a Windows environment. Microsoft offers a cloud platform service that provides access to a windows virtual machine.

How does it increase productivity?

Microsoft Azure provides users with all the benefits of virtual machines. This helps with productivity by providing access to tools without buying another physical machine. To develop the Windows service I could have used another PC with windows installed but it was much easier (and cheaper) to open the Azure virtual machine and do everything remotely.

Website: https://docs.microsoft.com/en-us/azure/virtual-desktop/overview

Chris Francis
Software Developer, BiteSite

SMB Productivity Tools

business software productivity

Everyone loves tools that make life easier. Although phone calls and paper agendas can still be quite useful, there are many alternatives you can use in their place.

Here are some productivity tools we have had success with at BiteSite that you should try yourself. These tools are not limited to developers; they can be used by any type of business or for personal use. There are many tools for productivity as a developer but they have been excluded from this list.

Note: These tools have many features not mentioned. I have focused on the features we use at BiteSite.

1. Slack

Slack is an application used for communication with others through the use of instant messages. This can be used between team members, clients or anyone in a workspace you are a part of.

How does it increase productivity?

Slack organizes your communication and keeps everything in one place. It does this by using a system of workspaces, channels, and threads.

Workspaces are the highest level of categorization. These contain multiple channels.

Channels are group chats that separate the conversations between team members. If these channels are used properly the conversation in a channel should only be related to its topic. This makes communication more organized; especially in the time of remote work. Users in a channel can tag all users or individual users to notify them of a message. Channel members can turn off all non-mention notifications so they are not bothered by conversations where their input is needed. If a channel member needs to get their attention they can be notified via a mention.

Within the channels, sometimes there can be more than one conversation happening at a time. This is where threads can be used. The threads are great to keep topics separate from each other without interrupting a different conversation.

This structure can be confusing at first but the UI presents everything in a way that is easy to understand. This makes it easy to find information from previous conversations and have quick interactions with others.

Website: https://slack.com/intl/en-ca/

2. Trello

Trello is a task management tool in the form of a Kanban board. If you aren't familiar with Kanban boards, picture a whiteboard with multiple columns where each represents a state that a task can be in (todo, doing, done, etc). These columns contain multiple sticky notes. These sticky notes are tasks to be completed. As the task moves throughout the different states while being completed it’s sticky note is moved throughout the board.

How does it increase productivity?

Trello provides a visual representation of everything the team has yet to do, is currently doing, and has done. This keeps the team's collective work organized. Trello also provides the ability to customize your board with Trello Power-Ups. These allow you to have features on your board that do not come native such as integration with Google Drive or Slack. It’s easy to see how this can increase productivity because your work environment can be connected to your product management board.

Website: https://trello.com/en

3. Google Meet

In the current times of working from home, video conferencing is extremely helpful for communicating anything over a few lines of text. Google Meet provides in browser video conferences that can be joined with no extra setup other than clicking a link.

How does it increase productivity?

This increases productivity by allowing many more options than its alternatives. Text with images take time to type out and format, phone calls only allow verbal explanations, and a screen recording doesn't allow real time interaction. Video calling has all these features and more. You can explain the topic through speech while sharing your screen and anyone in the call can speak up just like an in person conversation. This all happens while viewing the other person to note body language and non-verbal communication cues. A five minute call can replace fifteen minutes of back and forth messages.

Website: https://meet.google.com/

4. Google Calendar

Another part of the Google Suite we use is Google Calendar. Events can be created and added to your calendar with a Google Meet link in the email invitation. Since this is accessed from a browser your calendar can be viewed from anywhere.

How does it increase productivity?

Besides keeping your events organized and accessible from anywhere you have access to the internet, the feature I like the most about Google Calendar is its ability to add a notification for a set amount of time before the event start time. This ensures I’m notified of an event before it happens so I can be prepared.

Website: https://calendar.google.com/

5. FreshBooks

FreshBooks is the accounting software that we use at BiteSite. The main feature used is the time tracking. This is from the perspective of an employee but there are many other features used for invoicing, managing expenses, etc.

How does it increase productivity?

The time tracking feature of this software is the feature that saves the most time. As a service company, billable hours are tracked to be able to keep records of time spent on different tasks. FreshBooks makes this trivial. The user starts a timer with the click of a button when they start their task. This timer continues until the user presses stop. The stop button logs the exact time spent on the task with a description entered by the user. The software automatically calculates total billable hours by day, week, or month. There is no need to wonder how long something took to complete anymore. FreshBooks does it all for you.

Website: https://my.freshbooks.com/

Photo by Cesar Carlevarino Aragon on Unsplash

Chris Francis
Software Developer, BiteSite

Custom Software - Software Built Specifically to Solve Your Problem

business software

So we’ve written many articles about Custom Software. We’ve talked about what it is and what the pros and cons are, but we’ve only scratched the surface.

As we’ve mentioned, Custom Software is software built specifically for you. When you’ve tried existing solutions and they didn’t fit your needs for whatever reason, Custom Software is definitely an option to consider.

Let’s take a concrete example. Let’s say you want to build a website, and you’d like to be able to manage the content on it. So you go out and you try all the industry leaders: Wix, Squarespace, Wordpress. As you use these, you might start to think “Hey these are great, but there are some key features that are missing that would be perfect for my business.” At that point, Custom Software is something you might consider.

The hidden message in “Custom Software is software built specifically for you” is that “Custom Software is software built specifically to solve your problem”.

Let’s examine that a bit more closely.

The problem with Mass Market Software

When people come to us, professionally or for friendly advice, we usually recommend mass market software. Mass market software is generally very high quality, feature rich, and cheap. If you look at software like Wix, Shopify, or Freshbooks, you can generally get started for as low as Free and only go as high as maybe hundreds of dollars a year. In the grand scheme of things, you get a lot for your money. For the most part, and for most people, mass market software is the way to go.

However, it’s not for everybody.

The main problem with mass market software is that it’s designed for the mass market. Product companies, rightfully, design their software to satisfy 90% of the market and do a great job at it. The issue is that there is still that 10% whose environment is different, whose problems are different, and whose lives are different.

There are a myriad of reason why you might fit into that 10%. Perhaps you’re in a very niche industry. Perhaps you’ve invested in legacy software that you want to continue to use. Perhaps you’re pushing the boundaries and doing things that no one else has done before. Whatever the reason, if you’re in that 10%, mass market software might not cut it.

Why isn’t there Mass Market Software to solve my problem

So then you may ask, well I’m among a bunch of people who need this problem solved. Why hasn’t anybody solved it yet? Well it comes down to company strategy and creating a successful business. Think about it. If you were building a company and you did some market research and you found that 90% of people deal with Problem A and 10% of people deal with Problem B - who would you go after? Naturally you’d pick Problem A.

So that’s why generally if you find yourself in the 10%, you might not find any mass market software to solve your problem.

What do you mean it’ll solve my problem

We keep talking in high level terms here that Custom Software is designed specifically to solve your problem. However, it can be abstract, so let’s take an example.

Let’s go back to the example of building your own website. Let’s say you try these “built it yourself” programs and let’s say you are creating some kind of booking system. For example, perhaps you are a plumbing company and you want to build a form where people can book appointments.

So you build a form and people start filling out the form to book appointments. As you start to use it, you realize that it would be really beneficial that if someone booked an appointment for today, that any plumber that’s already out in the field be notified. So you enable that feature and emails start going out to the plumbers who are on duty.

Then you run into a problem.

You realize that the plumbers you have on duty are not actively checking their email on their phones. They are busy driving and doing jobs. You find that they respond best when the phone rings.

So they you think “It would be great that if someone booked an appointment that was specifically for today, that it would call a list of phone numbers and leave an automated message”.

This might be exactly the type of problem that no one has solved yet or no one has built for the platforms you’re dealing with.

You deal with this problem because of the industry that you’re in and because of the way your team operates. Rather than get your team to change, you could build software that works well with the dynamic you already have.

To be honest - this is the flow that we typically recommend for people. Try something out like mass market first, and if you really find it doesn’t suit your needs - custom software is a good consideration.

Sometimes it’s more than just features

Sometimes custom software is not just about implementing features that don’t exist. Sometimes it’s about tailoring an existing feature to suit your needs.

Perhaps some mass market software does indeed solve your problem, but it’s clunky, or the interface has too many steps or clicks or taps to execute what you want to do. You want to make it easy on you and your staff so you get a Custom Software shop to build you that same feature but with an optimized user experience.

The other thing is, Custom Software also gets rid of the clutter that can overwhelm you, your staff or your customers. Because mass market software is catering to 90% of the market, sometimes they have a ton of features you don’t need. You might have a huge number of sections to the application and hundreds of pages to navigate through and while the features are there - it becomes very overwhelming to use. With custom software, you only have what you want.

One note about Custom Software Development

In talking about this, I should mention that Custom Software is definitely a spectrum. While we specialize in ground up solutions, Custom Software development does exist in the realm of mass market software. For example, platforms like Wordpress or Shopify do allow for custom development that integrates with the platform.

So do not let anybody tell you that you can’t do Custom Software development on an existing mass market platform. It all depends on the platform. Some are very open and easily to develop on, and others not.

Only when you’re ready

So in the end, the big take home message here is that Custom Software can be optimal for solving your problem. However, because of the time, effort, and money it takes to develop, it should really only be considered after you’ve explored existing mass market solutions.

If you do end up in the 10% though, having a custom solution built specifically for you can be incredibly rewarding and help you grow your company and push the boundaries of your industry.

Photo by Ono Kosuki from Pexels

Casey Li
CEO & Founder, BiteSite

5 JavaScript Tricks

javascript software

Here's a quick video we put together to show you 5 JavaScript tricks that'll hopefully brighten up your coding day :)

Casey Li
CEO & Founder, BiteSite