Monday, April 25, 2016

The new web with AngularJS 2 & TypeScript - a browser marriage, not a date

The world of web architecture is undergoing its third major overhaul and there’s still more to come. This third version of the web development architecture is centered on the browser as a stand-alone engine so that mobile apps and desktop apps have little differences, developers can write an app and then easily use it on a desktop or mobile device or even embed it in a proprietary mobile app. This is what folks are calling a Single Page Application (SPA).

As web developers, we've discovered the benefits of having static pages, then having our entire web site be pre-processed by the server, and now, since jQuery gave us the confidence to move some of that UX processing to the browser, we’ve been slowly moving more and more to the client. But a client-side web app is a marriage to the browser and not just a date.

Angular's popularity

In the last few years, the client-side processing world has matured, although you may think it’s still in its adolescent phase, but it’s showing enough promise and enthusiasm to garner attention from the big players out there. The buzz is concentrated around Google’s AngularJS web framework which manages a client-side set of views and handles some I/O. Microsoft thought well enough of it partner with Google to provide a much needed improvement for JavaScript called TypeScript. Google dropped development of a similar language and supported TypeScript as a primary language for AngularJS 2, just released in beta as of this January.

Angular also matured through five years of work to find a way to reuse web components like they do in other types of software. But the web is stuck with an amalgam of HTML, CSS, and JavaScript that requires the assistance of the browser to make it all work. And contending with the offline nature of mobile apps put a real wrench into traditional coding. We have to have our own database storage, routing features between pages, and communication with other servers. And we can’t hide behind those protective walls of the secure server.

Google has done a masterful job of keeping a framework both powerful enough to satisfy hungry developers for lots of complexity and customization but making it simple enough to be used by both designers and jQuery level developers. It’s got all the magic of RxJS observables (really? you’re still working on Promises?) but we see patterns to help us code easily with AJAX. AngularJS 1 had this problem of too much high-level architecture and a brick wall that kept them from adding some great features that we now get to have in Angular 2.

The only other major competition to Angular has come out of Facebook’s React framework. It has less buzz and more complexity than most developers need. Unless of course, you’re developing large systems like Facebook. But it looks like it's still morphing into better versions and a few years will give us a better understanding of how to use it.

Working with status quo and my class

In business, there’s a need to keep moving ahead but still use the resources that have been paid for. The frameworks of .NET and Java still rule the enterprise web sites and in order to make Angular play well with these guys, it will take some thoughtful redesign. Remember that these server side frameworks do all the rendering of the web page before the page is sent to the browser. There on the browser is where Angular expects to do its stuff but it makes more sense to do secure data access back on the server and generate a page there for the most part. What we are looking for in a client-side application is to improve that and find the best of both worlds.

The improvements that we are able to get from Angular include the ability to improve the user experience through a faster page rendering. We also make gains when we are able to design a great reusable library of web components that designers just drop in to pages. Those can be excellent advantages if we learn how to trim back the features we've been using on the server and now concentrate on the asynchronous data access and microservices challenges before us.

For the last four months, I’ve been developing a class for my employer, Centriq Training, in AngularJS 2 and TypeScript that I think will meet the need of the business user from the component developer on desktop and mobile to the designer who thinks about the future of web components possibly using Google’s Angular Material. It's been the most difficult course I've written.

It's been a challenge since minimal documentation was available to start, other published material was poor except from the Angular developer community (God love you Pascal Precht and Victor Savkin), and documentation continues to be updated by the user community. The AngularJS 2 API docs have a lot of "WHAT IT DOES - Not yet documented"in them. But, hey it's still beta. For the most part, it's midway between the massive headaches of the patchwork packages without a framework I see with JavaScript solutions and the tried and true .NET frameworks.

I'm always seeing improvements and industry support which indicates that TypeScript/AngularJS 2 is going to be a leader for years to come. The editors I use are a delight. For free use and my class, it's Microsoft Visual Studio Code, which has nothing to do with the Visual Studio editors for C# and other languages. (Do they know they are following in the footsteps of confusing Java and JavaScript?). That and JetBrains' WebStorm are the best tools available so far.

If the transition to responsive design and mobile apps didn't overwhelm you and you want to see how the next wave is going to improve things, it's definitely worth a look to look at these mature products that will continue to have an effect on the web architecture for the next five years easily. Hope to see you in class!

Tuesday, January 5, 2016

Assertions & assumptions, eels & heels - Clear terms create understanding in analysis

There's several terms that cause confusion in analysis and sometimes they come in pairs. The two are preconditions / post-conditions and assertions / assumptions.

It's not that people get them mixed up, it 's just that they use them however they like. It's so much better when you know what you are saying and know why you are using the term appropriately. A clear term used properly is the beginning of analysis understanding.

It's not that I blame any particular reason for not using terms well because I know I had no clue when I was suppose to write up a project document and the people I was learning from had bad habits. It's like when my wife regretting doing something said she "felt like an eel." It's an obvious thing if you know the real use of the term but can cause confusion in those that don't have that experience.

Preconditions prevent functionality

In a use case, there is a particular section of preconditions which never is fully explained and ends up being a convenient way to start a use case from the middle of the scenario. My favorite example of this is when a use case requires the credentials of a user to be checked as part of the process. A log-on process is always part of a secure use case. It should be modeled as a part of a goal-driven use case.

Many people shortcut writing the full scenario by avoiding the repetitious log-in tasks and declaring that the user must be logged in as their precondition. So if logging on has changed the state of the system to a different state, that use case must be a complete use case that leads to value for that changed state. The log-in, no matter how many people log in, will not provide the business any value whatsoever. It's not a separate value-driven use case. Ever.

The precondition is a state of the system that must be true in order for the use case to progress to the first step that is unique to this use case. In the classic ATM use case example, you are prevented from doing a Withdraw Cash use case when the machine has no money and the menu option for withdrawing cash is disabled. That means that the precondition for the Withdraw Cash use case is that the ATM can pass the rule of allowing a user to withdraw up to their maximum daily limit or some other rule. The state was changed by a previous Withdraw Cash use case which did have value.

In a business use case where the user first drives to the bank's outside ATM to get cash, the precondition has to change some. The scope of the business system must include the full bank property and building. The system precondition is that of the machine having enough cash but business way to prevent a person from using the ATM is to put a traffic cone in the ATM lane or turn the system off. It's anything a manager would do that doesn't involve the software itself.

Post-conditions repeat important tasks

Use case post-conditions are usually defined as important things that need to be affirmed at the end of the use case tasks. That usually means repeating the important changes noted in the use case narrative. For instance, in the classic ATM example, a post-condition will be to make sure that the bank got the message of a withdrawal transaction at the end. But it doesn't have to be a state change. In fact, the state of the machine should return back to the way it was before the use case started if we are to follow the rule of being able to run a use case multiple times.

The post-condition of the bank transaction is that a message was confirmed to be sent to the bank by some means. In the design stage, this could be a callback function to the ATM or a log provided by the bank. Either way, it should be a task that could be audited.

Assertions are conditions too

Assertions are more of a programmatic style of pre or post-condition when the condition involves only that code. You assert that inputs matched your data rules, a technical precondition. You assert that outputs match your data rules or the state of something changes, a technical post-condition. The code for assertions is removed when deployed.

Assumptions occur after analysis

Assumptions however are not preconditions. You don't get to assume that your users are logged in. They are important decisions taken at design time when we need to guess and take a bet on the chances that something will occur. You assume that a health care system you manage will be affected by a possible repeal or replacement of ObamaCare.

You can understand what your stakeholders want in a sign-up site for your insurance and you know that they want something that follows and takes advantage of the current laws. But there's an uncertainty that is measured through a risk assessment process of whether or not the bill will pass. The project manager will be the one to assess the risk and make that bet on the value that could be gained or lost.

If the choice to take the risk is a good one, then the design team starts working on the system and while they are designing screens and systems, the assumption must be made that there will be a replacement for ObamaCare. Not all the risks that you assume in your design will happen but the choices you make may allow for you to reduce your time to market increasing the value of the system on the ones that do pan out.

Create understanding through clear terms

Terms, although deposited squarely in your beloved template, do not mean that they are correct. The best way to gain some understanding is to start questioning what the value of each piece of information is in your template. Corroborate that with the other team members. Update it, move it, refactor it, or delete it. Make it useful. Add an appendix if you have to. Then it will start being more understandable.

Thursday, December 31, 2015

Friend or foe robot? Designing automated processes for business

Programmers are guys who write your business processes with a kind of invisible ink they call code. The better you tell them what your processes are, the better business results you will have. They don't really model your world because they have no clue how the business works.

Programmers will come up with a well-engineered version of the reality they perceive if left alone and that will have to be the way you run your business if you don't tell them how the business works. It will likely more resemble a massive robot rather than a enabling friend.

As a programming instructor, I talk about the declaration and reuse of a set of statements that become methods (or functions or procedures).

As a business instructor, I teach the same thing concerning recognizing a useful process and promoting the larger scale use of it into the business. As your process maturity level grows, the process expands from your own use, to people around you, to even more people until it's a company-wide standard.

Architecture

Those same maturity steps are used to develop large scale architectures that provide guidance to the necessary design of the infrastructure that has implemented it. In fact, it's the principles of good design that produce a workable architecture. Sometimes business doesn't know which architecture to choose or isn't able to strategically point the direction and then takes the low road of design by infrastructure. This is the choice to buy instead of build and results are good as long as you stay compatible with the other components that are added on. Again what you end up with is a well-engineered solution without regard to your specific business needs.

The business processes existing within a coordinated automated system or an infrastructure are essentially the executable programs. They have been structured to achieve a specific objective. They take inputs and turn them into outputs. They have a specific trigger. They are layered into automated roles and responsibilities to work well when they have to be maintained. Just as if it were an employee, you can fire an architecture layer and hire another version of that layer that fits the bill when managing a cohesive set of responsibilities in a business.

As far as I know there's not as much business writing going on for how to design a job role with few dependencies to other job roles but one of the common axioms of being promoted in business is that you must make yourself replaceable or else you'll never get out of your job. That's the same kind of thinking as when programmers say they must make their programming units reusable or maintenance will become more of a headache.

The process

If processes equal computer programs then they must have similar features. They can be broken down into smaller processes. They are either ongoing processes or processes that have well defined starts and stops. Processes can update policies, standards, guidelines, activities, other processes, procedures and work instructions if needed just like computer code can generate other code, update rules, and modify data that change how the program operates. A program is made up of activities, procedures, and work instructions or as the programmers know it, the class, the methods, and the program statements.

Metrics for a process are built in from the start and can be injected into computer code or built in to the abstract base of the code. In business, the best place to think about your metrics for success is during the planning stage so you can always build with them in mind or else you'll have trouble retrofitting them later. Roles of who should be involved in the process are important. In code, the types of relationships that you maintain with other code is important and successful relationships are spelled out in recipe books called design patterns. I admire Peter Coad who tried to assign roles to classes and discover some reusable patterns for interactivity and not just static recipes.

Process improvements are always a part of all processes and can be found in wrap-up sessions or project post mortems. In code we get a closed feedback loop from the folks who are using the programs who give us reason to enhance the program and get more financing for the next maintenance project. Feedback comes in the form of new or improved features and it gets added to the system as the value becomes known.

Processes should also be well defined in understandable text just like we always do to our fellow programmers when recommending comments in their code. And just like the norm in programming, most documentation happens after the fact because people don't have enough time to document the program until it has stopped changing at the end of the development cycle.

Process owners are the people who understand the process and can help educate others on how to use the process. I help ITIL students who think process owners are not in charge of implementing the process. This always gets me on my soapbox. An implementation of a process, e.g. an ITIL key process, is not going to happen because you read the book. It must be digested, customized by deleting the right parts, and supplemented with all of the current business structure in order to be understood. Then the process activities are noted and people check them off as they need to when they need to encouraged by success and trimmed down by reality.

In programming, it would be the project sponsor who got the ball rolling for the new software and would own the software when complete. They also get new funding when the project is a success and get project funding reductions when the process is too cumbersome.

How and when the process is used is a matter of policy and the ways that you can use these process steps have limits. Just like a computer program, the steps can be run for certain types of tasks and shouldn't be run for others. You don't close the books of an accounting process except for once a month. You don't ship more inventory than you have in stock. Process objectives are probably determined by what planted the seed in the ground for using this process in the first place. In a software project, the business objectives drive the funding and usually can be found in a business case document or a sponsor's mind.

I was reminded of the input and output nature of a process when looking at the method declaration and saw that it defined a general form of a resource just like all the other types of resources.  But until functional programming came along to supplement object oriented programming, we never had a way to send the process information from one place to another internally even though the values of any data could be sent to and fro.

Process testing

Software testing is a way of thinking about your code from the norm or from the original business requirements. This validation is a quality aspect of coding. Test driven design drives home the point that the test is a way of thinking about how your code should be called and used before the implementation is written. ITIL states that
"Even before starting, it is important to think about what the process outcomes should look like." (Service Design, p. 44) 
We also work with requirements in a hierarchical way so that the lower level requirements of the code can roll up to the next level of activity and eventually be mapped to the business goals that drove the project. Then when the system is complete, we have a measurable way to compare what was originally planned and implement improvements if necessary.

Process enablers

The enablers of a process are combined assets of the resources and the capabilities of the business. These are the raw materials and the smarts of the folks that are getting the job done. On the computer programming side are the programming language capabilities and the hardware and software's raw power to get a calculation performed or a sequence of code executed. We measure performance here in FLOPS (floating point operations per second) and computers are moving through the petaflop (1,000,000,000,000,000) ranges now.

Business processes depend on the business assets just like code depends on the infrastructure it runs on. Unfortunately, business is both enabled and limited by humans and computers both enable and constrain business.

Get in front and drive

Processes are not much different whether you do them manually or if you have a robot do them for you. The programmer acts as a plumber in a business process. They know the mechanics and apply the right torque to the right nuts and bolts to hold the system together. The business analyst is going to map out the system so that it works for the business the best.

Sometimes the programmer has no choice but to plan it out and do the best they can. But the business should always get involved at the first to direct the code so that is best represents the business. That's always the best strategy to take for any new project. Don't let the programmer be a back seat driver and transform your software project into something you didn't expect.

Monday, December 21, 2015

Building your dream home - knowing web site roles and skill sets


As a teacher I'm interested in getting the right information to the right student. A major part of my training is web site building and students often want to know what skill sets to learn for their job or career. Building a house is one of my go-to metaphors I use when talking about developing a web site. Getting a home built from the ground up takes skills from
  • a general contractor to get all the people collaborating, 
  • an architect / designer to figure out how it should be lived in, and 
  • the carpenters, plumbers, electricians, and other specialized contractors to build it.
You can separate the skill sets of building a web site into those same basic categories or roles:
  • admin people to set, build, and deploy the code
  • GUI / UX designers to understand the work flow and usability and
  • the developers and database people who make it work.
These roles of the web admin, designer, and developer have been implicit in many job titles and much training can be fuzzy about who should be learning what for the best results. Here's my simple guide to what skills each role could need in a prioritized list:
  • Web admin - OS, network, server configuration, server-side language, JavaScript, architecture, HTML, CSS, graphic arts
  • Web designer - graphic arts, CSS, HTML, JavaScript, server-side language, OS, network
  • Web developer - server-side language, JavaScript, database, architecture, OS, network, HTML, CSS, graphic arts
My classes at Centriq (including some I no longer teach) and the roles that they target in groups by primary role would then look like:

Admin
  • WD- ??? - JavaScript tooling - admin, developer, designer
Designer
Developer
  • xxx - any Java, C#, or php class - developer, admin
  • JV-394 - Intro to XML - - developer, admin
  • WD- 405 - JavaScript - developer, admin
  • WD- 520 - JavaScript Powered Web Apps - developer, admin, designer
  • WD- ??? - TypeScript - developer, admin
  • WD- ??? - Angular 2 - developer, designer
  • SOA-102 - SOA Intro - developer, architect
The JavaScript Powered Web Apps doesn't get you hardly any design because it's about setting up a web site using nothing but JavaScript. That means that the web site isn't much to look at but it's very cool under the covers. The classes that don't have numbers are because they are new. The JavaScript Tooling class is a two day class highlighting the admin skills for JavaScript based web sites and was taught along with the JavaScript Powered Web Apps but is now offered separately. TypeScript and Angular 2 will be offered next year and are completely new classes.

I hope that you are better able to guide your educational path towards a team of skills so you can build your own personal dream home with some of these role explanations. 

Sunday, December 13, 2015

Don't be a LeBron and write user stories for you. Create team value with these examples.

Lebron James by basketlol
I'm still not happy with Agile user stories. The user story should set a goal for the team. Most perspectives of story writing I see follow the LeBron James school of thought. The typical user story I read finds value in winning for the individual player and then the projects follow those rules running into conflicts. I think it's time to do some coaching examples from stories I found on the internet.

The easy expected format

The traditional user story format:
As a (role) I want (something) so that (benefit)
is supposed to benefit the person/business paying for the work. Or at least that's what I want if I'm in charge. You don't want to watch the project goals slip away and then everybody and their dog starts wanting something different. Without a guiding set of project value propositions, the user story will look like
As a <stakeholder> I want <something for me> so that <several excuses>.
Just making an excuse for a personal need does not make a user story a requirement nor makes it easy for a developer to code it. When it's in any kind of formatted statement, the analyst can put it neatly into a document and make it passable as a project document. It's now user stories. Nobody questions it because there are no well understood rules about a good user story.

So stop already. Here's my rules (I get to make the rules if I'm paying for it):
  • The role/stakeholder triggers the activity. It's like a security group description instead of a real type of person at this point. Make it broad.
  • The something is for the business. Make it the focus.
  • The benefit is for the business. Make it have value. No excuses.
  • Use testable functional requirement writing. Any kind of limitation of data or process is a rule.

The hard part

Let's apply this several different ways to sets of requirements I found. In my style of writing requirements, the business rules are extracted out and placed under the requirement (they are given an ID if reusable and placed in another document). The information about the data entities are extracted out and placed in a data dictionary with the business details. The design elements are noted. And any project information is noted as well for inclusion in the project plans. Only the rules stay with the requirements while the rest get sorted and filed away in their own documents.

Desktop backup app

  • As a user, I can backup my entire hard drive.
  • As a power user, I can specify files or folders to backup based on file size, date created and date modified.
  • As a user, I can indicate folders not to backup so that my backup drive isn't filled up with things I don't need saved.
It's interesting to me that this first choice extracted from my Google search didn't bother with the benefit part. So here's my take on them collapsed into one story:
  • As a user, I want to backup my hard drive so I can restore files.
    • RULE - select files by size, date created, data modified, user choice.
    • RULE - select folders by size, date created, data modified
    • DATA File: name, size in Kb, date created, date modified
    • DESIGN - option to select an entire disk backup is the default?
The distinction between the two roles fades away as the trigger is the same for the same result. The ability to use rule-based choices for file selection is what the user story author thinks is important. But the importance might come if there is a functional difference. The distinction between the user and power user will appear as design personas for testing.

Most of the meat of these requirements is in the rules which corresponds to my experience of seeing a document fluff up by including the rules as variations of requirements. It's just bologna.

Agile project management app

Here's another example of four related user stories with other information included from the three other stories that were deemed too broad (vague) or too detailed (mostly data info):
  • A team member can view the iteration's stories and their status with main fields.
  • A team member can view the current burndown chart on the status page, and can click it for a larger view.
  • A team member can view or hide the tasks under the stories.
  • A team member can edit a task from the iteration status page.
This one was interesting to me because the template for writing a user story looked very promising and included the goal of expressing business value. I just didn't see it in the stories. Here's my version:
  • As a team member, I want to view project user stories to be aware of project scope.
    • RULE - select stories by iteration
    • DATA - User Story: status, tasks, main fields(?), rank, name, size, package, owner
    • DESIGN - tasks are able to be hidden and shown under story
  • As a team member, I want to view project status to be aware of project management metrics.
    • DATA User Story: is in scope, hours estimated, hours worked
    • DESIGN - project status is best viewed as a burndown chart
    • DESIGN - the burndown chart should be able to be viewed larger
  • As an analyst, I want to manage user story tasks so that user stories have details.
    • DESIGN - CRUD should start from the iteration status page
I know there are four basic operations on entities which occur. When they all occur together, I find it useful to use a higher level requirement using the word 'manage.' The two operations mentioned in the original versions, edit and view, would be paired with create and delete in a full set of user stories. Data base people know these basic CRUD functions. The entity discovered in the requirements is just the User Story. The project status is a report of all in scope project user stories.

Credit card payment

Another story with additional details from the same Google search result above really did use some value so here's what it looks like before:
  • As a purchaser on the website, I want the ability to pay with a credit card so that I may immediately confirm my purchase.
  • Acceptance criteria
    • accept Discover, Visa, MC
    • Validate CC# when entered
    • Validate expiration data and CVV
    • Validate billing address
    • Generate success and failure messages after processing
  • Definition of Done
    • passes all regression tests
    • passes testing per acceptance items
    • approved by UI team
    • able to show feature in company demo
  • mockup.png
and after using real world documentation:
  • As a customer, I want to purchase a product with a credit card so that transactions are convenient.
    • RULE - credit cards must pass basic local validation before submitting to credit card processor
      • credit card type - Discover, Visa and MC
      • number - passes Luhn algorithm
      • expiration date - after or equal to date of transaction
    • RULE - credit cards submitted to credit card processor must validate with the following information (or create separate DD item)
      • credit card number
      • expiration date
      • card security code
      • billing address
    • RULE - credit card validation should be done within 2 seconds
    • DATA Credit card:  type, number, card security code (not stored), expiration date
    • DATA Message: body, time/date, ID
    • PROJECT Testing, exit criteria:  All regression tests must pass.
    • PROJECT Testing, exit criteria:  Entire UI team approves screen forms.
    • PROJECT Testing, user acceptance: prepare mock data for company demo
    • PROJECT - Project plan, stakeholders: Credit card processor, customer
    • DESIGN - suggested screen layout of entry form - mockup.png
    • DESIGN - self-service customer purchases are best made on a web site
I really don't know why I need to confirm my own transaction since I can't confirm with anything. The confirmations are the validations which should be made quickly. The validations are really in two phases since it's a system dependent on a credit card processor.

Summary of value driven analysis

I believe that people don't do requirements well. It's why user stories were advanced as a replacement for bad requirements. In some ways I agree with Cowan+'s throwing the baby out with the bathwater statement, "User stories are not requirements. They were meant to replace requirements, which suck." But I think that they just help do a better job at user needs elicitation. And then the rest of the analysis should be about writing the business value user stories/use cases.

By following a format of zeroing in on the functional requirement and extracting out all the distracting and fluffing-up text into their own documents, I believe it's much easier to create usable requirements. The thing that drives the requirements the best is value. But it's value to the business, not value to the individual stakeholder. Do it for the team. Don't be LeBron.

Past related blogs


Wednesday, November 4, 2015

Re-inventing usable requirements: Value-driven projects & the failure of the Agile user story

Hubble Helps Find Smallest Known Galaxy Containing a Supermassive Black Hole
I'm fascinated by the attraction of the Agile user story with requirements writers and the effort to make it be a final usable requirement. Stakeholders format their needs from their view using the simplistic Agile user story. That list of stories then becomes the requirements document or backlog with little analysis. It can reel in any amount of confusing scope easily much like a black hole will attract anything it gets close to.

I wrote about rewriting user stories into business' goal targeted requirements in my last blog and my best words to describe it is as a value-driven approach. After writing that I found that Elizabeth Keogh (@lunivore) suggested that business value is more important than the user role back in 2008. But I want to go deeper. I find that the detail level of the user story is unusable as a coder except to start making informed guesses.

Project value

Needs elicitation is the common starting point of a project. This is normal. Needs are selfish. But needs can't be met until everyone decides what the business goal is that the needs address. The goal should be to solve a business problem. The agreement on the problem statement becomes the starting point for gathering focused needs.

Once there is a problem statement, the needs can be framed in that context instead of the individual project stakeholder or customer. I don't think the stakeholder is going to give you any amount of money to write your code so why tailor the project to each one of them? It's the business that gains the value; it's the business that pays the bills; it's the business that should be the context of the requirements.

User story versions

Scott Ambler, a prolific Agile writer and process thinker, outlines the user story on his Agile Modeling site:
  • pre-2008: user story begins as an informal simple "I want a ..." kind of statement
  • 2008+: Mike Cohn adds the party benefiting from the value In User Stories Applied with the format of "As a (role) I want (something) so that (benefit)."
Scott has a list of user stories on his site in the informal style that include:
  • Students can purchase monthly parking passes online.
  • Parking passes can be paid via credit cards.
  • Parking passes can be paid via PayPal.
The Mike Cohn user story of the first bullet point above according to Scott would be:
As a Student I want to purchase a parking pass so that I can drive to school.
The Elizabeth Keogh user story of the same story would probably look like
In order to drive to school, as a Student, I want to purchase a parking pass.
Both of those examples have the Student getting the value. If I'm the starving student, I want to park free. Did you people ask me? None of those are real benefits. After I get done changing this need into a value-driven requirement it will look completely different:
The school sells permits to park vehicles on school property.
You'll see the benefit as a large scope requirement that traces down (is a parent item) to this requirement. The user story is a needs elicitation tool but with a process flaw. The user stories are passed on the the programmer who think they have structure. The reductionist user story rearranges the words of the "requirements" you find in an Excel spreadsheets and passes them on to development.

Needs vs requirements

A need is a statement of any scope granularity, any priority, with or without a responsible party, and either functional or not. It could even be a design as envisioned by the stakeholder trying to grasp how to convey what they think will get the job done. Needs have so many shapes and forms that they can't be processed easily. They have no structure which is why "requirements" meetings last so long. They are really needs elicitation brainstorming sessions.

Needs have to be rewritten into organized requirements. A good requirement has structure. That structure is testable. A good set of requirements is complete. That completeness is validated by a model and the stakeholders. Structure and models take training and time to do well. Stakeholders don't have that time. Analysts do.

The biggest problem for my students in my Business Analysis class seems to be stopping at a good enough stage where the needs are all lined up neatly with enough words so it looks passable. The critical thinking skills should kick in to test the requirements but the tests are not well understood about what the goal is for a good requirement. Programmers don't communicate and use their tool-driven BDD/TDD/XDD style processes to wrangle the statements into some code.

Value-driven requirements

My value-driven approach for the first parking pass requirement would be much more detailed and focused on the school that is paying for the project. A goal accomplishes business value in a functional requirement statement and can be rolled up to a goal group. A goal group expresses larger scoped business values. For the goal, rules express how the functional requirement is to be executed.
  • Goal group: The school offsets direct costs for parking.
    • Goal: The school sells permission to park vehicles on school property.
      • RULE: parking permissions are valid in one month increments
      • RULE: permissions are only offered online
      • RULE: permissions can be paid for with credit cards (Visa, MasterCard, AmEx) or PayPal.
  • Goal group: The school provides a secure environment.
    • Goal: The school controls vehicular access to school property.
      • RULE: Drivers access school parking lots through entrances requiring permission.
  • Design recommendation: parking passes should be used as permission evidence.
The Student of the user story is a valuable piece of requirements information but not for the requirements statements. It should become a persona as long as descriptive details are added to make them more real. Personas should be used as a design step in the project and for testing but not for requirements. You'll also need an Instructor or Employee persona.

A parking pass is a permission mechanism that can be replaced with another solution and not affect the requirements. That makes it a design choice and unless there is a constraint on the project for doing it, it is not worded in the requirements statements. It should be captured as a stakeholder idea for a solution in a category of design recommendations.

My goal follows a similar structure as Alistair Cockburn's goal driven use case except for adding the rules directly into that scenario if the rules are not reusable in other use cases. Many goals should be able to be found that roll up to a goal group. And goal groups can be drilled down into to find other goals. Business value becomes more strategic as you roll up your goals.

It's the focus on solving our own needs as we see them instead of creating value out of solving a business problem that has us creating confusion in requirements. Encourage the stakeholders to start thinking as a team from the business viewpoint and find the value that is in your project.

Thursday, October 22, 2015

As an Agile user story writer, I want a kitten. - Rewriting user stories for business value.

source: Flickr
Teaching yet another iteration of my Business Analysis class here in Kansas City, I was struck by the two versions of Agile user story techniques I had somehow collected over the years. They were different and would yield two different results. And I didn't like that.

Project phases

There's a basic flow to managing a project:
  • Figure out the problem (strategy)
  • Break the problem down into chunks (analysis)
  • Plan what we have to do (design)
  • Do/build each of the chunks (development)
  • Make sure we did it right (testing)
  • Use the solution (production)
But I think we should add a step that will influence how we write our documentation. It's the step where someone pays for the project. That someone is the project sponsor and they want to see some sort of value returned for the investment of time and money on the project.

The User's Story

The common form of a user story in the Agile world goes something like this:
As a <type of user>, I want <some goal> so that <some reason>
The <type of user> is important so that we can wrap our security access controls around them in the design stage. And the type is also useful when we are eliciting other types of user stories during a brainstorming session of some sort so that we can come up with related user stories from the same sort of user. A use case would combine similar types of users into one actor so that the interface is simplified when moving into design.

The <some goal> is important because it provides a similar sized chunk of scope that allows a project manager to create a work breakdown structure with work packages. I also find it useful to provide an architectural sized component based on the goal in software.

But there is trouble here. We can ask for the goal from the perspective of the user or from the business. It's been my inflexible rule that you never ask a stakeholder the priority of a requirement. The expected answer from any manager worth their salt is that they gotta have it. Ask a room full of managers what the priority is and you'll make your meeting much longer than you wanted to.

One of the lessons I learned from Incident Management in ITIL is that you measure priority of incidents as a combination of impact and urgency giving you some hard numbers to work with. Impact is the number of people affected or marketplace and urgency focuses on the perceived value often backed up by a level of management to manage that process or measured by how much you want that new 4k monitor.

But this priority should be from the view of the business and not from the user of the product or service. If we asked the user what they wanted (akin to asking a 7-year old what college they want to attend) they will tell us all sorts of useless goals. Maybe it really is an important goal of that stakeholder to own a kitten or draw seven red perpendicular lines but the business is not going to find value in it.

The <some reason> then expands on the trouble that started with the user's goal. They'll tell you a wonderful reason why it's important to them. But we're looking for business justification here and in my mind, I'd want that justification to be in the form of a higher level business goal. When things go right, the business goal is in mind, but it's not a constraint of the format.

I know that in Extreme Programming, where the user story came from, user stories were seen as an estimation tool. They also were written from the perspective of the system. That makes sense to me. I need a metric to measure my project where all the units are of the same size. That way I can make that PERT chart make sense in terms of scope.

The System's Story

And why is a basic functional requirements statement written from the perspective of the system? Because the requirements have to be executed by the system and tests confirm that. So we write it that way. But why not write from the perspective of the user? Let's try a test. A user story to run a report for monthly sales goes like this:
As a sales manager, I want to see a sales report, so I can identify the sales reps who are under-performing.
What's the value there? Aren't the under-performing sales reps making money for the business? Is this a personal agenda or a goal that isn't well thought out? How about we try the story from a business perspective?
As a sales manager, the system shall create a sales report, so that sales trends can predicted.
Or another version from a different user might be:
As a marketing manager, the system shall create a sales report, so that marketing can budget for advertising. 
I can see the business value in sales forecasting and marketing budgeting. What I see in the other story is a sales manager who creates churn in their sales division which is not value to the business. The requirement is the same.

User story to requirements

So I'm not going to try and change the user story because it's a good elicitation tool. It does not have enough detail to be a good way to deliver requirements to anyone downstream in design or programming. But I did want to raise the issue of the two-faced nature of the statement. In the statement, we can direct the value to the stakeholder or better, we should direct the value to the business.

My recommendation is when using user stories, that we take those stories as a user's statement of what they want and then rewrite them as a good requirements statement. In a use case format we would have
Stakeholders (interests): sales manager (wants forecasting), marketing manager (wants budgeting)
Actor: report reader
Use case: create sales report
As it was, I figured out that all the business value reinforcement I had been getting from other sources over the years caused me to rewrite the user story in a different format when adding it to my lecture. So in the end, I made a mistake about the real format of the user story and learned from my mistakes. No, I didn't get a kitten.

PS. The rant continues on my next blog, Re-inventing usable requirements: Value-driven projects & the failure of the Agile user story.