Why Programmers Include Unit Tests for Quality Assurance

Described concisely and directly, Unit Tests is Quality Assurance (QA) for the core of your software. The main difference between Unit Tests and regular QA is that Unit Tests are not done by a user interacting with the software directly. In fact, they are done by a programmer with code.

When we develop software, it must meet an objective or main requirement.

  • The core of the software is the code that relates directly to that objective.
  • The core is essential. If it does not function correctly, the software has no purpose.

Examples of software cores:

  • Online Payment – the code that processes the credit card or web payment method given by the user.
  • Hotel Booking Engine – the code that associates the user’s information to the hotel room and saves this to a database.
  • Scientific Calculator – the code that performs the actual calculations and returns a result.

When a software is declared ‘done,’ Quality Assurance (QA) tests the software to assure it satisfies its objective.

  • In a controlled environment, QA tests every core function possibility, making sure nothing breaks and everything works as expected.
  • The core is outlined clearly with every one of its cases for QA to test continuously.

The number of tests QA needs to perform can grow rapidly…

For instance, take a basic calculator (a relatively simple, single page application) that uses 4 basic functions (ADD / SUBTRACT / MULTIPLY / DIVIDE)

At first, QA needs to test the calculator’s 4 basic functions…

However, to ensure quality, QA needs to test every possible combination of functions at one time. 

One feature at a time:
ADD SUBTRACT
MULTIPLY DIVIDE

 

Two features at a time:
ADD / SUBTRACT ADD / MULTIPLY ADD / DIVIDE
SUBTRACT / MULTIPLY SUBTRACT / DIVIDE MULTIPLY / DIVIDE

 

Three features at a time:
ADD / SUBTRACT / MULTIPLY ADD / MULTIPLY / DIVIDE
SUBTRACT / MULTIPLY / DIVIDE SUBTRACT / DIVIDE / ADD

 

Four features at a time:
ADD / SUBTRACT / MULTIPLY / DIVIDE

 

  • For a basic calculator application that has four functions, QA needs to run 15 tests continuously to ensure it works properly.
  • Each scenario should be tested with its own input and all outputs need to be verified.
  • Now imagine another a new function is added to the app, for example, the trigonometric function sine. You have to test all the above functions again, but this time with the sine code added.
  • With the addition of 1 function, the number of tests increases from 15 to 31. The addition of 1 function doubles the number of tests to perform and forces QA to repeat tests.
  • A typical scientific calculator includes at least 13 functions:  add, subtract, multiply, divide, percent, sine, cosine, tangent, square root, nth root, exponent, log, factorial.
  • That yields a grand total of 8191 different test cases to perform!

This amount of QA is not feasible for a person to perform…. enter unit tests.

  • Unit Tests are QA for the software core done by machine calculations, therefore free of human errors.
  • Unit Tests will send inputs to the software core and evaluate the result.
  • The fact that it is done by code helps test a big number of cases and vary the inputs accordingly.

Typical Unit Test Structure

Given… Inputs
It (when)… Code to be tested.
Should (then)… Evaluation of results.
  • In the ‘Given’ section the programmer declares the inputs that will be passed to the feature tested. This can be a single number (like the calculator) or a different input, like a database object.
  • In the ‘It’ section, the programmer details the function or code that will be run and tested.
  • In the ‘Should’ section the results are evaluated and the Unit Test passes or fails.
  • Unit Tests include objects called ‘Mocks’ which resemble a database record. The programmer hardcodes the Mock’s attributes values, but it is important to note that the attributes are the same as a database record attributes, making it able to be tested.

 

Unit Tests are not fancy, unnecessary code

  • Unit Tests run quickly while verifying outputs correctly.
  • They are scalable and fit for applications with multiple requirements.
  • When a new variable is added, tests that verified the old cases can be reused.
  • Unit Tests are not a luxury, but an advanced way of doing QA by code that is needed when the software that wants to be tested has too many cases for a human to consider.
  • Plus, they are free from a human error, like passing a wrong input or interpreting the result incorrectly.
  • Unit Tests make QA more efficient while making it harder for its members to enter, as they will require a programming background.

 

At Number8 our programmers implement necessary code to ensure your software products can handle all functions and develop as needed. If you are interested in learning more about our development process or if you think you are qualified to join our team, then give us a call at (502) 890-7665 today!

My Xamarin Experience

xamarinDifferent Options

When developing software, whether it’s for a fun project or a formal business project, a requirement can be met by many different options and technologies. After a while of looking at many, it is natural to think which is the best option for the requirement.

Let us consider the options for building a mobile application.

Sometimes the best option is determined by the compatibility of the implications of the option and the technical strengths of the development team. (I’ll cover implications a little later)  The first option to consider when building a mobile application are native applications, but it immediately raises a warning – when the code for a platform is done, the code will need to be transcribed to another platform.  Second, every native technology has its own implications. So to have a successful mobile experience in all native platforms, a developer for each platform is needed.

Even if there was a developer for each platform, is it worthwhile to develop a native mobile application for each platform instead of modifying a web page so it can be viewed in any device?  This is an important question to consider so here is a comparison chart for key characteristics.

CharacteristicNative ApplicationWeb Page
InternetAfter downloading the app, it can work in offline or online modeOnly works with internet connectivity
PerformanceNative components are lightweight and fastPages tend to be heavy and work somewhat slower
Push NotificationsCan send push notificationsCan’t send push notifications
Hardware AccessAccess to camera, speaker, flash, etc.Does not have access to hardware
AccessibilityOpening the app with a clickOpening browse and typing URL
User ExperienceNatural feels and smoothUnnatural and, in some cases, slow

Based on this comparison, it appears that a native application offers a wider range for creativity and service options. If the development team handles all the implications for every platform then it might be a good idea to develop a mobile app natively for each platform, considering that native applications have the best performance and assuming the business is willing to pay a higher cost.

Let’s talk more about those “implications”.


Implications

When dealing with software frameworks and APIs, each framework works naturally with the programmer at least interacting with (in others mastering) certain technologies or programming languages. This comes naturally if the framework is an extension for another technology.

For example, consider Node.js, a JavaScript runtime. When using Node.js, being a JavaScript runtime, the code will naturally be programmed in JavaScript language. Therefore, working with Node.js framework implies the programmer knows, or can at least interact with, JavaScript language. We’ll call these framework dependency implications.

Following are some implications for some mobile application frameworks.

Mobile Application TechnologyImplications
Native Android Mobile App• Java
Native iOS Mobile App• Objective-C or Swift programming language
Xamarin• .Net (C# programming language) • Extensible Application Markup Language (XAML)
Appcelerator• JavaScript • Titanium SDK
Phonegap• Hypertext Markup Language (HTML) • JavaScript Language • Cascading Style Sheets (CSS) Language
Ionic• Hypertext Markup Language (HTML) • JavaScript Language • Cascading Style Sheets (CSS) Language • AngularJS
React Native• Hypertext Markup Language (HTML) • JavaScript Language (ES6 Syntax) • JavaScript XML (JSX) • Document Object Model (DOM)
Sencha Touch• Hypertext Markup Language (HTML) • JavaScript Language • Cascading Style Sheets (CSS) Language • Sencha SDK • MVC Architecture

There is another cost that is not visible at first glance.  Even though the different platform projects have the same core and logic, ultimately they are individual projects. Each project has a different language and application lifecycle and SDKs, so each project will also need its specialized maintenance. This can all add up.  If creating the application natively appears to be too expensive or the development team does not handle all the implications, another strategy can be used.

Using a cross-platform technology has become very popular as a hybrid solution for mobile development, so you can write one set of code that can be used on multiple platforms and can give the user a native experience. There are many cross-platform mobile app technologies, each with it’s own implications. The strategy is to pick technology that has an implication that the development team masters, plus another consideration. Since this is cross-platform, it is important to choose a solution that has a large percentage of transcribing code; the code that can be written once and run natively across the platforms.


xamarin developerMy Experience

When I decided I wanted to develop mobile apps, my first thought was “What native technologies do I know?”

I had used Objective-C for an iOS application.  If I wanted to make a native android or windows phone application, I’d have to learn about project structure and app lifecycle and hope I could program in the language they used. Since I only knew one native technology (iOS) I decided it was better to invest time learning a cross platform technology.

I then thought “Now if I’m going to use a cross platform technology, what implications can I handle the best?”.  Xamarin was a natural choice for me, thanks to the language and application structure.  C# is one of the languages I handle the best, plus the structure was intuitive. An .xml page with its back end code, the application lifecycle was also C-like. I managed to learn XAML and the app structure and lifecycle quickly.

Later, I discovered that Xamarin generated native apps that shared 95% of the common code. I also got to an acceptable level of understanding in android and iOS native applications. Then I decided to test Xamarin’s generated native projects. It seemed that the native applications were greatly structured and coded. I thought “Wow. In theory, it is possible for someone to develop a full native Android app without knowing Java or the android app structure or even having the Android Studio”. Another plus for cross-platform technologies comes from the abstraction layer.  When using Xamarin, the code handles mobile events (like Swipe) in Xamarin’s way.

I can code once and use these events without even knowing how to do it the native way.

I decided it was a good idea to take full advantage of these generated projects and tried making everything in Xamarin, because some things are not implemented on the framework. For example, Xamarin has no radio button tag for iOS applications. Instead of modifying the generated iOS application and using Apple’s radio button, I decided to implement my own radio button in Xamarin, which rendered natively in iOS. This seemed like a good choice that would become an advantage, but I also found a disadvantage, when making a minimum change on a Xamarin project, it must be recompiled to see the changes on the device. This can be time consuming if one wants to test various changes.


Conclusions

I decided to use Xamarin to build mobile apps because it was cross-platform. So most code would only have to be written once. And the projects generated by Xamarin were native. This is not the case on every cross-platform technology. The fact that the final projects are native is an advantage since mobile characteristics can be used.

Still, I studied native projects for Android and iOS to be able to modify the generated projects if something can’t really be done on Xamarin (I realized Xamarin does not support everything for every platform). Again, this can be done because Xamarin generates native projects.

In other words, I take advantage of Xamarin to reutilize code and generate fully native platforms to the extent it permits me, but I also know how to do it without Xamarin in case I really need to modify a native project. Xamarin’s implications are my strengths in programming. This is how I determined Xamarin was the best option for me when it comes to developing mobile applications.

It is important to note that the best option is a balance between the technical strengths of the development team and the implications of the technology. Xamarin with native platforms background was the best option for me, but I have a C# background.  Another developer could have worked faster with Ionic if, say, the developer is a master in AngularJS.

TED Talks to Remember – An Overview of 3 Favorites

Our favorite TED Talks best ted talks

When we’re bored, unmotivated, or just in need of a quick mental pick-me-up, watching TED Talks is a perfect way to reboot the mind get us back on track. The topics of these speeches performed the world’s most innovative speakers range from reading body language to teaching kids how to eat their vegetables, but our favorites are the ones that make us embrace what we perceive as “faults.” So much of our potential is wasted through self-doubt, but these particular TED Talks help a person move through it and come out the other side more confident and able to pursue their true purpose.

 

Adam Grant – 4 Surprising Habits of Original Thinkers


Wharton professor Adam Grant specializes in organizational psychology. His work involves researching and establishing principles that help solve problems in the workplace and improve the overall quality of life for people. His first TED Talk, Are you a giver or a taker?, is worth a watch as well, but we like the way this one helped us rethink our insecurities, our apprehensions, and even our tardiness. 

Through his observations of former students turn Warby Parker entrepreneurs, Grant explores how the future successful people don’t always seem so at first glance.

Watch it here:

Barry Schwartz – The paradox of choice


In the United States, people are spoiled with choices… but is that a good thing? Psychologist Barry Schwartz makes a very powerful argument here that it isn’t. His idea is that if a person is presented with too many choices, he will fail to make one because of his fear of choosing incorrectly. This “paralysis of choice” is something people deal with all the time whether it be at work, out shopping, or even in our personal lives.

Even if a person does make a choice, the knowledge that there were so many other avenues to take causes him to wonder if there was a better way to go. It’s a classic “grass is always greener on the other side” feeling. Schwartz argues that when we have less to choose from, our expectations remain reasonable and we are more satisfied with our choices.

Watch it here:

 

Brené Brown – The power of vulnerability


Being vulnerable is frightening, but anything that can elicit such emotion must be powerful, right? Brené Brown thinks so. Through her studies of vulnerability, courage, authenticity, and shame, Brown tries to understand humans better. She studies how our relationships with others and, perhaps more importantly, ourselves, affect our quality of life.

As humans, we try and avoid vulnerability. It’s seen as a weakness, a flaw, and a way for the world to take advantage of you. Brown argues that without vulnerability, we will never get the things we want out of life. These things range from a healthy relationship to a fulfilling career, or just accomplishing whatever personal goals you have. Instead of numbing our vulnerability, Brown encourages people to embrace it, own up to it, and engage with it.

Watch it here:

 


At Number8, we encourage our employees to embrace their flaws and re-think them as strengths. This innovative way of self-perception enables us to come up with creative solutions while enjoying a better quality of life. If you’re interested in learning more about Number8 and what we do, give us a call at (502) 890-7665, or check out our information page here!

What to Expect at IdeaFestival 2017

ideafestival 2017Technology conferences occur all over the world every year from Mobile World Congress – the largest mobile industry gathering in the world – in Barcelona, Spain to Amazon re:Invent – a conference hosted by Amazon that educates the global cloud computing community. With so many technology conferences, it is easy for someone in tech to find a conference that piques their interests. IdeaFestival 2017, located in downtown Louisville, Kentucky, is the next technology conference on the calendar.

The technology conference/festival pitches itself as “a celebration of the curious, with the goal of inspiring all people to embrace the excitement and danger of new ideas” and promotes thinking in different and innovative ways.  IdeaFestival will run from Tuesday, September 26th thru September 28th, 2017 starting with a full day event on the 26th – Thrivals 10.0. This year’s conference is hosting plenty of events and attendees will see a plethora of presenters. Read in detail what to expect at IdeaFestival in Louisville, KY this year and how to get involved.

4 Things to Expect at IdeaFestival 2017

1. Opportunity to Expand Your Festival Experience

IdeaFestival itself is a two-day festival that runs the 27th and the 28th of September; however, there is an opportunity to add another day onto your festival experience with Thrivals 10.0. For an extra $49 become a part of the full-day conference on “finding your algorithm for the future”. This fall, the conversation is focused on living in a digital age that is constantly changing. It will also cover the combination of GRIt, humanity, and artificial intelligence. Thrivals 10.0 will feature 10 presenters including Janelle Monae – an American musician and one of the leading ladies in “Hidden Figures”.

2. A Packed, Fun-Filled Day-to-Day Schedule

IdeaFestival released the day-to-day agenda for the 2017 conference and each day is full of presentations and classes. The two-day festival starts at 8:00 a.m. each day and includes different presentations as well as several 10-minute classes. Class topics have not be announced yet, but you can stay tuned on the Agenda portion of the IdeaFestival website.

The first day of the festival, after Thrivals 10.0, kicks off at 8:00 a.m. and ends at 5:30 p.m. or 8:00 p.m. depending on your festival access. If you have a festival pass, you’re invited to join sponsors and presenters for Taste: The Culinary Artists of the Region – a networking experience with food sponsored by Copper & Kings. The Thursday of the festival runs from 8:00 a.m. to 5:30 p.m. with no additional presentations available afterwards.

3. Inspirational Speakers and Presenters

On top of the 10 presenters that will be at Thrivals 10.0, there will also be 25 presenters at IdeaFestival. 2017 presenters include: Ann Carlson – a performance artist and performance curator; Hannah Drake – lead artist for Louisville’s local Project HEAL; Tom Eblen – a Western Kentucky University alumni and columnist for the Lexington Herald-Leader; Peter Gray – an American psychologist and research professor at Boston College; John King – CNN’s chief national correspondent and anchor of Inside Politics; and more.

4. Coverage Over a Variety of Topics

The presentations at IdeaFestival 2017 cover a wide variety of topics and, as a result, guarantee something for everyone. The first day of the festival opens with a presentation by Joe Geoghegan titled “Field Notes: The Untapped Power of Diversity in a Fractured World”.  His presentation will cover his experience traveling to over a dozen countries using only his wits and he’ll be sharing his notes on and impressions of his travels while taking a break from his adventuring. Throughout the first day, festival-goers will be able to listen to presentations on the future of our economy, the prevalence of cyberpunk, the relationship between humans and the planet, the science behind whiskey, and much more.

The second day of IdeaFestival will get kicked off with a presentation by Emily Dreyfuss – senior writer at Wired – during which she will discuss some of the biggest pieces of technology emerging and disrupting business, design, science, and culture. Festival attendees can participate in presentation on polarization, the art of food as medicine, and the mind and music of Chopin before IdeaFestival concludes.

IdeaFestival is going to be an informative and inspirational technology conference this year as it has in the past.

Be sure to buy a ticket to the two or three-day event depending on your interest in Thrivals 10.0! The festival will be held at the Kentucky Center  at 501 W. Main Street, Louisville, Kentucky. IdeaFestival is an opportunity to collaborate with others interested in technology and get inspired to think outside the box.

At Number 8, we embrace innovation and, furthermore, we pride ourselves on exercising formative thinking in every endeavor we chase. IdeaFestival 2017 has the same values, so we encourage any and everyone to attend the 2017 technology conference if possible. Interested in learning more about Number 8 and how we employ innovative technologies and schools of thought while living our day-to-day lives? Contact us today. Call us at 502-890-7665 today or visit us online.

 

Working Remotely: Five Tips to Make it Easier

Home Office for Working RemotelyAccording to a recent study conducted by Gallup, more employees are working remotely now than ever before. Out of 15,000 adults surveyed, over 40% said they spent time working from home. We also published a blog post last month that details the various changes occurring in our current work force. The traditional work-week schedule is adapting to better suit employees’ lifestyles.

To help usher in this new style of employment, we have gathered nine tips that we believe can aid in adapting to working remotely.

Find the right job

First, and maybe most importantly, you should be at a company that understands and supports employees who work remotely. If you are already in a position and you’d like to transition into working out of the office, strike up a conversation with your superiors as soon as possible. If they won’t budge, then perhaps it’s a sign you should begin looking elsewhere.

Establish and maintain a private work area

Having your own space to work is extremely helpful when it comes to productivity and focus. You should have an area that is solely dedicated to work, with an actual desk and no distractions. If possible, a home office is ideal when it comes to working remotely.

Connect with your team

Physical distance should not inhibit your relationship with coworkers, or your managers. It is vital to maintain constant communication from all sides to ensure you are staying on track, and that your fellow employees are all up to speed with your projects.

Work around your energy, not the clock

One of the major benefits of working remotely is that you don’t have to follow the typical 9 a.m. to 5 p.m. timeline. While you shouldn’t use this as an excuse to sleep the morning away, it can be incredibly useful for when you’re feeling particularly motivated. Our most creative moments don’t necessarily come within that 8-hour window, so take advantage of the flexibility.

Dress for success

You wouldn’t wear pajamas into the office, so don’t do it when working remotely either. It is certainly tempting, however maintaining a well kept appearance even when working from home will make you feel more successful and productive. Suit and tie not required, but stay away from the sweatpants at least.  

Because our employees are located both in Louisville, KY and Costa Rica, many of them work on Number8 projects remotely. We support this method of work, because we know our employees are able to produce the highest quality products no matter where they are. If you’re interested in learning more about us and what we do, visit our information page here. And if you’re looking for IT services, or software development assistance, give us a call today at (502) 890-7665!