Unit Tests... Time Waster or Life Saver?

It's been my experience that there are two camps as it pertains to the writing and use of Unit Tests.  Those who are for them say it saves time and money, as the saving of one = the savings of the other and those against them complain about the time and repetitiveness of writing them.

Automated Unit Tests Save Time and Money


My first position in the Software Development industry was installing and supporting software at the Client's site.  We would download the latest build from the Development team, install, test, and report any issues found.  With any luck, we found and fixed any problems before the Client saw them.  Too often, though they found them first.  It is with this first experience as a fledgling member of a new company that I would start to see the challenges NOT having high quality, automated Unit Tests.  Too many times to count I was left scrambling trying to resolve new issues in code both old and new.

With this new perspective of what DOESN'T work I was determined to improve quality.  When I was promoted to Development that is precisely what I started with.  It is with that, that I ran into the below challenges:

Reluctance

I began writing Unit tests, and encouraged other developers to do the same.  I gave several 'Lunch-N-Learn' seminars and demonstrations on how to write good Unit Tests, Test Driven Development, and showed the time-savings associated with it.  To my surprise, most Developers still didn't want to write tests.  Writing Unit Tests was a task that was (in their mind) unnecessary, time-consuming, and actually took time away from adding functionality.  After all, their bonuses were based on functionality added, not tested.

Code Coverage

As I continued to write my tests, I also added coverage reports to the build process.  Management liked to be able to see how much of the code was covered by automated tests, and had the other developers cover any new code by 80% line coverage.



That seemed like a good idea, and - to be honest - I was all for it.  What I didn't foresee was that the other developers continued to view writing tests as a waste of time.  They were writing their tests AFTER their functionality had been added and tested, and put the bare minimum effort into them.  So, their tests were akin to that of a dogs breakfast, terrible.  They would write a test that invoked their code, and it would succeed as long as no errors were thrown.  They included no checks to verify that the code actually did what was intended to do, nor had any testing of edge case or failing conditions.  Yes, they met the 80% code coverage rule to appease Management, but their tests weren't actually testing anything.  The only thing the tests verified with any degree of certainty is that no error was thrown when using the exact case the test was.

False Sense of Security

From a code quality perspective, having no tests is better than having tests that don't actually test anything.  Having automated tests and associated coverage reports gives the feeling of security in the quality of the software, but given that those tests didn't actually do anything, that feeling is completely unjustified and misleading.

Unit Test Quality

Code coverage by itself cannot be used to determine the quality of automated Unit Tests. The only way to determine how good a suite of unit tests are is to review the tests manually.  Each method under test should have several test cases testing a variety of different input parameters, check to ensure the method did what it was supposed to, handles errors appropriately, and verifies the outcome.

So What's The Upside?  How Can We Change Perceptions?

There can be much resistance to writing tests, and shoddy tests written to achieve this 80% line coverage management seems to have fallen in love with.  The question becomes how can we show that this upfront effort will save time and money?  How can we show that branch coverage is preferable and the quality of testing is vital to ensure the usefulness of the procedure?

The Code - Deploy - Start Container - Navigate - Test - Debug Cycle

Develop Build Test Cycle

Following Test Driven Development practices actually saves development time for me.  Most software runs in some type of container (i.e. web server, mobile OS, etc.), therefore to test it the way a User would see it requires that the code be deployed to the container, and the container itself be started.  The cycle of code --> deploy --> start the container --> navigate to area of application --> test, can be a long one.  If you do this process over and over again, you can see where the time gets wasted.  However, if the code is running tests, this process is reduced to a fraction of the time (even better if mocked tests are used).  Plus, the tests could (and I argue should) be executing different scenarios, so many scenarios are being tested at the same time during the development phase.  If you are using an expensive tool that does not require the container to be restarted when code changes are made, the start-up process is removed, but you are still able to test only one scenario at a time.  I have worked on projects where it was extremely difficult (and therefore time consuming) to set up the data from one scenario to another.  Automated Unit Tests change all that.

Cost Savings

It is industry-wide knowledge that the cost of fixing a problem in Production code is greater than fixing it during the Development phase.

Relative Cost of a Bug Fix
More scenarios running more often as early as possible in the life of the software means any bugs are found earlier on, whether automated or manual.  But, automated tests run faster, and can run more often (i.e. on a scheduled basis), so bugs are found earlier, and are therefore less expensive to fix.

Quality Code Stands the Test of Time

Any good piece of software will be continuously improved, added to, and ultimately changed (this is called Refactoring) throughout its lifetime.  The only way to ensure that it still works as it was intended is to test it; and test all scenarios.  This can be done manually, but as new functionality is typically added to products, this manual process can take longer and longer each release.  If these scenarios are automated, they can be executed and the results validated very quickly.

Cost of Automated VS Manual Testing

Attrition

People do not stay in an organization forever.  Be it the Developer(s) who wrote the code, or the Tester(s) who tested it, or the Business People who thought it up, eventually, those people move on.  Having tests automated in code ensures that the original functionality works as it was intended, and there's always a record of what it does, and how to use it.

Automated Unit Tests Save Time and Money

I have heard almost every reason (excuse) to not write Automated Unit Tests.  I have found each and every one of them to be completely untrue, and generally spoken by Developers who just don't know how to write proper tests.





Picture credit: http://1.bp.blogspot.com/-5mTaTAcxtYQ/VaCDdgChi1I/AAAAAAAADcA/6PZGYI2B7Dw/s320/bigstock-Timeismoney-81634613.jpg

Picture Credit: http://4.bp.blogspot.com/-UyvzDgLtsto/VaB9nKWiUcI/AAAAAAAADbo/n2fHydQOxUQ/s320/Code%2BCoverage.jpg

Picture Credit: http://1.bp.blogspot.com/-w3tlhrGB2w0/VaB-MobmR0I/AAAAAAAADbw/oqYCTKjo5Os/s200/continuous-integration.png

Picture Credit: http://2.bp.blogspot.com/-cEbbQlKYKDg/VaB3gJmhN4I/AAAAAAAADbQ/SC5-6QR84DQ/s320/relativecostbugfix.png

Picture Credit: http://1.bp.blogspot.com/-tKyzFr2gw5I/VaB9FPJl7CI/AAAAAAAADbg/Ez7cz2bmrN0/s320/Cost%2BAutomated%2BVS%2BManual%2BTesting.png


Off-shoring ~ Real Savings or a Black Hole?

This is a topic that I have dealt with on a first hand basis.  My experiences with off-shoring and my general dislike of the practice stem from my intimate interaction with the process.  I will not say that ALL off-shoring agencies will have ALL of these issues.  What I will say is, not in a million years would I suggest a company take this avenue. 

The drawbacks I am referring to were actually a series of smaller issues that piled on top of each other, and that lead to disaster.


Communication

At first, it was minor communication issues between us and the offshore development team.  As good as requirements can be, there will always be questions or clarifications from Development to Business.  To communicate with us, the process they had in place was for the development team to communicate through their Project Manager (who was in our time zone), and the PM would talk with us.  This cycle took a full day in most cases (due to the time zone issue).  A few questions lead to additional questions, and this resulting in some issues taking up to a week to be fully answered.  To address this, the development team began working during our work time.  As an unintended consequence, the Team Lead (who was female) didn't feel safe enough to leave the office at night, so she slept at the office during the week.

Attrition

At almost the halfway point to the project (about 5 months in), we began to notice significant issues with quality, and deliverables not being met.  It took us a while to get to the bottom of it, but what had happened was a few senior developers had left the company (one of which was from our project).  What the company did was move one senior developer off our project, and put them on another (to cover that project).  That left our project without 2 senior developers.  As part of the contract, we were to have those senior developers, so their company promoted two junior developers to senior to cover them contractually.  They then hired two entry-level developers for our project, and called them junior developers.

Quality

We were left with one Team Lead, one senior developer, and 6 junior / entry-level developers.  Not surprisingly, the quality of the application suffered greatly.  Defects we could handle, but it was the lack of experience in coding that lead to significant PERFORMANCE problems.  Our application was expected to handle a large amount of data in real-time, and due to the way the application was built, it would not perform anywhere near the pre-defined requirements.  What followed was attempts to refactor areas of the application, and - although performance improved - that refactoring was not able to meet our performance requirements (or that of our End Users).  As a last-ditch effort, some areas of the application were re-written, but it was too late.

To be fair, I believe the re-written pieces of the application would have met our performance criteria.

Outcome

With the communication issues, and lack of experienced developers, the project had significant quality and performance issues.  The delivery date (for us and our client) was missed, and the make-up date was also missed.  With the state the application was in, combined with an uncertainty of completion date, our client pulled the plug on the project.

What ended up happening was we lost the client, the client sued the company I worked for, the company I worked for sued the offshore development company, and the two people in our company who recommended off-shoring lost their jobs.

Conclusion

When looking for a Software Vendor, ask yourself if the benefit (which is ONLY cost) is really worth the risks and drawbacks, and potentially negative outcomes (which are many).

What I can say is that due to my experiences with Off-shoring software development, there is no power on earth that would make me go that route; the stakes are just too high to gamble.

Capture Some of Amazon's Revenue!


With Black Friday, Cyber Monday, and Christmas just around the bend, is your company ready to take in some of the money flying around the Internet?  Is your business setup to partake in the joy of online sales?  You know that sunny spot in your business where your customers come to YOU in the hopes of buying that thing you offer to make the person in their lives overjoyed?

Listen, very rarely will people be so willing to separate from their cash as they will this time of year.  Nothing is higher on peoples list than making those people they love happy.  It's a need that drives people to scour the internet looking for YOU.  Last year in just the U.S. there was an estimated 191.1 million online shoppers, by 2018 they are projecting that number to be 215.1 million (http://www.statista.com/statistics/183755/number-of-us-internet-shoppers-since-2009/).  Can your company afford to miss the opportunity of this growth? 

You may be thinking well wait...  I don't have a product, I sell services.  Bundle those services people. i.e. you teach Yoga: offer a 10 class pass or perhaps a specialty offering for those who are elderly or wanting advanced sessions.  Any service can be packaged.  Be unique. Look for niche markets; offer something people don't see often that would be enticing.

How can we allow Amazon to boast $67.86 Billion U.S. dollars in e-commerce revenues in 2013 and not do something to try and siphon some of that (http://www.statista.com/statistics/293089/leading-e-retailers-ranked-by-annual-web-e-commerce-sales/)?  What they do right is ease of use, reviews on products, free shipping on some of their items over a certain dollar value, a return without questions policy and all from the comfort of my couch.

You can make this happen for your company.  You just need to know what your offerings are and we can make it happen. 

Feel Good Friday ~ One Smile Creates Another!

Nothing brings about happiness or laughter like being amongst it.  So for the next 2 minutes sit down and smile or laugh as you see fit :)



Get Out of the River!!!

Last week, as I was on my way home, the dreaded 'Check Engine' light came on in my car.  I managed to slowly limp home, and immediately my wife made an appointment to take my car to a big-name franchise to have the problem found (she's so much better at that stuff than I am - I would have made the problem worse by trying to 'fix' something myself).

The appointment was set for Saturday morning, 8:00am.

I prepared myself for what I was to expect.  I was going to get the news that the transmission was almost dead, and would need either a new one, or a rebuild.  No matter what, I expected to grab my ankles.  Saturday rolls around, I get my car to the garage, stroll up to the desk, and announce my name to Jerry (I know it was Jerry because that was the name on his overalls).  It was then that I got my first surprise of the day.  It wasn't a huge thing, but having been immersed in software for the past 15 years, I was shocked to see that the appointment book was exactly that: an appointment book!  Complete with names and times (written in pen).  Appointment changes were done by drawing a line from the original time-slot to the new one.  Cancellations: you guessed it; the names were crossed out.  I didn't see any, but I'd be willing to bet that there was White-Out in there somewhere.



That got me thinking about how many businesses are still using manual processes?  I'm sure they work well provided things stay the same, but what happens as the business expands?  What happens if Jerry spills his coffee on the appointment book?

Ultimately, it boils down to one piece of imagery: How many people still beat their laundry on a rock in the river?

The rock worked fine: the clothes were clean.  I know what you're thinking.  Having washing and drying machines in our homes is a lot more convenient.  I can't imagine how many hours are saved by  being able to wash laundry at the same time as any other task in our overly-busy lives.  Not to mention the quality of the washing itself; beating clothes against a rock definitely reduces its wearable life.

Business processes are no different.  Manual processes do work for a short time, but cannot compare to the speed, quality, and reliability of having those same processes automated via software.

Companies seem to view software as a tool for a company to interact with their clients or customers.  They focus on their online stores, advertising and selling their products.  Business is more than just sales, it's how the processes function as a unit.  It is true that more sales mean great things to companies, but saving costs is just as good.  There is no greater cost savings than saving time, and that is what automating processes in software does.  All systems can be seamlessly integrated.

How do you plan to better your business?

Don't let your business processes fold in on itself because of Jerry's haphazard coffee.  In this scenario we would create one system that could schedule appointments and bill clients, as well as contact them in the future for marketing and advertising.  All this done seamlessly (and in the blink of an eye).



Women in Business: Fleur Ottaway ~ Venture Digital

Fleur Ottaway, Founder of Venture Digital, is our next amazing woman in business.  She has tackled the IT domain.  Tackled is the absolute best description, it's one of the most competitive markets out there (we should know :) ) What we love about what she's created is that she's not been swayed away from this great 'Venture' because it's a male dominated industry.  On the contrary, she's met it head on.

Venture Digital provides ethical visibility and reputation marketing services to local businesses in and around Barrie, Ontario. They utilize public relations practices combined with today's technologies to bring visibility to local businesses and build their reputation to make them the business of choice for their target clients. Venture Digital also provides reputation monitoring and public relations mitigation services. They have a branch of business for affordable web design, as well a branch of business technology consulting & implementation coming soon!

Here's how the story unfolded:

What made you pick your path as it is today? What about your chosen field drew you to it?

After dealing with some disabling health issues I found myself struggling in my general day-to-day
corporate job. I felt unfulfilled and unchallenged. Suddenly an opportunity came up where I was not
working for a company anymore and I was exploring having to work in Toronto to stay in an IT sector position. Between the commuting and the same stresses in the corporate IT world I realized that this isn’t the path for me, I need more freedom to push myself past my skills and more freedom of schedule to break away from the 9 to 5. This is when I decided to start my own business. In my spare time for the past 10 to 15 years I was volunteering for many organizations, helping them with their internet marketing, publicity, event planning, and business technologies. I found I always enjoyed digital marketing and publicity more than my daily IT job. I enjoy interacting with people and audiences more than working behind the scenes in IT. So I decided to start my business for marketing and PR in a digital world.

How did you decide or what made you decide that this passion for your chosen career could go from what you love to something others would value to?

It really was part of the realization that I was taking this on in my part-time volunteer roles and loving it so much more than the IT position I was doing full time. The organizations were in great need of these services and didn’t know enough about it to do it all themselves. As well it gave results; the organizations succeeded more when implementing these services as part of their overall activities.

Was there a time commitment to becoming an ‘expert’ in this field and what did you find challenging about this leg of the journey?

I did take a certificate program for digital marketing and certified in the Online Marketing Certified Practitioners (OMCP). For any of the technical aspects of my business, I attended Georgian College for 3 years. I took a diploma program in Computer Systems Technician and a post graduate studies in Cyberspace security. These courses set the groundwork but the hands on positions I did in my co-ops and after school is where I learned the most. I learn best by doing and that is probably why I have all this knowledge in internet marketing and public relations even though I never went to school for it. I also find marketing requires a lot of understanding of people, their personalities, habits, and beliefs.  Having grown up in a household where my mother was running her own business in counseling and alternative healthcare I picked up many of these skills. They became ingrained into me.

Given where you are now, what do you find most challenging about getting your business going? How are you dealing with those concerns?

The thing I find most challenging is that I provide high quality work but in today’s economy people want to cut costs. I have been able to work with some of my services like my web design services to find a simple solution at an affordable rate however it is tougher when working with the subjective world of marketing. The things I am doing to work around this is, trying to find the best processes to deliver services to clients that are looking to cut costs as well as branching out into groups like BNI and soon heading south of Barrie for networking groups in Newmarket and Vaughan. To reach larger markets you have to be willing to spend extra time and money and that’s what I have come to realize and started to do.

Given your location how are you going to reach your customers? How do you plan your strategy for business direction or how would you once things get going?

In the Simcoe County region networking is key to building a business, as you move further South it
becomes more about visibility advertising and knowing the right people. As mentioned above I have
been branching into larger networking opportunities like BNI and groups south of Barrie. As I head
further south into the GTA I need to start looking at more paid advertising and making contacts in the
right places, which I usually am pretty good at.

My business direction is to grow, hire employees, and incorporate. All of this is in an effort to start
bidding on government and corporate contracts and eventually move into Asian markets. I want this
business to grow into a worldwide enterprise and support future employees and become a key player inthis industry.

Looking forward in time what is the one thing you hope your business brings to your customers?

I want my customers to feel appreciated and empowered with knowledge. I believe in great customer service and being transparent with my customers. Many of my clients appreciate that I keep them informed as well as teach them to understand the marketing and technical aspects of their business.  They feel more at ease and confident and that’s what I want for my clients.
 
 Fleur and her company Venture Digital can be found on:

Women in Business: Carolina Belmares ~ Sweatglow Fitness

The weight loss arena is a huge money maker, this goes without saying.  There are so many fads and 'diets' out there all boasting grand results and weight loss before you can blink an eye.  My next featured Women in Business is Carolina Belmeras, certified Personal Trainer, certified Zumba Instructor, and the only fitness professional in the Barrie area certified in Sports Nutrition by Precision Nutrition.

Born in Mexico and with a passion for fitness, dance, and all things health, she has found joy in sharing her knowledge of exercise and nutrition as key aspects to wellness.  Having finished her very own one-year body transformation, Carolina understands that there is no better way to coach than by example.

Here is her story:

Looking back on my childhood I should have anticipated a life dedicated to fitness. In hindsight, not
only my love for sports and movement offered a good clue, but also my inability to focus on numerical tasks, frustration with long lectures, and disinterest of all things history may have been a hint. As you can imagine, I was one of those fidgety kids!

Through motion is how I learn and find my peace.

However, it took me several years to come to this realization. For some time in my early and mid-20’s I belonged to the club of what is popularly known in the industry as the “skinny-fat.” That is to say, my body kept slender (even after the birth of my first daughter) without much effort from my part... but my physical condition was quite lacking. Yes, I was one of those who could eat whatever and not gain weight. But looks can be deceiving.

I had no endurance or flexibility. Any attempt to run or move even remotely fast left me winded and
short of breath almost immediately. I had no muscle tone, and even though my frame looked petite I
could begin noticing a softness and (for lack of a better word) flabbiness that wasn’t there before.

Several years ago a local personal trainer - whose Zumba class I was attending - suggested I consider working in fitness: he needed an assistant trainer for his studio and he wished to hire someone who wasn’t already polluted by all the incorrect information and techniques in the fitness industry, someone he could train himself and trust with his own clients.


And thus began my life in fitness. I learned a lot from working for someone else in the beginning,
including what I would and wouldn’t do with clients of my own. I did many things wrong and many
others right, and I learned from all. In this time I discovered I really like lifting weights and how doing so gives me a sense of challenge and accomplishment like nothing else. At the same time I began exploring with other areas of the health and wellness industry, trying to find my true calling. I gave mountain biking a fair try (not for me), I gave swimming a shot (just... no.), I tried endurance running (never again), all while wondering what was my thing? What was I going to specialize in and focus on in such a vast industry? What if I never found one topic I love and end up just one more anonymous trainer with no specialty to call their own? It was a long process but through lots of exploration and patience, through understanding that I don’t have to be an expert at everything or love every fitness practice, and by keeping an open mind it was that I eventually landed on what became my thing: Sports nutrition. 


I can tell you one thing-- the sun shines bright when you find your place.

So if I can give you one piece of advice today it is this: Play. Explore. Go out with the goal of making a fool of yourself and revel in the joy of laughing at your own expense, because in pushing the boundaries of responsibility and composure a wonderful world awaits you; one in which you can find the things that make your heart sing.

Welcome to your place.

Carolina can be found on:
Facebook: https://www.facebook.com/sweatglow 
Website: http://sweatglow.com