13 April, 2010

Q-Patterns by Vipul Kocher

When I talked about Questioning skills a few months ago, I wasn't very clear on which tools to use to practice questioning [Of course, in addition to my brain]. Plenty Questions and Dumb Charades took me a step forward. I saw a downside to it. Some questions were lost, some were forgotten and others not important enough. This is where my Note-taking skill came in handy. As I made notes of different questions and grouped them under specific categories, I got many more which were interrelated or newer. How to manage this ocean of questions? How do I structure them well enough to solve the problem at hand? How many questions are good enough? This is when I remembered Q-Patterns that I had read about a few months ago.

Questioning Pattern (also known as Q-Pattern) is a set of interrelated QUESTIONS grouped together to:
         • Relate to some aspect of user or software requirements
         • Provide various alternatives to arrive at a solution

Vipul Kocher, Co-President of Pure Testing is the creator of Questioning Patterns. In his own words, "Q-Patterns is a great tool for communication of domain specific knowledge across people and continuous skill enhancement. It is also a tool for requirement elicitation and defining specifications".

Structure of a Q-Pattern
  • Name of the Q-Pattern
  • Intent/Explanation/Definition
  • Classification
  • Metadata
    • Template Version
    • Q-Pattern Version
    • Author
    • Author Contact information
    • Keywords
  • Questions on
    • Usage
    • User Interface
    • Administration
    • Performance
    • Security
    • Internationalization
    • Localization
  • Examples
  • Associated Q-Patterns
  • Specialization

Vipul’s Example of a Q-Pattern
Name
Password Management

Intent
The most general and common approach to authenticate a system or user is asking for a Password. Password authentication can be at different levels like user level, group level etc or at different stages like Operating System authentication, Application authentication etc.

Questions
If you are using Password authentication anywhere in your spec/design/code/test you may ask following questions:

Administration
1. Can administrator reset the password?
2. Can administrator's password be reset?
3. What happens If the administrator forgets his password (any default password is given or reinstallation would take place)?
4. Can administrator set the default password?
5. Can another administrator reset an administrator's password?
6. Can an administrator read the password of a user?

Usage
1. What's the maximum and minimum length of password?
2. Can we enter numbers in password?
3. Can blank password be used?
4. Where are passwords stored?
5. What is the default password (If any)?
6. Can one customize the default password?
7. Can Special characters (like #,$) and accented characters be used in password?
8. How is password change affected? Is original password required before change password is allowed?
9. Is Confirm password used?
10. Is `Save Password' facility there on the screen (so that user may not need to enter password every time she logs in)?

UI
1. Is password shown as stars (at the time of entering the password, at the time of changing or resetting the password etc.)?
2. How many stars are shown for a password
       a. When it is being entered?
       b. When it is to be changed? (Note: Do not show same number of stars as the number of characters.)

Security
1. How are passwords stored? Are they encrypted before storing? If yes what is the encryption algorithm used?
2. Whether the password is case sensitive or not?
3. Whether the password can be cut and pasted?
4. Can a previously used password be used again? If `Yes' then after how many changes?
5. Is there any expiry time for the password? What happens after the date if user does not change the password during that period?
6. Is there any policy to count the number of password validations in succession (e.g.. If user enters wrong password 4 times, then she is not able to enter password again in succession).
7. If application creates logs of all activities, then the logs of password are created or not?
8. If logs of password are being made then the password is stored in encrypted form or not?

Performance
1. Whether password is made up of single-byte characters (even if multi-byte character set is being used in the application).
2. How much time will it take to authenticate the user after the submission of password?
3. What is the maximum space required to store a password? Will all the passwords require same space irrespective of size?
4. If wrong password is given, how much time will it take to give the error message?
5. How many users can be authenticated at the same time?

Example
Various login screens and mechanisms (web based mail systems, console based login etc.)

Associated patterns
Access Rights, Error messages

Specialization
Say, login for any particular web based mail system.

Q-Patterns and Test Oracles
We find problems in software because somehow, the software doesn’t look quite right. How? Based on feelings, emotions, prior experience? with similar or different products? We build our knowledge base from our past knowledge and perceptions. Sometimes, our perceptions about the software could be wrong. Sometimes, how we desire the software should behave could be wrong. What to do next? Change the software OR the desire about software? OR change the perception about how software is used in general.

As I see it, Q-Patterns are based upon prior experiences and perceptions of people. It helps build a knowledge repository by asking appropriate questions. And this knowledge repository keeps growing as we learn more about the product every single day.

Q-Patterns and Testing Checklists
Once the Knowledge Repository (or the Question Bank) is ready, one can notice that answers to these questions transform into a Testing Checklist for that feature. Voila! I have interacted with few people who find it hard to shift from test cases to test checklists. I have faced this in the past myself. After using Q-Patterns for some time, I now see it as a tool to help me build my Testing checklist by answering the questions in my Q-Pattern.

Agreed, that it depends on the person's skills and talent at questioning. Questions may not make a robust list for a start. But, they can be evolved over time. One way to come up with more is to brainstorm questions with different teams and people. Another way is to get your questions reviewed by your peers or friends asking for feedback.

Q-Patterns and Test Coverage
The Questions section in the Q-Pattern template addresses what areas we are willing to address. The ones mentioned above like Administration, Usage, UI etc are just examples. We could add whatever suites the feature we have selected and storm ourselves with questions. Suppose, I am testing a call center flow of a CRM application, I would add Usability, Number of clicks to perform an operation and keyboard shortcuts as additional section [These in turn may/may not get covered as part of different Test Techniques if any]. There is no one Q-Pattern fits all solution. We need to come up with some basic patterns and build them over time. If we address all the features in the system using Q-Patterns and asking questions about each feature, there is a possibility to have covered at least important test techniques to test the software.

References
http://www.whatistesting.com/qpatterns.htm

Happy Questioning,
Parimala Shankaraiah


25 comments:

  1. Hi Pari,

    Again a Great Post. This is first time I heard about Q-Pattern and I found it very interesting and useful.

    Well, I have a question to you.

    Does Q-Pattern not remind you of "Test Script"? We have set all the questions in advance in a template. When the related task is assigned, we are using the particular Q-pattern template and list the answers of our questions. Does it not seem the Q-Pattern opposes the concept of Context Driven Testing?

    Thanks
    Mohit

    ReplyDelete
  2. @Mohit

    This is first time I heard about Q-Pattern and I found it very interesting and useful

    Very few people know about this Interesting questioning pattern. It's time to spread the Meme!

    Does Q-Pattern not remind you of "Test Script"?

    It does not remind me about Test Scripts because these are a collection of simple and straight forward questions, not detailed instructions for spoon feeding kids.

    Does it not seem the Q-Pattern opposes the concept of Context Driven Testing?

    Why map everything to Context Driven Testing? Why not tweak it for your needs? Why should we stick to templates and forms. I might appear to conflict this blog post, but I don't. The idea of context driven testing is not to embrace something and give up on something else. The idea is to be able to learn and adapt to what works best in your context under the situation you are in.

    You were pretty quick on this one :)

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  3. Hi Pari,

    Thanks for another great post. It might be conicidence, but it is a fact that you come up with a post relating to something "I" am thinking about! And you provide with enough answers for me :)

    I had the same doubt as Mohit asked - but a well explained answer is there too :) I think the post Transitioning to the Context Driven Approach by Lynn McKee is worth remembering this time.

    ReplyDelete
  4. Hi Pari,
    Thanks for introducing this pattern. I did not know of it.
    Check out http://www.rbsc.com/docs/TestPatternXUC.pdf too. This pattern also helps in getting answers when you are designing test specs from the design. It kind of leads you ask the right questions.

    Regards,
    Gunjan

    ReplyDelete
  5. @Nandagopal

    It might be conicidence, but it is a fact that you come up with a post relating to something "I" am thinking about! And you provide with enough answers for me


    Good co-incidence, Isn't it? I suggest you to read the book 'Secret'. You will know how co-incidence works in detail.

    I think the post Transitioning to the Context Driven Approach by Lynn McKee is worth remembering this time

    Thanks for pointing to the article. I found it useful.

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  6. @Gunjan

    Thanks for introducing this pattern. I did not know of it


    Now that you know, let me know how it works for you :)

    Check out http://www.rbsc.com/docs/TestPatternXUC.pdf too. This pattern also helps in getting answers when you are designing test specs from the design. It kind of leads you ask the right questions

    I'll go through the article shortly. Btw, Welcome Back to blogosphere!

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  7. Does it not seem the Q-Pattern opposes the concept of Context Driven Testing?
    http://www.context-driven-testing.com/ Says
    "Context-driven testing is an approach, not a technique. Our task is to do the best testing we can under the circumstances–the more techniques we know, the more options we have available when considering how to cope with a new situation".
    Q Pattern could be one such technique
    --Dhanasekar S

    ReplyDelete
  8. @Dhanasekar

    Context Driven testing is an approach which can be applied to different test techniques. Q-Patters is not a technique. In Vipul's own words "Q-Pattern is pattern for organization of questions. Q-Patterns are = Q-Pattern Template + Questions.

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  9. Hello,

    This is also my first time that I've heard about Q-Pattern and it seems a very minimal and efficient method to prepare for testing. I will apply it for the new projects. Thank you.

    ReplyDelete
  10. @Adrian Torj

    I will apply it for the new projects


    Thank you Adrian. I would be glad to know how you implement it and your learnings.

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  11. @ Pari
    Q-Patters is not a technique
    It could be a technique,an idea or a method
    --Dhanasekar S

    ReplyDelete
  12. @Pari, thanks for this useful and interesting post.

    "Q-Patterns" name is suggesting it is a structure and/or practices for organizing questions.

    - Selim

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. @Pari, is there a standard template available for Q-Patterns provided by Vipul Kocher or any?

    ReplyDelete
  15. @Selim Mia
    is there a standard template available for Q-Patterns provided by Vipul Kocher or any?


    Structure of a Q-Pattern section above can me made into a template of your choice.

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  16. Hi Pari,

    1) Do you suggest preparing a Q-Pattern even when there is a detailed requirement document or only when there is no requirement document available?

    2) Is Q-Pattern a condensed requirement document?

    3) I can understand that no requirement document is detailed enough to answer all our questions but still when you analyze the requirements and come up with questions, how did you manage them?

    4) When you come up with a series of questions, I hope you will be coming up with the answers also in terms of 'Yes' or 'No' or an intended behavior of the product under test. When I put them under different columns in an excel, what do we call it? For example my excel will have columns like: Question number, question, intended behavior, actual product behavior. What will we be calling it?

    5) Does Q-Pattern assure you, whether you have asked all the questions or not?

    6) Don't you see the similarity between mind mapping technique and Q-Pattern? For me both look same with the core theme being taking notes, condensed form of requirement and only differ in looks i.e. one is a template another a diagram.

    7) Don't you think questioning ability is entirely different thing? I believe It all depends upon requirements understanding, your prior experience in testing similar products, context in which it's intended to use, some pre defined heuristics you know, the interesting learning that you can apply in unearthing few interesting application areas which are not defined in heuristics/Q-pattern etc or do you still believe Q-Pattern helps you in asking questions in a better way?

    I would love to see answers for the above questions from you or any of the readers in here.

    Cheers,
    Vijay…

    ReplyDelete
  17. @Mohit
    This is specifically for Mohit


    "Regardless of what the buzz may say, context-driven isn’t about Exploratory Testing, isn’t against test scripts, and doesn’t dictate who do what testing when. The way I talk about being driven by context is to regularly stop and ask yourself, “What can I do, right now that will be of most value to my team/project/company?” If you make decisions that way, instead of simply doing what someone who knows nothing about your situation recommends, I’d say that is at least the first step to being driven by context" - Scott Barber

    ReplyDelete
  18. Hi Vijay,

    1) Do you suggest preparing a Q-Pattern even when there is a detailed requirement document or only when there is no requirement document available?
    I don't believe that requirement documents are complete ever. There is something or the other which keeps getting added/deleted in the document. And who updates it anyway?

    2) Is Q-Pattern a condensed requirement document?
    No. Q-Pattern is a technique that can be used to question anything. Requirement document is one of them.


    3) I can understand that no requirement document is detailed enough to answer all our questions but still when you analyze the requirements and come up with questions, how did you manage them?
    In BWST2, Rahul Verma explained how he used Noun and Verb technique to review requirement documents. He said he would pick up each line in the req. doc and weigh down different options and come up with questions. You could try a similar approach. Remember that Q-pattern can be used to question anything.

    4) When you come up with a series of questions, I hope you will be coming up with the answers also in terms of 'Yes' or 'No' or an intended behavior of the product under test. When I put them under different columns in an excel, what do we call it? For example my excel will have columns like: Question number, question, intended behavior, actual product behavior. What will we be calling it?
    If I were to do this, I would avoid using additional excel or any other document. Why introduce more documents? Don't we have enough? I would follow the Q & A approach stated by Vipul Kocher above.

    5) Does Q-Pattern assure you, whether you have asked all the questions or not?
    No. It depends on the questioning skill of the person using it.

    6) Don't you see the similarity between mind mapping technique and Q-Pattern? For me both look same with the core theme being taking notes, condensed form of requirement and only differ in looks i.e. one is a template another a diagram.
    Mind maps can be used for any purpose. That way, it may sound similar. However, I am not sure if you want to use a mindmap to capture questions about the product.

    7) Don't you think questioning ability is entirely different thing? I believe It all depends upon requirements understanding, your prior experience in testing similar products, context in which it's intended to use, some pre defined heuristics you know, the interesting learning that you can apply in unearthing few interesting application areas which are not defined in heuristics/Q-pattern etc or do you still believe Q-Pattern helps you in asking questions in a better way?
    Q-Patterns show you a way to ask questions. If a person doesn't know how to ask questions or how to proceed with them, this can be a technique to work on the questioning skill.

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  19. @ No. Q-Pattern is a technique that can be used to question anything. Requirement document is one of them.
    @ Q-Patterns show you a way to ask questions. If a person doesn't know how to ask questions or how to proceed with them, this can be a technique to work on the questioning skill.

    - Don't you see above statements are contradictory?

    I think, Q-Pattern is a template to organize your questions and not a technique to ask the questions.

    @ If I were to do this, I would avoid using additional excel or any other document. Why introduce more documents? Don't we have enough? I would follow the Q & A approach stated by Vipul Kocher above.

    - Exactly. Even we can avoid these templates (Q-Pattern). I would go with excel instead, with 2 more extra columns with Expected and actual behavior. You can organize your excel like scalability, usability, security, functioanlity etc and under that you can have your questions and intended behavior for the same.

    What i mean to say is, Q-Pattern is a different word and different in look n feel but the whole idea and theme is still what i explained above. I think when you ask a question and have an answer for that, that can be called as a test case. The very word "Test case" is the problem here. many people here don't like this word so they come up with other fancy words. Am i wrong here? May be i am understanding it in a wrong way or u r representing it in a wrong way?

    I am not against any ideas here. I am just trying to understand it better and differentiate between the concepts...

    Cheers,
    Vijay...

    ReplyDelete
  20. @ No. It depends on the questioning skill of the person using it.
    @ No. Q-Pattern is a technique that can be used to question anything. Requirement document is one of them.
    @ Q-Patterns show you a way to ask questions. If a person doesn't know how to ask questions or how to proceed with them, this can be a technique to work on the questioning skill.

    - Don't you see above statements are contradictory?

    I think, Q-Pattern is a template to organize your questions and not a technique to ask the questions.

    @ If I were to do this, I would avoid using additional excel or any other document. Why introduce more documents? Don't we have enough? I would follow the Q & A approach stated by Vipul Kocher above.

    - Exactly. Even we can avoid these templates (Q-Pattern). I would go with excel instead, with 2 more extra columns with Expected and actual behavior. You can organize your excel like scalability, usability, security, functioanlity etc and under that you can have your questions and intended behavior for the same.

    What i mean to say is, Q-Pattern is a different word and different in look n feel but the whole idea and theme is still what i explained above. I think when you ask a question and have an answer for that, that can be called as a test case. The very word "Test case" is the problem here. many people here don't like this word so they come up with other fancy words. Am i wrong here? May be i am understanding it in a wrong way or u r representing it in a wrong way?

    I am not against any ideas here. I am just trying to understand it better and differentiate between the concepts...

    Cheers,
    Vijay...

    ReplyDelete
  21. Just what I needed, thanks a lot.

    ReplyDelete
  22. Hi Pari,

    http://www.whatistesting.com/qpatterns.htm
    I noticed that the reference URL you provided is broken. When I tried the URL in google chrome all I could see is some HTML code.

    Haritha

    ReplyDelete
  23. @Haritha

    Thanks for bringing this to my notice. Looks like Whatistesting is not maintained anymore.

    You can find more information if you google by same name. I hope that would help.

    Thanks for reading my older blog posts and providing feedback as well. It's overwhelming :)

    Regards,
    Parimala Shankaraiah

    ReplyDelete
  24. Hi
    I read this article and i felt like Q-Pattern is more for requirement definition than testing.You make the requirements more precise by asking questions when we are defining them.With this approach the responsibility comes to tester on the way system is designed.But quite interesting approach when we are testing the system of small scale.

    ReplyDelete
  25. https://sites.google.com/site/itsallabouttesting/q-patterns


    You can also refer to this site.

    ReplyDelete