Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I've just finished the implementation of my software system and now I have to document whether it has satisfied its requirements. What sort of information should I include and how should I lay it out?
My initial functional and non-functional requirements was in a two-column table and looked something like this:
FN-01 The system should allow users
to send private messages to each
other.
NFN-03 The setup/configuration
form should contain sensible default
values for most fields.
I would use the requirement numbering scheme already in place rather than creating a new one. I would document the following items for each requirement:
Requirement Status: This can be phrased in many different ways but you are tyring to communicate if the requirement was completed as listed, completed in a modified variant of what was listed or was simply not able to be completed at all.
Requirement Comment: Describes the previously listed requirement status. This is the "why" that will explain those items that were not able to fully meet the requirements.
Date completed: This is mostly for future product planning but also servers as a historical reference.
A couple of other points to remember:
Requirements may be reviewed by the customer, especially if the customer was the source of the requirements. Hence, this document needs to be as accurate and as informative as possible. (It's also another reason you don't change the requirement numbering scheme unless you have to.)
Your testing department (assuming you have one) should be using these documents for their test planning and they need to know what requirments were met, which ones weren't and most importantly which ones changed and how.
Lastly, unless you're putting on a dog and pony show for someone you shouldn't need screenshots as part of requirement documentation. You also shouldn't need to provide "proof" of completion. The testing department will do that for you.
there are some techniques to convert your requirements into test cases.
But those depend on how your requirements are documented.
If you already have made a scenario based requirements analysis then it would be very easy: Just create a sequence diagram for every path of your scenario, write/do a test -> done.
Besides the documentation created that way should also impress your lecturer.
If you don't have scenarios, you should create some out of your use cases.
The downside here is that it is very work intensive and should only be used in cases that justify its use (a thesis for example ;))
List, one by one, the requirements numbers with the requirements line, then text and/or screenshots proving it does so.
Have the requirement number on the left in bold, then have the requirement text tabbed in and italicized. Align the proof text/screenshots with the requirement text, leaving the left column clear for just the requirement numbers. EG:
REQ-1 italicized requirement text
text discussing how the software has
fulfilled the requirements, possibly
with a picture:
-----------------------
| |
| |
| |
| |
| |
-----------------------
REQ-2 italicized requirement text
etc...
You should group into chapters or sections based upon logical program areas, and start the section or chapter with a blurb about how the whole program area meets the requirements (be general
I would keep it simple and add the following columns:
Delivery Satisfied requirement - with a drop down list containing Yes, No, Open
Comment - any comment regarding the delivery, such as 'need to define message size', 'Does not fully satisfy in the layout of the message, but accepted by the client', etc.
Date completed - when the change was delivered
Date satisfied - when the change was accepted
With the use of requirement ID's, I'm assuming they point back to the docs containing more detailed info including layouts, screen shots, etc.
We would normally have a test plan in place in which each item can be ticked-off if satisfactory. The plan would be based on the original requirements (functional or non-functional) for example:
Requirement: The users account should be locked after three attempts to login with an incorrect password.
Test: Attempt to login more than three times with an incorrect password. Is the user account now locked?
We would do this for each requirement and re-run the plans for each Release Candidate. Some of the tests are automated but we do have the luxuary of a test team to perform manual testing as well!
Based on the results of running these test plans and User Acceptance Testing we would sign-off the RC as correct and fit for release.
Note that sometimes we will sign-off for release even if some items in the test plan do not pass, it all depends on the nature of the items!
The formal way to validate requirements is with testing - usually acceptance testing.
The idea is: for every requirement, there should be one or more tests that validate the requirement. In a formal development situation, the customer would sign off on the acceptance tests at the same time they sign off on the requirements.
Then, when the product is complete, you present the results of the acceptance tests and the customer reviews them before accepting the final product.
If you have requirements that cannot be tested, then they probably are badly written.
e.g. don't say "loading files shall be fast", say "an file of size X shall be loaded in not more than Y milliseconds on hardware of Z" or something like that.
Related
I have a framework for native iOS testing which utilizes Appium, TestNg, Cucumber, PicoContainer
And I`m looking for best way to store data fetched from one step/scenario that later can be used to assert another scenario
Example:
Scenario: user can answer on survey question
Given User answers on Survey Question with {var1}
Then success screen displayed
Scenario: previously answered question has value that user sent initially
Given user on reviewMyAnswers screen
Then answer hold value of {var1}
I just give generic example. In reality i have a lot of data like this that need to be validated and i want to store answer from first scenario in separate class and then retrieve it when needed by key and value pairs somehow like that
public classWhereIstoreTestData() {
ANSWER1;
ANSWER2;
PRODUCT1;
ETC...;
}
#Given(User answers on Survey Question with {var1}{
poSurvey.AnswerOnQuestion;
classWhereIstoreTestData().setValue(key.Answer1,value.poSurvey.getAnswerValue)
#Then(answer hold value of {var1}{
assertThat(classWhereIstoreTestData().getValue(key.Answer1),equalsTo(poSurvey.GetAcceptedAnswerValue)
I`ve seen tutorials (there are just couple on google) , but could not get them
They all seem much more complicated then they suppose to be
My app is not too big and i guess i gonna be using just one stepdefs file. But i still don't want to use static variables for this purpose cause I'm planning to use parrallelization in future
Much like Unit Tests, Scenarios should be independent from each other and sharing data makes them depend on each other. This is a problem. Esp. if you want to use parallel execution later on you can't guaranteed that the Scenario that consumes the data won't run at the same time as the one that produces it.
In short. You can't share data in any way other then using static variables.
And you shouldn't have to. Rather then writing out the answers to the questionnaire step by step in a feature file and then trying to reuse this data, what you can do is store the answer in a Map<String, String> in your step definition file and use it to fill out all questions of the questionnaire all at once in a single step. Or if you need to fill out an entire flow to get where you want to test your thing, do all that and the questionnaire in a single step.
Now you'll probably have a few different scenarios and different ways to progress through the application. If you specify these paths technically you'll get rather dry feature file. However if you use personas to name these variations they'll become more understand able.
Given Jack (the fitness enthusiast) completes the daily exercise task
When Jack fills out a questionnaire prompt about his habits
Then Jack will receive the fitness enthusiasts advice to workouts
Given Jill (the workaholic) completes the daily exercise task
When Jill fills out a questionnaire prompt about his habits
Then Jill will receive the workaholics advice to workouts
And an extra set of reminders is scheduled to remind Jill to take an early break
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am wondering what is the recommended type for PK in sql server? I remember reading a long time ago this article but now I am wondering if it is still a wise decision to use GUID still.
One reason that got me thinking about it is, these days many sites use the id in the url for instance Course/1 would get the information about that record.
You can't really do that with a guid, which would mean you would need some new column that would be unique and use that, what is more work as you got to make sure each record has a unique number.
There is never a "one solution fits all". You have to carefully design your architecture and select the best options for your scenario. Both INT and GUID types are valid options like they've always been.
You can absolutely use GUID in a URL. In fact, in most scenarios, it is better to use a GUID (or another random ID) in the URL than a sequential numeric ID for security reason. If you use sequential ID, your site visitors will be able to easily guess other users' IDs and potentially access their contents. For example, if my profile URL is /Profiles/111, I can try Profile/112 and see if I can access it. If my reservation URL is Reservation/444, I can try Reservation/441 and see what happens. I can easily guess other IDs in the system. Of course, you must have strong permissions, so I should not be able to see those other pages that don't belong to my account, but if there is any issues or holes in your permissions and security, a breach can happen. While with GUID and other random IDs, there is no way to guess other IDs in the system, so such a breach is much more difficult.
Another issue with sequential IDs is that your users can guess how many accounts or records you have and their order in your database. If my ID is 50269, I know that you must have almost this number of records. If my Id is 4, then I know that you had a very few accounts when I registered. For that reason, many developers start the first ID at some random high number like 1529 instead of 1. It doesn't solve the issue entirely, but it avoid the issues with small IDs. How important all that guessing is depends on the system, so you have to evaluate your scenario carefully.
That's on the top of the benefits mentioned in the article that you mentioned in your question. But still, an integer is better in some areas, so choose the best option for your scenario.
EDIT To answer the point that you raised in your comment about user-friendly URLs. In those scenarios, sequential numbers is the wrong answer. A better solution is a unique string in the URL which is linked to your numeric ID. For example, the Cars movie has this URL on IMDB:
https://www.imdb.com/title/tt0317219/
Now, compare that to the URL of the same movie on Wikipedia, Rotten Tomatoes, Plugged In, or Facebook:
https://en.wikipedia.org/wiki/Cars_(film)
https://www.rottentomatoes.com/m/cars/
https://www.pluggedin.ca/movie-reviews/cars/
https://www.facebook.com/PixarCars
We must agree that those URLs are much friendlier than the one from IMDB.
I've worked on small, medium, and large scale implementations(100k+ users) with SQL and Oracle. The major of the time PK type of INT is used when needed. The GUID was more popular 10-15 years ago, but even at its height was not as populate as the INT. Unless you see a need for it I would recommend INT.
My experience has been that the only time a GUID is needed is if your data is on the move or merged with other databases. For example, say you have three sites running the same application and you merge those three systems for reporting purposes.
If your data is stationary or running a single instance, int should be sufficient.
According to the article you mention:
GUIDs are unique across every table, every database, every server
Well... this is a great promise, but fails to deliver. GUID are supposed to be unique snowflakes. However, reality is much more complicated than that, and there are numerous reasons why they end up not being unique.
One of the main reasons is not related to the UUID/GUID specification, but by poor implementations of it. For example some Javascript implementations rank as the worst ones, using pseudo random numbers that are quite predictable. Other implementations are much more decent.
So, bottom line, study the specific implementation of UUID/GUID you are and will be using. Don't just read and trust the specification. Otherwise you may be up for a surprise, when you get called at 3 am on a Saturday night by angry customers.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I need to design a database for something like a downloads site . I want to keep track of users , the programs each users downloaded and also allow users to rate+comment said programs.The things I need from this database - get average rating for a program , get all comments for a program , know exactly what program was downloaded by whom(I dont care how many times each program was downloaded but I want to know for each users what programs he has downloaded),maybe also count number of comments for each program and thats about it(it's a very small project for personal use that I want to keep simple)
I come up with these entities -
User(uid,uname etc)
Program(pid,pname)
And the following relationships-
UserDownloadedProgram(uid,pid,timestamp)
UserCommentedOnProgram(uid,pid,commentText,timestamp)
UserRatedProgram(uid,pid,rating)
Why I chose it this way - the relationships (user downloads , user comments and rates) are many to many . A user downloads many programs and a program is downloaded by many users. Same goes for the comments (A user comments on many programs and a program is commented or rated by many users). The best practice as far as I know is to create a third table which is one to many (a relationship table).
. I suppose that in this design the average rating and comment retrieval is done by join queries or something similar.
I'm a total noob in database design but I try to adhere to best practices , is this design more or less ok or am I overlooking something ?
I can definitely think of other possibilities - maybe comment and\or rating can be an entity(table) by itself and the relationships are between 3 entities. I'm not really sure what the benefits\drawbacks of that are: I know that I don't really care about the comments or the ratings , I only want to display them where appropriate and maintain them(delete when needed) , so how do I know if they better become an entity themselves?
Any thoughts?
You would create new entities as dictated by the rules of normalization. There is no particular reason to make an additional (separate) table for comments because you already have one. Who made the comment and which program the comment applied to are full-fledged attributes of a comment. The foreign keys representing these relationships (which are many-to-one, from the perspective of the comment table) belong right where you've put them.
The tables you've proposed are in third normal form which is acceptable according to best practices. I would add that you seem to be tracking data on a transactional basis (i.e. recording events as and when they occur). That is a good practice too because you can always figure out whatever you want to based on detailed information.
Calculating number of downloads or number of comments is a simple matter of using SQL Aggregate Functions with filters on the foreign key(s) that apply to your query - e.g. where pid=1234 etc.
I would do an entity for Downloads with its own id. You could have download status, you may have multiple download of the same program for one user. you may need to associate your download to an order or something else,..
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am writing a large number of SQL scripts to be shared by a number of people, who will generally work with the scripts by editing them slightly for their specific purpose, then using the modified script to generate a dataset for further analysis.
I've struggled with the best way to build and organize such a library. I want more structure than just a folder with a long list of files like "signups_and_spend_by_week.sql." I see basically two, inter-related issues:
Parameterization. Things like dates and sample sizes are relatively easy to pull out and make into variables, but what about parameters that alter the nature of the query---say changing a left join to an inner join? Is it wise to just (a) comment these kinds of possibilites, (b) create two versions (hence creating serious DRY problems), or maybe (c) wrap queries with a higher-lever programming language that can more easily represent these kinds of possibilites, e.g.,
q = "SELECT * FROM plants"
if want_all:
q = _q + "LEFT JOIN fruits ON fruits.plant_id = plants.id"
else:
q = _q + "INNER JOIN fruit ON fruits.plant_id = plants.id"
run_query(q)
DRY. I find that the same patterns continually appear, with similar or identical views being created as intermediate steps for more complex queries. My thinking is to split these re-usable bits out and call them as needed. However, my concern is that this then creates dependencies all over the library, and that seemingly innocuous changes to a "base" query might might inadvertently break someone else's query. Other than just discipline and good documentation/rules, is their some compromise possible, e.g., automated testing?
This looks like a problem that should not be treated in a purely technical way.
Basically you will offer a base of SQL's that other people can refine.
Some of your base SQL's will have bugs, run slow in certain circumstances, solve problems that don't exist, are spot on, ... and they will be improved, altered, neglected, praised, ...
It is hard to foresee what will work best for you and your co-workers. At least I don't have an idea.
I would suggest that you first start very basic, very simple: with a directory with SQL scripts, giving the files meaningful names.
- Allow people to look at them, use them, change them, derive from them, comment on them, give points for their usefulness, ....
- Have frequent meetings with all involved.
- Try to find out what works well, what your group needs, what things don't work at all, ....
- Only when you, as a group, start to see clearly what tools you need to support what you're doing, start thinking and designing a system to supports your needs. Only then store your scripts in a database, if that still makes sense.
Don't start designing now, you will probably throw 80% away, and the 20% you keep will be to spare the feelings of the one who has spent so much time up front trying to come up with something useful for the group.
For me this is really a situation where a SCRUM approach works best: a situation that no one has a clear view of on how it should be best build. Communication, short sprints that try to address problems, interactivity, change the things that didn't work out as planned, ... those seem to me the key words and phrases for this project.
Let it grow, don't assume you can grok now how it will be.
(I wrote this out of the assumption that it is as clear to you as it is to me how your project will evolve. If you have a clear view of what it will look like and have done this before, my comments will be way off.)
My few thoughts:
Separate application with:
-tags for scripts marking
-search functionality (Google like)
-scripts verifications (with metadata)
-script runner with GUI for parameters entry
Scripts:
Some metalanguage over SQL is a must, but still it will be a DSL, with all disadvantages. So I will try to build your DSL in spirit of minimalism. My recomendation is unobstrucive style of DSL: all meta informations in comments, control statements too. Something like this:
/*
%%Parameters:
%%StartDate:Date:Please enter date for blah blah blah
%%EndDate:Date:And enter date for blah blah blah
%%Verions:
%%AllProducts:Defalt
%%Friuts:Optional
*/
SELECT * FROM plants
--%%Version:AllProducts
LEFT JOIN fruits ON fruits.plant_id = plants.id
--%%EndOfVersion
--%%Version:Fruits
-- INNER JOIN fruit ON fruits.plant_id = plants.id
--%%EndOfVersion
WHERE
StartDate >= %%StartDate AND
EndDate <= %%EndDate
DRY: It's highly subjective but I will recoment not to build infrastructure for subscripts, incuding mechanism, etc. IMO there is more costs than profits.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm working on a fairly simple survey system right now. The database schema is going to be simple: a Survey table, in a one-to-many relation with Question table, which is in a one-to-many relation with the Answer table and with the PossibleAnswers table.
Recently the customer realised she wants the ability to show certain questions only to people who gave one particular answer to some previous question (eg. Do you buy cigarettes? would be followed by What's your favourite cigarette brand?, there's no point of asking the second question to a non-smoker).
Now I started to wonder what would be the best way to implement this conditional questions in terms of my database schema? If question A has 2 possible answers: A and B, and question B should only appear to a user if the answer was A?
Edit: What I'm looking for is a way to store those information about requirements in a database. The handling of the data will be probably done on application side, as my SQL skills suck ;)
Survey Database Design
Last Update: 5/3/2015
Diagram and SQL files now available at https://github.com/durrantm/survey
If you use this (top) answer or any element, please add feedback on improvements !!!
This is a real classic, done by thousands. They always seems 'fairly simple' to start with but to be good it's actually pretty complex. To do this in Rails I would use the model shown in the attached diagram. I'm sure it seems way over complicated for some, but once you've built a few of these, over the years, you realize that most of the design decisions are very classic patterns, best addressed by a dynamic flexible data structure at the outset.
More details below:
Table details for key tables
answers
The answers table is critical as it captures the actual responses by users.
You'll notice that answers links to question_options, not questions. This is intentional.
input_types
input_types are the types of questions. Each question can only be of 1 type, e.g. all radio dials, all text field(s), etc. Use additional questions for when there are (say) 5 radio-dials and 1 check box for an "include?" option or some such combination. Label the two questions in the users view as one but internally have two questions, one for the radio-dials, one for the check box. The checkbox will have a group of 1 in this case.
option_groups
option_groups and option_choices let you build 'common' groups.
One example, in a real estate application there might be the question 'How old is the property?'.
The answers might be desired in the ranges:
1-5
6-10
10-25
25-100
100+
Then, for example, if there is a question about the adjoining property age, then the survey will want to 'reuse' the above ranges, so that same option_group and options get used.
units_of_measure
units_of_measure is as it sounds. Whether it's inches, cups, pixels, bricks or whatever, you can define it once here.
FYI: Although generic in nature, one can create an application on top of this, and this schema is well-suited to the Ruby On Rails framework with conventions such as "id" for the primary key for each table. Also the relationships are all simple one_to_many's with no many_to_many or has_many throughs needed. I would probably add has_many :throughs and/or :delegates though to get things like survey_name from an individual answer easily without.multiple.chaining.
You could also think about complex rules, and have a string based condition field in your Questions table, accepting/parsing any of these:
A(1)=3
( (A(1)=3) and (A(2)=4) )
A(3)>2
(A(3)=1) and (A(17)!=2) and C(1)
Where A(x)=y means "Answer of question x is y" and C(x) means the condition of question x (default is true)...
The questions have an order field, and you would go through them one-by one, skipping questions where the condition is FALSE.
This should allow surveys of any complexity you want, your GUI could automatically create these in "Simple mode" and allow for and "Advanced mode" where a user can enter the equations directly.
one way is to add a table 'question requirements' with fields:
question_id (link to the "which brand?" question)
required_question_id (link to the "do you smoke?" question)
required_answer_id (link to the "yes" answer)
In the application you check this table before you pose a certain question.
With a seperate table, it's easy adding required answers (adding another row for the "sometimes" answer etc...)
Personally, in this case, I would use the structure you described and use the database as a dumb storage mechanism. I'm fan of putting these complex and dependend constraints into the application layer.
I think the only way to enforce these constraints without building new tables for every question with foreign keys to others, is to use the T-SQL stuff or other vendor specific mechanisms to build database triggers to enforce these constraints.
At an application level you got so much more possibilities and it is easier to port, so I would prefer that option.
I hope this will help you in finding a strategy for your app.