8/27/2015

Quality Testing Is The Best Investment

There's no doubt in any software engineering practice that spending money on the quality of the product has to happen. After all, a feature that doesn't work the way it's supposed to, or just flat out doesn't work at all, really isn't a feature at all. And, hopefully at the very least we won't write code into our systems that cause the systems to crash entirely. That would most certainly destroy customer trust. We have to have quality in software, whether we work for internal engineering departments or whether we're marketing software as a product. Games, productivity tools, health tracking tools, and all kinds of other software depend on software to remain profitable. Instead of thinking of quality as expensive, we need to think of it instead as the much less destructive cost than a customer finding a failure in quality. This article does a pretty good job explaining why it's much more expensive to fix a bug the later in the process it's uncovered. Quality isn't an expense. It's the most critical investment you can make in the software portfolio you offer. There's two kinds of investing testing I want to cover, and their related components. Interactive testing and automated testing.

Interactive Testing

There's several different phrases or quotes that all have the same general acronym in them: QA. For example "has QA tested this yet?" or "What did QA say about the latest features?". In general when we talk about "QA" we mean our team of interactive testers. This is a group of people with a test lab of hardware where they exercise the software by inputting all kinds of nonsense (and valid input too) to make sure that when gremlins hit the software, it won't implode. They have requirements and acceptance criteria, build test suites, and make sure that when Joe User opens the application they don't immediately close it again. No matter how good your automated test suite is, we always need interactive testing to verify that, as human beings, the software behaves itself.

What makes this a good investment? Well, first of all when you have a strong interactive testing team they will build automated tests out of the manual tests cases that they have created. Then, going forward, you have the ability to plug in regression analysis into your continuous integration build that includes testing that happens very close to the user's reality.  For web applications (my wheelhouse) we usually use a tool such as Selenium to drive these interactions.

Automated Testing

Unit / Functional / Integration Testing

There's plenty of people way smarter than me that have taken the time to address the ratio of unit vs. functional vs. integration testing in your testing suite. My main goal is to get unit test suites that do a great majority of the testing of each class and method within a class. When I talk about these kinds of tests in general, what I mean by this is tests that can be run by some combination of a test harness (jUnit/CodeCeption/nUnit) and some kind of dependency injection container (Spring/Symfony/vNext). When you're writing pure unit tests, the DI containers should not be initialized by the test harness. For some functional tests, and definitely for integration testing, it's important to ensure that the proper usage of the objects placed into the DI container is correct. For the most part, the highest bulk of automated test harness code should be unit testing that mocks away any dependencies it requires. Prevention of repeated regression is the main and most obvious benefit that comes from testing created in a test harness. Furthermore, with a proper test harness production bugs can follow this workflow: verify bug->reproduce bug using test harness->make red test turn green by refactoring. By using this workflow, you assure yourselves that, as far as regressions go, one less will take place. Now, instead of making it into QA or out to the client, your automated test can inform you immediately upon check-in if any new code violates an existing test.

Performance Testing

Applications have to be fast. According to Microsoft research, Goldfish do a better job of paying attention to one subject than human beings do. You have 8 seconds (or less) to ensure you're delivering the right value to your customer. Otherwise they're going to context shift and look for something else more interesting to pay attention to. 8 seconds. To load the most critical insights on thousands/millions/billions of data points. If you don't think performance (or perceived performance) matters in your application - you're going to end up regretting it. People will stop paying attention to it, and then you won't have customers to work for any more. 
Source: Microsoft Attention Span Research

Penetration Testing

Ignoring security implications of software seems to me a bit like sending a cow out into an alligator infested river and expecting it to make it safely to the other side. Read the news. You'll see what I mean. After all, one of the many critical aspects of quality is security. Many software industries can even get into significant legal trouble if the software doesn't properly protect its users. HIPAA protects health records. FERPA protects education records. Imagine if you worked for a company making one of those kinds of software, and sensitive data got out. At that point your company's reputation has been tarnished to a point where recovery will take a very long time, if you can even recover at all - and while you're working on spending a ton of money trying to repair the damage, you also have legal regulators to contend with. The expense of a security breach cannot be ignored, just ask Target. The cost of implementing the best security measures we can on the outset hardly seems like any kind of expense at all when you compare it to the risk of not raking security seriously. How much more likely is it Target wouldn't be in the public's cross-hairs if they had spent $148 million dollars on a security improvement initiative? And they'd have a reputation that didn't include "don't use your credit card to shop there."

Peer Reviews are Critical Too

In essence, the fastest way to get quality is to have someone sitting over your shoulder watching you write every line of code you're writing to get a feature out the door. This assures two things: 1) no one person has all of the knowledge about a given feature 2) the person writing the code will write differently because they know they're being reviewed in real-time. Pair programming gives us the opportunity to have a pilot/co-pilot pattern to work from. But, it's very hard to implement practically - and also very expensive, because you have to have "twice as many" engineers to get the software into production. But - with twice as many engineers, the likelihood of regression happening from any one given check-in goes WAY down.

8/26/2015

Guest Blogger - Outlier Developer

I'm lucky enough to get to be a guest author here:
http://www.outlierdeveloper.com/strategies-for-content-consumption/

Let me know what you think of the article. Thanks to Cory for letting me write it!

8/20/2015

Should I Hire A Mechanic?

Wait, what?! How in the world is answering a question about fixing your car in any way, shape, or form related to making money as a software engineer? Bear with me. I'll get there. As a quick answer to the question though, I got inspired to write this because I had to replace the blower fan in one of my cars. Part cost $80. Labor was free because I provided it.

The reason I'm including this on my blog actually relates more to scarcity vs. abundance mindset than anything else. See, I know I'm currently in a position where the scarcity mindset is dictating at least some of my actions. Since I'm a salaried employee (or, as John Sonmez would put it I only have one client) I am not currently earning income doing "other things." This means that instead of hiring a mechanic at $60 an hour, give or take, it's a better ROI for me to actually do the repair work myself. Until such time as I'm actively earning at least $60 an hour for anything I do - it makes sense for me personally to repair the car myself - at least when I can do so easily.

So, for me right now the calculation is pretty easy. Assuming (as a best guess) it would have cost $300 parts and labor to repair the blower motor in my car, and also knowing I spent $80 on parts and then the time for installing the part, I can figure out how much value I got out of my time. $220 saved, 2 hours used up. So, effectively my hourly rate during this time was $110 per hour. Until such time as I have a "side gig" or additional client where I can earn more than $110 per hour (yes, this is entirely possible and absolutely a goal of mine) it still makes sense for me to fix my own car. And while this example has practical application since I just did this car fixing today - it also applies metaphorically, too. Before you decide to do anything related to your checking account balance or slapping a charge on your credit card - decide if it's worth it to seek a financial alternative.

Clogged toilet? Should you call a plumber or go buy the right kind of auger to clear it? Ultimately that's your call, but if you go buy the auger then you have an auger the next time you need one. Unless of course you're happy to lay out a hundred bucks because your kid flushed his toy <thing> down the toilet.

Get a barber/stylist to cut your hair or do it at home? Again, it depends on how much value you put on your haircut and how good you are at cutting your own hair.

Stop working, or hire a nanny? There's more than economic impact to consider on this one, the social and psychological implications have a non-monetary benefit that's pretty hard to put a dollar value on. But if you look at it simply from an opportunity cost standpoint, if your ONLY using dollars to measure what you should do, then hiring a nanny is a better choice if you're making big bucks at work. Again, I'm not suggesting everyone in the world should just drop their kid with a nanny and go get a job. I'm just saying that if you think of it in terms of financial net gain, all other variables being a non-issue, you have to weigh the cost of doing a thing with the revenue you're losing by doing it yourself instead of having someone else do it.

Every service in the world has an opportunity cost. If you're installing a blower fan in your car, you're not working on an app, or a blog, or a bug-fix, or an open source project. Nobody but you can decide what the most valuable way to spend money is for you. Just remember the next time you're considering rolling up your sleeves to do it yourself, make sure it's really the right way to spend that time doing it. Otherwise, hire an expert and go spend time doing expert things you really love doing.

8/13/2015

How Do I Win?

Do you know how to expand your pie?
Soft Skills Quiz: Week 3. The statement made as item 3 on the quiz: I feel confident in my ability to interview for a job, ask for a raise, and negotiate a job offer. That last part is really kind of asking, how do you come out ahead or "win" when talking to a manager? I'm going to concentrate on the negotiations part of this question, because it's worth a whole post by itself. The best way to make this happen is to also ensure the manager wins, too. 

There's several different ways people define winning. In the case of this blog, what I mean by winning has a pretty simple definition - winning means more money in your wallet. However, in order for you to win, you have to make sure that your current employer (or potential new employer) also knows they win by hiring you (or giving you a raise).

In management school, the concept of "expanding the pie" is one of the core things that we learn when talking about negotiations. While a somewhat silly sounding phrase, it carries with it a fair bit of good knowledge. When you talk in real dollars, expanding the pie simply means thinking about your compensation in terms of things other than salary. If your boss/new employer has reached a cap in terms of salary they can offer, perhaps instead they can offer you more vacation time, or find a way to reduce your portion of benefits you have to cover. Maybe you can convince the person you're talking to that working from home would have great benefit for both parties. What I mean by this is, if you work from home, maybe you can promise to your new employer or current boss that you'll work during half of the time you would have spent commuting. You get more time at home. And your boss gets more work hours out of you.

Another term for this comes from a book I recommend frequently, The 7 Habits of Highly Effective People. The habit I'm referring to is to "Think Win Win." Instead of playing a zero sum game where you come out ahead and the manager loses, or you lose and the manager comes out ahead, find ways for both of you to benefit from the end result. And don't just think in terms of money. Think of growth opportunity, title, team, department, telecommuting, vacation time, and many other things that don't have fiscal value, but definitely have tangible value.

Unfortunately, sometimes you'll find yourself in a position where the person you're talking to doesn't understand how to play the game where both people win. If you find this to be your situation, you need to be sure you're bringing to the table a BATNA. Yep, another one of those silly business school terms. BATNA is just an acronym for Best Alternative to a Negotiated Agreement. What this really means, more than anything, is that you have to have the willingness, and ability, to walk away. If you're negotiating salary with a new potential employer, your BATNA, at the very least, is your collection of current salary and benefits. If the new employer cannot match what you're currently earning, unless the non-monetary benefits of getting hired at the new place out-weigh the monetary ones, you can walk away. In my experience, if you tell a hiring manager "I'm sorry, but that's not good enough" they're going to try just a little harder to up the ante. Which works out in your favor.

Another important and often overlooked aspect of negotiations with a job offer is to set clear expectations right at the beginning, even when the interview is starting out. You want to be as transparent as possible going into the interview process about what you're expecting the manager to accomplish on your behalf in order to make it so you're willing to shift into a new career.  If you feel like working the new job is worth $100 thousand a year, and you're worth it - say so. If you don't, you may go through the whole process to find out that what they're hiring for doesn't come anywhere close to your expectation. It's a waste of your time and theirs if your expectations don't line up to begin with. So be clear about them - but be careful, too. If you say "I think someone in this job should earn $100 thousand a year" - guess what, they're going to offer you $100 thousand. Instead, something like "I've done market research that suggests people in this position earn between $85 thousand and $135 thousand. Does that match your expectations?" Now you've given yourself a pretty good field to play in, so when the job offer comes in a little too low you can talk about moving it towards the upper end of that range.

There's all kinds of literature out there about negotiation tactics and how to make sure the negotiations go as well as possible in your favor. While my tips about BATNA and expanding the pie offer a good glimpse into how negotiations work, I'd strongly encourage you to scour the internet (or a bookstore/library) for resources on the subject. It's a complex and multi-faceted skill, and one that plenty of research has gone into perfecting. That way you can win, too.

8/06/2015

How Do I Play Nicely With Others?

Soft Skills Quiz: Week 2. The statement made as item 2 on the quiz: I always seem to get along with my co-workers and clients, even when we don’t agree. On the page John wrote, he suggested a book How to Win Friends & Influence People by Dale Carnegie. This is great - I think it's important to have a lifeline manual about how to talk to other people. I think it's especially important to focus on talking to people that you generally disagree with or - even worse - don't like at all. However, if you don't really have time to read an entire book right now (actually - I'm going to point to one more) - I'll provide a few of the highlights that work really well for me, when I'm doing a good job being cognizant of them.

  1. Practice active listening. Do it ALL the time. I mean, always. Practice with your wife, your child, your dog (OK, maybe not the dog) and anyone else you encounter. It's especially important to practice active listening in very high stress situations, but it's hard to remember to do this when you're adrenaline gland is pumping. So do it even when you're totally "zen". 
    • Guy dinged the fender of your brand new car? Listen to him, maybe he was up all night with a teething baby. Give him a break, that's what insurance is for after all.
    • Been up all night with a teething baby? Listen to your wife, she might open up to you about how frustrated she is to be losing sleep too.
    • OK, so here's one that's not related to my home life - the product owner changed the requirement/acceptance criteria you just promoted to production? Again? For the third time? Listen to the product owner, there's a better than average chance they can point to market research that explains why the feature works better the new way. They're probably frustrated too, because they've had to write new acceptance criteria. Empathize with that frustration, then get to work.
  2. #1 is a dictionary definition of one of the core concepts in Stephen Covey's The 7 Habits of Highly Effective People (oh, great, more reading homework!), One of the tenets of the book - Habit 5 - states "Seek first to understand, then to be understood." If you don't take the time to get to know the perspective of the person you're dealing with, you'll have no ability whatsoever to influence that perspective to more closely align with yours.
  3. Watch your body language, and theirs. Pause and imagine what you look like if you have a mirror in front of you. Are your arms crossed, is your face terse? You're likely coming off as combative and unwavering, and it's going to stop people from wanting to talk to you. Consciously work to put your hands in a more relaxed position. And if you really want someone to feel included in your conversation, purposely point your feet at them. And make eye contact. There's plenty of research material that proves body language has WAY more pertinence than written or spoken language. So use it to your advantage, and watch what other people's bodies are telling you even if they don't realize it.
  4. Which, of course - brings me to my next point. Smile, genuinely. Smiles are contagious and you can hear them in someone's voice, even if you can't see the person. If you actively smile during a conversation your positive attitude will rub off on other people too.
  5. Deal with toxic coworkers as soon as you possibly can. Seriously, they're not only going to bring you down, they're a drain on the entire team. It's one thing to have different perspectives from other people and to set them aside in the name of your team's mission. It's another thing entirely if someone is actively reducing your capability to pursue that mission. If you're the manager, correct or cut ties. If you're not the manager- get the manager to do so. Use all of these tools to help the manager understand your concerns. Otherwise your next active listening might be with a recruiter because things will continue to deteriorate if the situation doesn't resolve quickly. Toxic coworkers come in many flavors. Know how to spot them and know how to talk to management about them.
I'm sure I have other little things I do that keep the dysfunctional relationships at bay, in the office. I've had plenty of coworkers who really got on my nerves for one reason or another - but at the end of the day it's not my job to like them. It's my job to maximize value and productivity for my company and my team. Communication differences and personal preferences aside, the best interest of the company comes first. As long as they're not actively pursuing a negative path, professionalism has to win.

JSON Jason