Reputation: 9783
My question may sound a little bit stupid.
My team has to test a Web application that it is used by 3 different User Roles
. So, we start by writing our Test Cases based on the User Stories. My problem is that I don't want to create 3 different Test Cases for each User Role. I think that this needs a lot of time when writing the Test Cases and later testing them because:
Total Test Cases Number = User Stories x Test Cases Per User Story x User Roles Number
.
Moreover, I don't want to create new Test Cases if some time in the future a new User Role will be created because they will be just duplicates with some little differences.
Is there a better way to manage this situation?
Thanks in advance.
Upvotes: 2
Views: 7159
Reputation: 1
Simply create a table of user roles listed vertically and a list of functions mentioned in the step horizontally. Then mark yes or no in each cell for that role. Repeat for each step. You can put your step description to verify the user’s authorization to perform the action based on the table. If you have a test data column you can put the table there.
Upvotes: 0
Reputation: 1
We have tested these role-based test cases for a huge enterprise application with close to 38 roles and 100s of fields editable or not editable across more than 15-20 web pages using mind maps.
since there were a lot of workflow statuses linked with each role, the thorough testing was needed.
Add a generic test case covering functionality and permissions and mention in test notes to execute the test case for each role as per mind map designed. Attach the mind map to test case.
We converted the test cases into mind map: Sample MindMap
Mind maps helps in consolidating large chunk of data into a pictorial form that made easy for understanding the test cases and speeds up the execution.
Upvotes: 0
Reputation: 101
No need to confuse. You need to just make Matrix for access rights Vs. User Roles. For e.g :- Raw : User Modules(rights of users) Column : User Role
Just mark in excel sheet that which user have what type of permission or access. You can also download some tools which has ability to generate this type of permutations and combination.
You can download from here.
https://testcasegenerator.codeplex.com/
It is greate tool for measure permutaiion and combination in accurate way.
Upvotes: 0
Reputation: 344
Not sure on the coding front (depends on what the situation is and how the code is implemented), but I can answer from a testing perspective (2 yrs so far, over half of it in a traditional waterfall system migrating to Agile).
The web application I test is similar in that we have three user types (global) and three user roles (tied to "projects" which are buckets of sites, sites in term as buckets of imagery, look-up EyeQ if curious). So, 9 possible combos, 8 of which can make a site. Current regression procedure doc has over 100 test cases, 20 or so are edit/create/delete site. total overall: 500+ test cases majority are manually run (ongoing efforts to automate them, but takes time as we've gone thru a UI reboot).
Anyway, I've had to rewrite some of our manual procedures as a result of the sweeping UI changes and am trying avoid the mistakes authors before me made, such as the one you describe (excessive repetition aka reuse same test three times with slight variations).
Rather than stick to their strategy of writing cases, I use looping (same term applies in coding)- that is, test cases that use one role-type combo per pass. Instead of having the same test case written 3+ times and each executed separately for each role/type, use the procedure once but add a few steps at the end.
example test case: user can create a site (8/9 of the type-role combos can do this in my app)
what they did before I came in: test case 1- sys admin not tied to project can make site (10 steps); test case 2- sys admin with project role can make site (same 10 steps); test case 3- account admin not tied to proj can make site (same 10 steps as 1st case); test case 4- account admin with proj role can make site (ditto); test case 5... and so on
what I do: test case 1: Do 10 steps as user with combo 1, step 11- log out as that combo, log in as user with combo 2 and repeat 1-10, step 12- log out as user from step 11 back in as user with combo 3 and repeat 1-10, ...
The difference: 3+ test cases or 30+ steps executed (in this case, about 100) vs 1 test case: under 20 steps
Take this with a grain of salt though, it depends on your type of problem. If it really is repetitive (as with the example) try to loop as much as possible.
The advantage is, when you get an auto-test framework up, a simple for-loop within the test case with an array object or struct for input. The disadvantage is, it wouldn't be as modular (takes an extra 30 seconds to find problem cause if something breaks, but that's my opinion).
Upvotes: 1
Reputation: 18941
Single Responsibility Principle?
Code and test the user access separately to the user story, unless you really do get a completely different story based on your role, in which case, its a distinct spec and warrants its own test.
Upvotes: 3