@DevOpsSummit Authors: Yeshim Deniz, Stefana Muller, Elizabeth White, Liz McMillan, Pat Romanski

Related Topics: @DevOpsSummit, Java IoT, Agile Computing

@DevOpsSummit: Blog Feed Post

Who Is Responsible for “Good Code”? By @daedtech | @DevOpsSummit #DevOps

Typically, managers will rely at least in part on results and observable behaviors

Who Is Responsible for "Good Code"?
by Erik Dietrich

A few weeks back, I wrote a post about getting ready to address a coworker's bad code.  This sparked some conversation across various media, including the following interesting question:

...seems that there is a breakdown in managing the development process. Why is Bob allowed [to keep] writing bad code?

Measuring Developers
This feedback is interesting enough to merit a blog post in and of itself. I recognize a question that cuts to the heart of a software development conundrum when I see it.  The structure of most organizations that employ software developers is this: the developers responsible for code report up through a structure of people that don't.  To put it another way, the people responsible for personnel management usually don't understand how to evaluate the work of those reporting to them - at least not directly.

Even if people with titles such as "Director of Software Engineering" or "Development Manager" had been developers at some point, asking them to perform code reviews isn't a solid approach.  It wouldn't scale well.  Imagine asking someone to do detailed code reviews with seven or eight people while also doing all of the other things a manager is required to do, such as budgeting, dealing with other departments, worrying about software licensing, etc.  And that's even assuming they're technical. Most managers have to squint pretty hard into their rear view mirrors to see the last time they wrote a lot of code, if there ever was a time.

Typically, managers will rely at least in part on results and observable behaviors.  Does the developer keep long hours?  Does the developer take one for the team?  Did the developer heroically work 90 hours last week to get the code out on time?  Did the developer fix a lot of bugs, or better yet, write code in which not a lot of bugs were reported?

All of that sounds reasonable until you think of technical debt.  "Technical debt" is a term that describes a trade: when you take shortcuts in the code in order to ship today, it's at the cost of having a mess when you try to ship down the line. For a great visual of this, imagine a child tasked with cleaning his room who simply stuffs all of the clutter and food debris under the bed.  In this light, the very developers that managers view as effective may be writing awful code and making a mess.  Tired developers, working 90 hour weeks, are almost certainly thrashing in a tech debt cycle - making heroic efforts to overcome problems that they created in the first place by making a mess.

It's hard for a manager to make any form of direct evaluation, even when it seems as though there are easy ones to be made.

Metrics to the Rescue?
Okay, so they can't make direct evaluations.  What about indirect ones?  Well, those are tricky as well.  One of the most common traps for software management, particularly if it's not terribly mature, is the allure of metrics.  Perhaps you've heard calls for a team build that reports unit test coverage, method size, or cyclomatic complexity?  If a manager could get access to those statistics, the reasoning goes  he/she could know who on the team was writing good code and who wasn't.

Be careful what you measure.  It's possible to achieve a high degree of unit test coverage by writing test methods that don't assert anything.  You can keep method size under control by having classes with thousands of tiny methods.  Perhaps the most iconic example of unintended consequences for measuring developer productivity is the mountains of terrible code that resulted from managers, at one time, trying to measure developer productivity in lines of committed code.  Metrics are tempting for managers, but there be dragons.  Relying on metrics to measure developer effectiveness has not historically been a path to success.

Measurement via Human?
If the managers who make personnel decisions can't rely on themselves to evaluate developers and they can't rely on machines to do it, what choice is left?  Clearly, they're going to have to turn to other humans to do this.  Common patterns that you see are the appointment of a trusted advisor in the form of someone with a title like "Architect" or "Tech Lead." Or perhaps they take a more egalitarian approach, like having the developers perform peer reviews or pair program.  In this fashion, the manager delegates evaluation to people in a position to do it, and she uses the information they furnish to make decisions.

This is a familiar pattern, and I imagine that you might be nodding right now.  But, going back to the original question, what if Bob-the one checking in the bad code-is a senior team member or even the architect?  Think it's not possible?  It happens all the time.  Check out the popularity of this post, describing a phenomenon many people seem to identify with. A manager trusting an advisor will introduce one check and balance, but it's hardly foolproof.  It gets better when there is regular peer review and pairing.  More checks, more balances, more eyes, and more voices.

But guess what?  If we eliminate all evaluation options for managers with the exception of presiding over a team with extensive peer review, we're back to square one.  It's going to be up to a member of the team without any authority over Bob to let Bob know that he needs to improve his code.  It's going to take conversations, persuasion, and collaboration, as opposed to management cracking the whip and sizing people up.

In the end, there's only one reliable way for management to ensure that there aren't Bobs out there, writing bad code indefinitely without feedback.  They need to create a collaborative culture of positive feedback and trust so that the team of humans they're managing take care of one another and spur each other on toward improvement.  Bob's bad code is the team's bad code, not management's.  And the team, not management, needs to own the code.

Read the original blog entry...

More Stories By SmartBear Blog

As the leader in software quality tools for the connected world, SmartBear supports more than two million software professionals and over 25,000 organizations in 90 countries that use its products to build and deliver the world’s greatest applications. With today’s applications deploying on mobile, Web, desktop, Internet of Things (IoT) or even embedded computing platforms, the connected nature of these applications through public and private APIs presents a unique set of challenges for developers, testers and operations teams. SmartBear's software quality tools assist with code review, functional and load testing, API readiness as well as performance monitoring of these modern applications.

@DevOpsSummit Stories
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
As Cybric's Chief Technology Officer, Mike D. Kail is responsible for the strategic vision and technical direction of the platform. Prior to founding Cybric, Mike was Yahoo's CIO and SVP of Infrastructure, where he led the IT and Data Center functions for the company. He has more than 24 years of IT Operations experience with a focus on highly-scalable architectures.
Traditional IT, great for stable systems of record, is struggling to cope with newer, agile systems of engagement requirements coming straight from the business. In his session at 18th Cloud Expo, William Morrish, General Manager of Product Sales at Interoute, will outline ways of exploiting new architectures to enable both systems and building them to support your existing platforms, with an eye for the future. Technologies such as Docker and the hyper-convergence of computing, networking and storage creates a platform for consolidation, migration and enabling digital transformation.
An edge gateway is an essential piece of infrastructure for large scale cloud-based services. In his session at 17th Cloud Expo, Mikey Cohen, Manager, Edge Gateway at Netflix, detailed the purpose, benefits and use cases for an edge gateway to provide security, traffic management and cloud cross region resiliency. He discussed how a gateway can be used to enhance continuous deployment and help testing of new service versions and get service insights and more. Philosophical and architectural approaches to what belongs in a gateway vs what should be in services were also discussed. Real examples of how gateway services are used in front of nearly all of Netflix's consumer facing traffic showed how gateway infrastructure is used in real highly available, massive scale services.
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities - ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups.