On Engineering Consensus

The main reason science works is, of course, the scientific method. It forces rigor into the process and it’s what began to fork hard science from philosophy. Engineering, while not a science per se, is a sibling discipline. It too benefits from the scientific method (though more so in the realm of testing) and the engineering method is similar:

ScientificExampleEngineeringExample
1Ask a question“Does fire destroy matter?”Consider a problem“How can I seal a container?”
2Form a hypothesis“Burning stuff in a sealed container should tell us”Design a solution“Maybe putting silicone on a jar lid will do it”
3Make a prediction“If the container weighs the same, the matter just turned to gas”Implement the solutionPut the silicone on the lid
4Run a testBurn some stuff in a sealed containerRun a test Burn some stuff in the sealed jar
5Analyze the resultsSee if it weighs the same or is lighterAnalyze the results See if any smoke got out, and if there were any bad side effects, like melting

We can generalize them both to something like:

  1. Have an idea
  2. Figure out what to do about it
  3. Do that thing
  4. See if it worked

In any case, they’re related. And one overlooked aspect of science is that it’s not all that cut and dry. Rare is the experiment that produces unequivocable results that are obvious to any layman. Lavoisier’s experiments on the conservation of matter seem straightforward to us now, but the test could’ve been wrong in a lot of ways: the sealed glass vessel could’ve had a microscopic leak, the scales might not have been sensitive enough to detect that some matter was destroyed, and Lavoisier himself could’ve had his finger on the scale!

Antoine Lavoisier

This is why science relies on not just the method, but equally so, also peer review. Other people had to read about Lavoisier’s experiment or maybe observe it in person. People that were experts enough in the field that they understood all of the details about creating a sealed vessel and about the accuracy of scales and other aspects of the experiment. And eventually, other people recreated his experiment and got the same result, and only then was the scientific consensus attained that no — matter cannot be destroyed.

Good science works because regardless of the prestige of the scientist or the seeming quality of the experiment, the certification of the finding is independently verified by other experts in the field, peers who know what to look for and what notions to accept as scientific fact.

Good engineering works the same way. Instead of peer review of research papers we do peer review of design documents and pull requests, and if that step of achieving engineering consensus is missing, the quality of the work suffers.

“But,” you say, “the testing will prove the quality of the work!” Except that there’s a fine distinction there: tests will prove that the solution works as intended; it says nothing about how well it’s built. It could be held together by duct tape, it could be an overly complicated Rube Goldberg device that’s impossible to maintain, or it could be a pile of spaghetti that’s impossible to refactor. In engineering as in life, the ends rarely justify the means. And so we need consensus on whether those means are good.

Cosensus is a tricky thing though. I dread submitting my code for review, even when I’m very happy and confident with it, because I know there are things I might have missed, and as much as I want to embrace learning from my mistakes, I really don’t like to make mistakes. However, when certain smart, experienced people are on vacation, I don’t mind it so much, because I know I haven’t made any mistakes junior developers are likely to catch, and I can make a good argument if there are questions on my approaches. But those arguments might not fly past more senior developers, who might have insight that I’m lacking and the experience to know what works and doesn’t to back their stance with.

So it’s not enough to just get the consensus of any two people: for quality consensus, it has to be two (or more) of your peers. Developers operating on your level or higher, who not only have the general experience and skills to recognize whether your work is good, but also have the specific experience with the surrounding landscape — be it the type of thing you’re designing, if it’s a design document, or the codebase that you’re changing, if it’s code.

And it should be people who aren’t afraid to speak up. Some talented engineers that would otherwise be good peer reviewers might be intimidated by a Bob that’s less talented. Maybe this Bob is higher up the totem pole, or maybe he bullies, badgers, or simply exhausts all opposition.

The choice of peer reviewers should be truly peers. People who are:

  1. Technical equals
  2. Organizational equals
  3. Up for a debate
  4. On good rapport

(That last one is to avoid a situation where Chelsea always nitpicks Bob’s code because she thinks he’s the worst.)

This is a kind of ideal engineering consensus to strive for, and for better or worse, in practice there are two reasons why it wouldn’t happen all the time:

  1. Most teams are small and there’s no equal to the tech lead, either technically or organizationally.
  2. Most things aren’t important enough to spent a lot of time reaching consensus

Which exposes an important point in technical leadership: one of the reasons having good leaders matters is for the times when consensus matters. Good tech leaders have good rapport with the team, they mentor and build expertise in others, they set high standards for excellence, and encourage healthy debates from the team members. Over time, good leadership results in exactly the kind of savy, comfortable team that generates worthwile consensi. Consensuses? Consensi. Please excuse me while I look up the consensus on this matter.

The Best Testers Are Scientists

It doesn’t take long to appreciate a great software tester. And it doesn’t matter if she’s a manual tester or writes automated tests, because what really matters are the types of tests being run: curious tests. Tests that don’t just discover a bug and quickly document it away in a ticket, along with the state of the whole world at the time of discovery. But instead, tests that try to find the exact circumstances in which the bug occurs.

The more defined those circumstances, the more helpful the ticket is to the developer and, ideally, will take their mind right away to the exact function that is responsible for the bug. In those cases, you can almost see the light bulb go off:

Tester: I’ve only seen the bug on the audio configuration screen, and it usually crashes the app after single-clicking the “source” input, but I’ve seen it a couple of times from the “save” button too. And it seems to only happen after a fresh install on Android 10.

Dev: ohhhh! That’s because the way we handle configuration in Android 10 changed and the file the audio source is saved in doesn’t exist anymore!

This is exactly the kind of dev reaction you want to a bug report. It’s an immediate diagnosis of the problem, which was only made possible by a very well-researched and described bug. But notice how that description could, with changes only to the jargon, have been written by an entomologist:

Entomologist: I’ve only seen the bug on a tiny island off the coast of Madagascar, and it’s usually blue with green spots, but I’ve seen a couple of them with yellow spots too. And it seems to only come out right after sunset in the wet season.

Which is kind of obvious when you think about it, because what do scientists do? They test the software that is our reality. Galileo’s gravity experiments is one of the more famous in history (and likely didn’t happen), but what is it, in software terms? He wanted to know if the rules of our universe took weight into account when pulling things toward the Earth. A previous power user, Aristotle, figured that the heavier a thing was, the faster it would fall. But that user failed to actually do any testing. So thank God that talented testers, like John Philoponus and Simon Stevin, came along and figured out that things mostly fall at the same rate through air, and then bothered to update the documentation.

What Aristotle did was assume the software worked in a certain way. Granted that he didn’t have the requirements to reference, but he probably noticed that you have to kick a heavy ball harder to go the same distance as a lighter ball, and he figured that the Earth kicks all things equally hard. That’s the equivalent of our tester above seeing the “source” input work on Android 9 and not bothering to test it on 10. Or seeing that it worked on the video configuration screen and not bothering to test it on the audio one too.

And that’s okay, because Aristotle was not a tester. He was more like a fanboy blogger. But what testers should be, is bonafide scientists, like Simon Stevin, who follow the scientific method:

  1. Ask a question
  2. Form a hypothesis
  3. Make a prediction, based on your hypothesis
  4. Run a test
  5. Analyze the results

In our example with the “source” input, after the tester saw it the first time, she probably did something like this:

  1. “why did it crash?”
  2. “maybe it was because I pressed the ‘source’ input”
  3. “if so, that’ll make it crash again”
  4. Relaunched the app, tried it, it crashed again.
  5. “okay, that was definitely the reason”

Aristotle might stop there and file the bug: “app crashes when using the ‘source’ input”. And the developer would try replicating it on their Android 9 phone and kick the ticket back with “couldn’t replicate”, and that whole cycle would be a waste of time. But our tester asked another question:

  1. “does it crash on this other phone?”
  2. “if it doesn’t, it’s a more nuanced bug”
  3. “I think it’ll crash though”
  4. Tried it on the other phone: it didn’t crash
  5. “what’s different about this phone?”

And she continued the scientific process like that, asking more and more pertinent questions, until the environment that our bug exists in was fully described. Which is exactly what you want in a bug report, because anything less will, in aggregate, be a productivity weevil, wasting both developer and tester time with double replication efforts and conjectures about the tester’s environment and back and forths. A clear, complete bug report does wonders for productivity.

So then, why not just teach all your testers the scientific method? Because it doesn’t work in the real world. We all learn the scientific method, but few of us become scientists. And I imagine that, just like in any profession, a not-insignificant number of scientists aren’t good scientists. Knowing things like the scientific method is necessary, but not sufficient to make a good scientist. You also need creativity, in order to ask the interesting questions, and more importantly, curiosity to keep the process going until it’s natural conclusion — to uncover the whole plot.

Tangentially, curiosity is a hugely important trait in great developers, too. But for testers, even more so.

Software & Opera, Part 3: Design & Test

This is the third and final part of a series on opera and software. Part 1 explained why they’re related, part 2 explained the development process used to produce an opera, and this part explores what can be applied to the software development process.

But first, the disclaimers: I’ve never worked backstage anywhere else, so I don’t know how other opera houses operate — they could be exactly the same, or wildly different. Also, everything in this article comes from my experience, and nothing is from Sarasota Opera — they don’t know I’m writing this (and hopefully, they’ll be pleased if they do ever come across it). Finally, what I do know of the production process comes from years of observation from the sidelines, from the role of a super, so some stuff in here could be just plain wrong; I’ll try to make it a point to underline where I know my knowledge is shaky, but there might be things I’m more sure about than I should be.

Let’s just dive in by recapping the operatic development process using software terms:

  1. The product manager writes functional specs (the libretto)
  2. The architect (composer) writes technical specs (the sheet music) based on the functional ones
  3. Management chooses a reasonable release date
  4. About a year before the release date, development begins on the infrastructure and wireframes (stage, sets, costumes), congruent to the functional and technical specs.
    • The infrastructure may well be sourced from elsewhere, or built in-house — whatever makes the most financial and artistic sense
  5. The main components (principal singers and stage management) are identified
  6. With roughly six months to go, the technical lead (conductor) learns the technical specs (sheet music) backwards and forwards and begins work on the main components (the principal singers)
    • The same as how, in software, the architect and the lead developer could be the same person so in opera, the composer and conductor could be the same person: Verdi conducted the first runs of all of his operas, and so have most composers. But after that first run, their operas are conducted just as well by other conductors.
  7. The UX designer (director) begins fleshing out the UI (choreography)
  8. Development begins on smaller components (auditions for smaller parts, chorus)
  9. Support infrastructure is stood up (props, rehearsal rooms, living arrangements)
  10. Management meticulously schedules acceptance testing (rehearsals), including bug fixing time.
  11. A couple of months before release, major development is done (the choreography, principal parts, sets, and costumes are all largely in order), the infrastructure is in place, and developer testing begins (all cast members rehearse at home)
  12. A month before release, developer testing is complete, and development is largely frozen: the infrastructure is ready, the entire cast is on site, and know their parts and music. Developer testing on the main components has been especially rigorous.
  13. Acceptance testing begins:
    1. The testing phase is the climax of the process. All hands are on deck, for very full days, for the duration.
    2. It takes place in a lightweight mock environment (the off-stage rehearsal room) with mock props and costumes
    3. The mock environment is designed to be easily reset and changed from one test to another, which is not the case for the production environment (the stage with sets)
    4. The architect, UX designer, developers, and management are all present
    5. Each workflow (scene) is thoroughly tested
    6. The testing harness supports starting from any point in a workflow, stopping at any point, and resetting to any point, so that the entire workflow doesn’t have to be run every time, making it possible to easily test every individual feature
    7. The testing harness supports various levels of integration testing, from interaction of only main components with mocked minor components, to full end-to-end testing
    8. Project management keeps track of each test’s outcome against the specs and design
    9. Project management files and tracks enhancement requests and bug reports (changes and corrections to choreography and singing) made by the developers and designers, who update specs and designs as needed
    10. The tech lead and UX designer make tweaks as needed and file bug reports, which are worked on with high urgency
    11. Once the tests are going acceptably well, testing moves from the mock environment and into a real one: the actual stage
    12. More enhancements and fixes are made until the UX designer and developer are happy with the outcome
    13. Beta users (coworkers, friends, early adopters) are brought in for final testing. There are very few, if any, surprises at this point.
  14. The product is released on opening night
  15. A point release or two may quickly follow, with minor changes (in the first couple of performances)

That should all be very familiar, but how does that differ from the process in most software shops? From my experience, it’s the beginning and the end: the design and the testing. Most shops focus on the middle: the development itself, with testing being a necessary evil, and design often being a quick drawing with some boxes and arrows, maybe just in someone’s head.

Don’t Focus on the Coding

The above process takes probably about 18 months, and the first half of it is all design. Main feature development takes about six months, and testing takes half of that again. So a full two-thirds of the process is design and testing — not development. On top of that, at the end of that six months of development, everything is already well-tested by the developers, with unit tests and rudimentary integration and functional tests. Which means that even less of that six months is actually spent on developing features; maybe as much as half that time. Counting that developer testing, we may be looking at nine months of design, three months of development, and six months of testing.

Design

At this point, you may be aghast at the idea of spending less than 20% of a release cycle coding, and 50% of it designing. The important thing to remember is that designing is programming. The difference is that it’s at a higher level, and it consumes almost all of the research time. It’s a more efficient, and more disciplined, approach than starting to code with only a vague plan, and changing direction as problems arise, pausing to learn new technologies, finding the right widget library, and then realizing that the protocol you started with doesn’t support one of your main features as you wrote it, which means going back to the drawing board.

That going back and re-coding, that’s what wastes a lot of time. That’s why the opera has so much design up-front and why a release date isn’t even chosen until the detailed design is complete, and thoroughly understood. And the opera is not alone, because every disciplined engineering profession does the same. I’ve never worked in civil engineering, but I’m pretty sure that every iron nail in a highway overpass is designed and placed before one worker arrives on site. A big design up front — not coming down a waterfall, but rather in a process that is flexible and agile — documented in great functional specs, is the hallmark of the timely and efficient building of anything.

When done well and thoroughly, it front-loads the vast majority of the variability. If you spend the first half of the cycle coming up with a great design, the last half should be an exercise in typing. The great screenwriter Aaron Sorkin said “You have to think about what you’re going to write before you write it”. Software works exactly the same way. The more specific and detailed your thinking, and the design document that comes out of that, the less surprises there will be in the development and testing phases.

This means the design should address gotchas head on: every technology used should be well-understood, it should be vetted to make sure it works like the architect thinks, and the design document should be as detailed as possible, with APIs, flowcharts, state machines and anything else that can reduce risk and variability in the second half of the cycle. Plus, that document should be very readable, and even entertaining, so that the variety of audiences that read it (devs, managers, QA, tech writers, etc) don’t fall asleep doing so.

If I’ve taken one thing away from my opera experience, is that it’s the important of a thorough design up front, in which literally every note is written before a singer is hired.

Testing

If there are two things I can take away from the opera, the second is definitely the outsized scope of testing. At the opera, testing is not only built into every part of the process — from design to development to release — but everyone is also laser-focused on it. Conductors play their music on the piano to make sure it doesn’t just sound good in their head. Singers practice for hours a day with coaches, who you can think of as the developers of singing. They essentially run unit tests all day long, making changes until the output (the voice) matches the spec that is the sheet music.

And once rehearsals start, everything falls in place, for the most part, with ease. There are always changes because a singer turned out to be taller than the director imagined, so he has to be placed further downstage; and three people in the chorus constantly put the emphasis on the wrong syllable of some Italian word they’ve never heard of, so the maestro has to explain Italian pronunciation yet again.

Enhancements and bugs are built into the acceptance testing phase, but they’re assumed to be minor. Easily changed and corrected, with relatively little effort from the developer. You don’t find out that the soprano can’t hit the high note at this stage, because she auditioned long before. You don’t find out that the set design is all wrong, because an intricate miniature replica was built first. If the main singer gets the flu, there’s a cover waiting to step in, having shadowed the singer at every rehearsal. Everything has been vetted, pre-tested, and every contingency addressed so that there are no show stoppers. Even without any changes at this phase, the opera would be good. The changes here are the little details that make it great: a flawless, amazing performance.

To get there, the testing has to happen in design and during development first. The acceptance testing has to involve all the roles in the production. And it has to be properly planned, with ample time scheduled for it, so that its success is the number one priority for everyone during that time.

Conclusion

By now, I’ve been to dozens of operas, many on opening nights, many in the audience and many backstage or on-stage, and I can count on one finger the number of major blunders I’ve experienced. It was about the fifth performance of a production of Turandot, when the king repeated the same line twice. People that weren’t paying attention to the Italian wouldn’t have even noticed, but someone else played the part the rest of the run.

I’ve seen many more small issues, like people dropping prop coins or papers, walking out the wrong exit, or forgetting to take a jacket off. But the lack of issues in general is astounding, to say nothing of the ability to release on time to the day, and on budget, year after year after year. All of that comes solely from the company’s ability to front-load risk, which then lets them plan the release with certainty, and devote ample time to testing and refactoring, so that the final product is an absolute gem.

Software & Opera, Part 2: The Operatic Development Process

This is the second of a three-part series on opera and software. Part 1 explained why they’re related, this explains the process used to produce an opera, and the last part explores what can be applied to the software development process.

Before I go any further, some disclaimers are in order: I’ve never worked backstage anywhere else, so I don’t know how other opera houses operate — they could be exactly the same, or wildly different. Also, everything in this article comes from my experience, and nothing is from Sarasota Opera — they don’t know I’m writing this (and hopefully, they’ll be pleased if they do ever come across it). Finally, what I do know of the production process comes from years of observation from the sidelines, from the role of a super, so some stuff in here could be just plain wrong; I’ll try to make it a point to underline where I know my knowledge is shaky, but there might be things I’m more sure about than I should be.

Pages from an 1859 libretto for Ernani

The stuff that happens early on is what I’m least sure about, because I generally start working on an opera during off-stage rehearsals, which is essentially the “acceptance testing” phase. But from what I’ve gathered, this is what happens before then:

  1. The libretto is written. This is like a movie script and contains the dialogue and stage direction. For most operas performed today, this was written long before your grandparents were born.
  2. The libretto is set to music. The composer takes the dialogue (and the gaps therein) and creates music that sounds nice to people who like operas. Again, this has usually been done at some point in the 1800s, but even for new operas, it would be at least somewhat before anything else happens. And now you have an opera — at least, on paper.
  3. The opera is slotted into a pre-existing Friday opening, about 18 months in the future. By the time one season starts, the next season’s roster of operas and their exact release dates have already been made public.
  4. Set and costume design are started. This is one of the longest phases, because a set may have to be created from scratch, and sets are big and can get complex. They actually take up most of the backstage area. Renting them is an option, if the size and shape of the stage is pretty standard. Costumes also may have to be made — sewn in the opera’s costume shop — but sourcing ready-made ones is time consuming too, since an opera with a full chorus and a bunch of settings could easily require over 50 costumes. And sizing is a thing to deal with on top of it all.
  5. About a year before opening, the principal singers and stage management are hired and contracted for the work, which actually starts some months later. There are usually about six principal singers and maybe a couple of more minor roles.
  6. The conductor starts learning the music and hires the orchestra.
  7. The director starts choreography design, figuring out what happens in each scene: where, when, and how people enter; what path they walk; how they act, what they physically do; and where, when, and how they exit the stage. Some of this is dictated by the libretto, but most is not.
  8. A couple of months later, general auditions take place for the chorus, which is about two dozen people.
  9. A few months before opening, props start to be created or sourced: swords, treasure chests, torches, faux violins. The set and costumes are done, but not tailored.
  10. The rehearsal schedule is completed — for two full months of rehearsals. Since four operas are being produced at the same time, only parts of each opera are rehearsed in each session (usually one particular act or scene), and rooms and the stage have to be scheduled so that rehearsals can happen in parallel. Also, the chorus usually appears in all four operas, so the scheduling has to take into account that they can’t be in two places at once.
  11. A couple of months before, the cast is all set and the various design work is mostly done. The cast starts rehearsing the music on their own.
  12. About one month before, the cast arrives on site (they come from all over the country, and internationally) and rehearsals actually begin.

This is the point where I enter. By the time of my first rehearsal, the principal actors have been rehearsing for weeks, and the larger chorus for some days. Principals have something like 10x the stage time as the chorus, so they have a lot more to work on.

The rehearsals early on are held in a large rehearsal room instead of the stage, to minimize labor costs associated with setting the stage. Instead, the floor of the room is marked with tape outlines of the sets, with different colors indicating different scenes. So Act 1 might be in red tape and outline some stairs and a couch, while Act 2 might be in blue tape and outline the same stairs, plus two doors and a table with chairs. When you rehearse Act 2, you walk around the blue tape and ignore the red tape.

There are generally a lot of new people, so everyone gets a name tag in the beginning. In each rehearsal, in addition to the performers, the conductor is present, along with a pianist, the director, a stage manager, and two assistant stage managers: one for stage left, one for stage right. Principals all get cover singers, to put the bus factor at 2, and their covers are also there.

Since the choreography is already designed by now, the director tells everyone what’s going to happen in the scene. No one is in costume, except principals might wear something a drunk person might think is their costume, to get used to walking around and singing with, say with a sword or a heavy coat. The singers have already memorized their music, and performed it in front of a maestro and gotten notes on what to change.

An important thing to understand is that everything in an opera is cued by music, and the music is cued by the maestro. She moves her baton at a certain tempo, and all of the singers and orchestra musicians keep that tempo. When she stops, they stop and when she starts, they start. If they start to lead or lag her, she stops and yells at them. “Can everyone see me? Can you, Jeremy? Because if you can, why are you half a measure behind?” The conductor is essentially the system clock, for a multi-processor system. Or maybe an NTP server.

Because of this, the cast’s actions are also cued by the music and it follows that the director’s directions are usually given relative to some piece of music: “when Isabella gasps, you three move upstage, and you go put your hand on her shoulder. Then, on the beat after ‘da dada da dun’ everyone but the Don exits the stage. Ok, let’s take it from two bars past 62”. It’s amazing to me that the singers can start from any part of the entire opera, with a second’s notice.

Stage management keeps a giant binder with the sheet music for every role and marks where in it things are supposed to happen — like stage entrances and exits. After everyone verbally understands what’s supposed to happen, we run that part of the scene, with piano music. Here usually, someone omits doing something — walking somewhere, facing someone, fake laughing — something got forgotten or misunderstood in the space from the director’s mouth to the cast, so we reset and run again. Sometimes, the director, having seen it run with actual people, decides to change where people stand or face or who they fake banter with, so we reset and run again. Later, when we rehearse on stage with the actual set, sometimes things are tweaked even more. And if the singing is off, the maestro stops the music, yells admonishments, we reset and run again.

Once the director and maestro are happy with the way things are running, they layer in any additional people in another rehearsal. For example, sometimes we have rehearsals just with the supers, or the supers and chorus but not principals, for various scheduling reasons. And when everyone knows their parts well enough, they’re all brought in to the same rehearsals.

The off-stage rehearsals are generally splayed over three weeks, with each scene being rehearsed about three times, depending on the complexity. Once in a rare while, things might be going so poorly that they might add rehearsals; as an unpaid volunteer doing this for 20 hours a week on top of your day job, that’s what you really don’t want.

Finally, it’s about three weeks before opening, and we get to rehearse on-stage! There are only a handful of rehearsals left at this point, but most of them are of the entire opera, start to finish:

  1. A couple of rehearsals with only the piano accompaniment still
  2. A piano dress rehearsal — meaning still only the piano, but full costumes for everyone, though only principals get makeup
  3. A rehearsal with the orchestra but no costumes
  4. Finally two full dress rehearsals with the orchestra.
    • These last two are run exactly as if they were live performances, with beta testing users being brought into the audience, in the form of friends, family, and big shot donors.

During these on-stage rehearsals, the lighting people are also testing the colors and intensities to make sure they create the proper environment and mood, the costume and makeup designers check to make sure everything looks good from the audience, and the director walks around the whole opera house to make sure various vantage points can all clearly see the important action.

For the last rehearsal, they generally bring in a couple of classes of middle or high school students, and again: they’re run exactly as they will be on opening night, with PA announcements, supertitles, intermissions, curtains, etc. — even the bows at the end are rehearsed. The only differences with respect to a real performance is that the conductor might still stop the music if things are going too wrongly, she gives notes to the orchestra at the beginning of each act, and the director hovers around the whole house looking for final tweaks to make.

After opening night, things are mostly on rails. The director might issue notes with small things the cast is doing wrong or she’d like to change, someone might need musical coaching if they’re too loud or soft or whatever, but by and large everything is set at that point, and it all just manifests like a clockwork for a dozen performances. That is actually the inflection point for when it gets really boring. After the jitters of opening night, it all becomes so routine that there’s not much excitement in it anymore — but that’s good, because then you can finally focus on the performance.

In the next and final part, we’re going to talk about how all of this applies to software development.

Next: Software & Opera, 33 1/3

Software & Opera, Part 1: The Music, Not The Browser

Over the past decade, I’ve done eight seasons with the Sarasota Opera. The usual reaction I get is either “Wow, I didn’t know you could sing!” or “I could totally see you as an opera singer!” I’m never quite sure if that second one is meant to be a compliment, but in either case: I can’t hold on to a note any better than to a cat. So instead of a Pavarotti-type, I’m what’s called a supernumerary, which is Latin for “extra numbers” — a non-singing extra, normally just shortened to “super”. (Because I’m male, they usually refer to me as a “super man”, which is awesome.) Also, Sarasota Opera is a very professional house — which is actually the reason for this essay — and only hires phenomenally qualified singers, who’ve formally trained for years. I, on the other hand, still haven’t figured out what a “clef” really does.

My parts are usually some kind of guard or soldier off in the background, my only reason for existence being to underline the importance of other people by escorting them on and off stage — or because they’re prisoners. Sometimes the parts are beefier, like a very cool executioner in the degradation scene in Jérusalem, or a nimble thief that scales the wall to kidnap Gilda in Rigoletto. My last role was a guy in a band in La Wally, faux-playing a faux-violin on top of a table, while trying to keep time with the actual violins in the orchestra pit, during a lively party that, of course, ends in disaster.

La Scala of Milan

At this point, you might be thinking “this is neat and all, but what does it have to do with software?” — and that’s a perfectly valid thought. The answer is that over these long years, I’ve noticed some very interesting parallels between the production of an opera and the production of software.  From my first day there back in 2010, Sarasota Opera amazed me with its clockwork precision, streamlined efficiency, and amazing courtesy and professionalism toward everyone, from principal singers, to lowly supers. And every year but this one, they deliver five operas: all on-time (same Friday every year), all impeccably sung, directed, and designed, generally getting great reviews, and involving a crew of several dozen people over a timeline of more than a year.

Can the average software company make the same claim? Apple and Google can: iOS and Android are released on a yearly cadence, like clockwork, and for the most part, they are masterful works with serious bugs being rare. However, in my experience, most other software releases are late and buggy. They’re probably buggy because they’re late and were rushed out the door, and they’re late because things didn’t go according to plan. So how does the opera — in essence a small, non-profit business — stay on plan and deliver such consistent and high quality results? What parts of that are and aren’t applicable to software development? And how much does the operatic world even have in common with that of software?

To answer the last question first, a lot:

  1. Both follow the same process: design, development, testing, narrow release, wide release
  2. Both produce highly technical works of art. Music, orchestration, choreography, and stage production are all, of course, highly technical. And if you don’t think software is a work of art, just think about how important good design is to user adoption.
  3. Both have audiences that are intolerant of bugs
  4. Both are staffed by highly trained professionals
  5. Both have administrative staff managing “the talent“, plus support staff making everything actually work.
  6. Both have the same constraints: deadlines, budgets and headcounts
  7. Both require a great deal of planning and design in order to be done well
  8. Both have a number of specialized departments that work in concert (pun intended): developers, testers, DevOps, ProdOps, UX, and product management on one side vs singers, orchestra, props, costumes, makeup, lighting, set design, and stage hand, on the other.
  9. Both have hundreds of components interacting with each other, even in parallel. Opera is generally massively parallel, especially if counting the orchestra.
  10. Both are run from compiled code: musical notation is conceptually the same thing as binary code, with each singer or musician being the processor that executes the instructions for their particular role

There are more, but ten is a nice round number. And hopefully the reason this essay exists makes more sense now. If you’re still keen, the next part talks about how an opera is produced and finally in the third part, what can be applied to the software development process — which is that projects should focus on design and testing, rather than coding. Oh wait… did that just spoil the ending? Because if not, you should also know that the other two parts are much longer, too.

Next: Software & Opera, Part Deux

Setting Up Ubuntu For Android Development, 2015 Edition

At work I use a MacBook Pro because that’s what they give us. At home, my desktop is Windows because of Windows Media Center and gaming, but I also recently rescued a Dell laptop that now has Ubuntu on it. While setting up that laptop for Android development, I ran into a couple of gotchas and found some shortcuts; so when I set up a new VM for a new project on my desktop, I decided to document the steps for reference.

To wit, at the end of the following procedure, we’ll have Android Studio running on Ubuntu 14.04.3 (Tired Trampoline) on VirtualBox 5.0.10. If you need a lighter VM, these instructions also work with Lubuntu.

  1. Download VirtualBox (for this guide, 5.0.10), if you don’t have it
  2. Set up a new VM
  3. Download the Ubuntu Desktop ISO (for this guide, 14.04.03)
  4. Load it into the VM’s optical drive, boot up the VM, and start the install
  5. After answering the setup questions in the beginning, go watch TV for a while
  6. When it’s done, eject the install ISO from the VM and reboot
  7. It’ll boot up in glorious 640×480 mode; insert the Guest Additions CD image, to do stuff like allow you to use a decent desktop resolution:
    VirtualBox Guest additions disc

    • A dialog will come up allowing you to automatically run the script on the disk, but if something goes awry, open a terminal, go to the disk and manually run the script:
      cd /media/{username}/VBOXADDITIONS*
      sudo ./VBoxLinuxAdditions.run
      
  8. Reboot the VM
  9. Change the display resolution to something sane (System Settings -> Displays)
  10. If the Unity side taskbar annoys you too, make it auto-hide (System Settings -> Appearance -> Behavior; enable workspaces too) and install Cairo dock:
    sudo apt-get install cairo-dock
  11. Install Oracle the Java 8 JDK — not OpenJDK, because AndroidStudio doesn’t like that as much. You can do this easily thanks to the WebUpd8 team:
    sudo apt-add-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
  12. If you’re running 64-bit Ubuntu, you’ll need to install a couple of 32-bit libraries the Android SDK needs to avoid the Unable to run mksdcard SDK tool” error:
    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
  13. Install Android Studio from Paolo Ratolo’s repo:
    sudo apt-add-repository ppa:paolorotolo/android-studio 
    sudo apt-get update 
    sudo apt-get install android-studio
  14. Run Android Studio and add it to the launcher:
    /opt/android-studio/bin/studio.sh
  15. If you need to, install git
    sudo apt-get install git

25 Tricks To Appear Smart In Emails And Meetings

Sarah Cooper is now a freelance designer and writes The Cooper Review, but before that, she worked as a designer at Yahoo! and Google. Clearly, the years she put in there have given her plenty of ammunition for tech satire, because at least three of her listicles are hilariously spot on. They include such gems as:

  • Using a “sent from mobile” signature even from your laptop, to appear busier
  • Answering unimportant emails or ones from important people right away
  • The use of nerd language like “orthogonal”, TL;DR and other acronyms
  • Encouraging everyone to take a step back
  • Asking presenters to back up a slide
  • Taking important phone calls in meetings
  • The importance of making fun of product managers

All these tips and more, conveniently available in poster form:

Why Great Functional Specs Are So Important

Way back in the year 2000, the venerable Joel Spolsky wrote a blog post called Painless Functional Specifications – Part 1: Why Bother? It was the first of a four-part series on writing functional specs, and it featured a tale of two software companies: Hasty Bananas Software (HBS) and The Well-Tempered Software Company, a.k.a WellTemperSoft (WTS). Guess which one’s the good one. They both work on the same task of writing a file converter, but WTS does it with a spec and HBS does it without one. Contrived results? Sure:

Total elapsed time for Mr. Rogers [at WTS]: 3 weeks and 1 hour. Elapsed time for Speedy [at HBS]: 4 weeks, but Speedy’s code is not as good.

The story had two morals: functional specs lead to better software design, and they save time communicating:

When you write a spec, you only have to communicate how the program is supposed to work once. Everybody on the team can just read the spec. The QA people read it so that they know how the program is supposed to work and they know what to test for. The marketing people use it to write their vague vaporware white papers to throw up on the web site about products that haven’t been created yet. The business development people misread it to spin weird fantasies about how the product will cure baldness and warts and stuff, but it gets investors, so that’s OK. The developers read it so that they know what code to write. The customers read it to make sure the developers are building a product that they would want to pay for. The technical writers read it and write a nice manual (that gets lost or thrown away, but that’s a different story). The managers read it so that they can look like they know what’s going on in management meetings. And so on.

When you don’t have a spec, all this communication still happens,because it has to, but it happens ad hoc.

Fourteen years later, there came a company called Sprintly, which makes agile project management software. They have a lot of data on how long developer tasks spend in the various stages of the task lifecycle, so they wrote a blog post about it. Turns out, bad functional specs waste a lot of time communicating:

… most of the variability occurs before a ticket has been started (Someday to Backlog). This is the stage when stakeholders are figuring out specs and prioritizing work.

From Sprintly

From Sprintly

In the graph above, the middle two states are when coding is being done. The first and last state are when people are arguing about the specs.

First, Business Bob writes something like “As a human, I want to look at cat videos, so that I’m distracted from writing specs”. Maybe he adds in something about how the videos should play on a mobile phone and not stop to buffer every three seconds. Satisfied with his thoroughness, he emails it to Developer Dave who promptly files it away. Six weeks later he’s ready to tackle the Cat Videos feature, pulls up the spec and realizes it’s so vague that he has no idea where to start. So Dave walks over to Bob’s desk and asks 52 questions:

  1. What format should the videos be in?
  2. Do we want to support multiple bitrates?
  3. Is doing it in HTML5 in the browser fine, or do we have to do Flash too?
  4. Are we hosting these cat videos?
  5. Are we supporting portrait mode on mobile devices?

52. Are we transcoding videos on the fly, or offline?

Business Bob now cringes, realizing what hell he’s gotten himself into, trying to remember why he even wanted the cat videos, and spends the next two days coming up with some decent answers. Except Dave now has follow-ups to those, like what the server hardware specs are gonna be for the video hosts. This goes on for a few more iterations, and Dave finally has a decent spec, so he codes up a storm, then hands it to QA.

Two more weeks later, Tester Tricia pulls up the spec (if you’re following along, we’re now in the last state in the graph above) and takes her turn to terrorize Business Bob:

  1. Should the user be allowed to use multi-touch in the mobile version?
  2. Can the user switch bitrates while playing the video?
  3. Is there a limit on the number of cat videos that can be stored?
  4. What versions of what browsers should be supported?
  5. Are dog videos allowed?

52. What is considered an unacceptable transcoding time?

This is why we can’t have nice things. If Dave did a great job reading Bob’s mind and covered all the bases, maybe the software will pass QA without defects being written against requirements that were changed after the software was written. Sprintly’s data backs up what Joel was saying long ago: unclear and changing requirements eat up developers’ time.

This is why we need great — not good but great — functional specs. It is likely the biggest efficiency gain any software process can make for the cost of a talented spec writer. And that’s key, because that writer will be hard to find.

They need to be technical, ideally have experience writing software (so they know what it’s like to need good specs, and what they entail), be very thorough, detail-oriented, be able to take a lot of criticism, be able to build consensus, to get input and sign-offs from all stakeholders, and most importantly, be a solid writer. Make those specs fun to read, because boring specs make people fall asleep and that’s not good for business.

The last point Sprintly makes is how expensive context switches are, and they link to another classic post by Joel. Turns out that lead developers, who switch contexts a lot, are at least twice as slow at finishing tasks as other developers. So throw out those daily meetings, make coding hours a sacred part of the work day, encourage sparse checking of email, and leave IM chatter for urgent business.

Spolsky must feel like Einstein after Pound-Rebka. Though, more alive.

From Sprintly and Joel on Software, via Slashdot