10 Typical Mistakes in Product Specs
Yegor Bugayenko provides excellent insight toward revealing 10 typical mistakes in software requirement specification documents.
Join the DZone community and get the full member experience.Join For Free
there is a great book called software requirements written by karl wiegers about, well, software requirements. it's a must read for every software engineer, in my opinion. there's no need for me to repeat what it says, but there are a few very simple and very typical mistakes we keep making in our specs. i see them in our documents again and again, which is why i've decided to summarize them. so here they are, the ten most critical and typical of them, from the point of view of a programmer reading a specification document.
chapter 4.3 of a famous standard ieee 830-1998 says that a good specification should be correct , unambiguous , complete , consistent , ranked , verifiable , modifiable , and traceable . eight qualities in total. then, the standard explains them one by one in pretty simple english. but do we have time to read those boring standards? they are for university professors and certification boards. we are practitioners, for goodness sake! ... hold on, i'm joking.
no matter how small the project is and how practical we are, there is always a document that explains what needs to be done, and it may be called the "software requirements specification," or "specification," or just "spec." of course, there is a lot of space for creativity, but we're engineers , not artists. we must follow rules and standards, mostly because they make our communication easier.
now, i'm getting to my point. the specs i usually see violate pretty much all eight principles mentioned earlier. below is a summary of how exactly they do it. by the way, all examples are taken from real documents in real commercial software projects.
no glossary or a messy one
how about this:
uuid is set incrementally to make sure there are no two users with the same account number.
what is the difference between uuid and account number? is it the same thing? it seems so,right? or maybe they are different ... it would be great to know what uuid stands for. is it "unique user id" or maybe "unified user identity descriptor"? i have no idea. i'm lost, and i want to find the author of this text and do something bad to him ... or her.
we're writing in order to be understood, not to impress the reader
i've written already that the . in my experience, this is the biggest problem in all requirement documents. it's not prose! it's not a love letter! it's technical documentation. we can't juggle words for the sake of fun. we should not use product specs just to express ourselves. we're writing in order to be understood, not to impress the reader. and the rule is the same here as with diagrams : if i don't understand you, it's your fault.
here is how that text would look after a proper re-writing:
uuid is user unique id, a positive 4-bytes integer. uuid is set incrementally to make sure there are no two users with the same uuid.
thus, the first and biggest problem is a frivolous use of terms and just words, without having them pre-defined in a glossary.
questions, discussions, suggestions, opinions
i've seen this very recently in a product spec:
i believe that multiple versions of the api must be supported. what options do we have? i'd suggest we go with versioned urls. feel free to post your thoughts here.
yes, this text exists verbatim in a requirements document. first, the author expresses his personal opinion about the subject. then, the author asks me what possible options are out there. then, he suggests i consider something, and after that, he invites me for a talk.
find all your answers before writing the document, that's what you're paid for
impressive, right? obviously, the author has a very creative personality. but we should keep this person as far away from project documentation as possible. this is not what a requirements document appreciates. well, we appreciate creativity, but these four things are strictly prohibited: questions, discussions, suggestions, and opinions.
specifications can't have any questions in them. who are these questions addressed to? me, a programmer? am i supposed to implement the software or answer your questions? i'm not interested in brainstorming with you. i expect you, a requirements author, to tell me what needs to be done. find all your answers before writing the document. that's what you're paid for. if you don't have the answers, put something like tbd ("to be determined") there. but don't ask questions. it's annoying.
a requirements document is not a discussion board. as a reader of the spec, i expect to see exactly what needs to be done without any "maybe" or "we could do it differently." of course you need to discuss these issues, but do it before documenting it. do it somewhere else, like in skype, on slack, or by email. if you really want to discuss in the document, use google docs or word with version tracking. but when the discussion is over, remove its history from the document. its presence only confuses me, a programmer.
there's no need to format requirements as suggestions either. just say what needs to be done and how the software has to work without fear of being wrong. usually, people resort to suggestion when they are afraid to say it straight. instead of saying "the app must work on android 3.x and higher," they say "i would suggest making the app compatible with android 3.x and higher." see the difference? in the first sentence, the author is trying to avoid personal responsibility. he's not saying "exactly android 3.x;" he's just suggesting. don't be a coward; say it straight. if you make a mistake, we'll correct you.
and, of course, opinions are not appreciated at all. it's not a letter to a friend; it's a formal document that belongs to the project. in a few months or weeks, you may leave the project, and somebody else will work with your document. the spec is a contract between the project sponsor and project team. the opinion of a document author doesn't make any difference here. instead of noting "it seems java would be faster" and suggesting "we should use it," say "java is faster, so we must use it." obviously you put it there because you thought so. but once it's there, we don't care who it came from and what you thought about this problem. the information would just confuse us more, so skip it. just facts, no opinions.
don't get me wrong, i'm not against creativity. programmers are not robots, quietly implementing what the document says. but a messy document has nothing to do with creativity. if you want me to create, define the limits of that creativity and let me experiment within them; for example:
multiple versions of the api must be supported. how exactly that is done doesn't really matter.
this is how you invite me to be creative. i realize that the user of the product doesn't really have any justifications or expectations for the versioning mechanisms in the api. i'm free to do whatever i can. great, i'll do it my way.
but again, let me reiterate: a specification is not a discussion board.
mixing functional and quality requirements
this is how it looks:
user must be able to scroll down through the list of images in the profile smoothly and fast.
it's a typical mistake in almost every spec i've seen. here, we mix together a functional requirement ("to scroll images") and and a non-functional one ("scrolling is smooth and fast"). why is it bad? well, there is no specific reason, but it exhibits a lack of discipline.
such a requirement is difficult to verify or test, difficult to trace, and difficult to implement. as a programmer, i don't know what is more important: to scroll or to make sure the scrolling is fast.
also, it is difficult to modify such a statement. if tomorrow we add another functional requirement — scrolling a list of friends, for example — we'll want to require this scrolling to also be smooth and fast. then, a few days later, we'll want to say that "fast" means less than 10 milliseconds of reaction time. we'll then have to duplicate this information in two places. see how messy our document may become eventually?
thus, i would strongly recommend you always document functional and non-functional requirements separately.
mixing requirements and supplementary docs
this is similar to a previous problem and may look like this:
user can download a pdf report that includes a full list of transactions. each transaction has id, date, description, account, and full amount. the report also contains a summary and a link to the user account.
it's obvious there are two things described in this paragraph. first is that a user can download a pdf report. second is how this report should look. the first thing is a functional requirement, and the second one must be described in a supplementary document (or appendix).
in general, functional requirements must be very short: "user downloads," "user saves," "client requests and receives," etc. if your text gets any longer, there is something wrong. try to move part of it to a supplementary document.
unmeasurable quality requirements
this is what i'm talking about:
credit card numbers must be encrypted. the app should launch in less than 2 seconds. each web page must open in less than 500 milliseconds. user interface must be responsive.
i can find many more examples just by opening requirement specs in many projects i've seen over the past few years. they all look the same. and the problem is always the same: it is very difficult to define a truly testable and measurable non-functional requirement.
yes, it's difficult. mostly because there are many factors. take this line, for example: "the app must launch in 2 seconds." on what equipment? with what amount of data in the user profile? what does "launch" mean; does it include profile loading time? what if there are launching problems? do they count? there are a lot of questions like that.
if we answer all of them, the requirement text will fill an entire page. nobody wants that, but having unmeasurable requirements is a greater evil.
again, it's not easy, but it's necessary. try to make sure all quality requirements are complete and without ambiguity.
this example illustrates a very common pitfall:
user authenticates via facebook login button and we store username, avatar, and email in the database.
this is , and it's something a requirements analyst should never do to a programmer. you shouldn't tell me how to implement the functionality you desire. you want to give a user the ability to login via facebook? say so. do you really care whether it's going to happen through a button click or somehow else? do you really care what i store in the database? what if i use files instead of a database? is that important to you?
i don't think so. only in very rare cases will it matter. most of the time, it's just micromanagement.
the spec should only require what really matters for the business. everything else is up to us, the programmers. we decide what database to use, where the button will be placed, and what information will be stored in the database.
you shouldn't tell me how to implement the functionality you desire
if you really care about that because there are certain higher-level limitations — say so. but again, not as implementation instructions to us programmers, but rather as non-functional requirements like this:
login page must look like this (screenshot attached). we must store user email locally for future needs.
the point is that i have nothing against requirements, but i'm strongly against implementation instructions.
lack of actor perspective
the text may look like:
pdf report is generated when required. it is possible to download a report or save it in the account.
the problem here is that there is no "actor" involved. this functionality is more or less clear, but it's not clear who is doing all this. where is the user? it is just a story of something happening somewhere. that's not really what programmers need in order to implement it.
a good user story always has, guess what ... a user
the best way to explain functionality is through user stories. and a good user story always has, guess what ... a user. it always starts with "the user ...," followed by a verb. the user downloads, the user saves, the user clicks, prints, deletes, formats, etc.
it's not necessary for the user to be a human. it may be a system, a restful api client, a database, anything. but always someone. "it is possible to download ..." is not a user story. it's possible for who?
how about this:
our primary concern is performance and an attractive user interface.
this is noise. as the reader of this document, i'm neither an investor nor a user. i'm a programmer. i don't care what your "primary concern" is in this project. my job is to implement the product so that it matches the specs. if performance is your primary concern, create measurable and testable requirements for me. i will make sure the product satisfies them. if you can't create a requirement, don't spam me with this irrelevant information.
good programmers should figure out what good performance means, right?
i don't want to share your concerns, your beliefs, or your intentions. that's your business. and you're paid to properly and unambiguously translate all that into testable and measurable requirements. if you can't do this, it's your problem and your fault . don't try to make it mine.
very often ... wait. very, very often. no. almost always. wrong again. always! that's right, spec documents are always full of noise. some of them have a bit less; some have more. i believe this is a symptom of lazy and unprofessional document authors. in most cases, just lazy.
they don't want to think and translate their concerns, ideas, thoughts, intentions, and objectives into functional and non-functional requirements. they just put them into the document and hope the programmers will somehow find the right solution. good programmers should figure out what good performance means, right? let's just tell them that performance is a concern for us, and they will figure something out.
no! don't do that. do your job right and let programmers do theirs.
and we, programmers, should never accept such documents. we should just reject them and ask requirements authors to re-work and remove noise. i would recommend not even starting to work on a product if there is a lot of noise in its specs.
will work, needs to work, must work
this is yet another very typical mistake:
the api will support json and xml. both formats must fully support all data items. xml needs to be validated by xsd schema.
see how messy it sounds? there are three different points of view, and none of them are suitable for a specification document. a spec must describe a product as if it already exists. a spec must sound like a manual, a tutorial, or a reference. this text must be re-written like this:
the api supports json and xml. both formats fully support all data items. xml is validated by xsd schema.
see the difference? all the "must," "need," and "will" words are just adding doubt to the document. for a reader of this spec, " the api will support " sounds like " some time in the future, maybe in the next version, it will support ." this is not what the author had in mind, right? there should be no doubt, no double meaning, no maybe. the api supports. that's it.
i may have forgotten something important, but these issues are so obvious and so annoying ... i'm going to use this post as a simple guide for our system analysts. feel free to share your experience with requirements documents below in the comments.
Published at DZone with permission of Yegor Bugayenko. See the original article here.
Opinions expressed by DZone contributors are their own.