Home
RSVP Project cluster: Second Year Project The IT
Contents
1. Multiple choice Also known as radio buttons for this type of question only one option may be selected as the answer of your predefined answer options Text This type of question is answered by typing in text in a field Note This type of question is not very useful for statistics 21 Explanation If you need to add further explanation to a question you can use this type e For each question you have the option of selecting if it s a required question This will force users that are taking your survey to answer the question s marked as required e For the Multiple choice and Checkbox type questions you can click the Click to add an option button for every new answer option you wish to add to this question When you re done with your question you can add more questions by clicking the Add new question link SurveyPony Create new gt C fi Q hotel itu dk Rsvp06_1 Survey Create Create new survey Survey name Y our favorite survey Note The survey name can only contain letters numbers and spaces Description This is the bestest survey Question What s your favorite lunch Question type Checkboxes 1 Bacon 2 Lettuce hippie Click to add an option Make this question required Add new question 4 Finish creating your survey by clicking the Create survey button 22 5 4 Manage Surveys Take Survey Th
2. Besvar Svar til alle Videresend F j til kalender Slet Ikke u nsket Udskriv Forrige N ste rsvpclient06Egmail com rsvpclient06 gmail com Tilf j kontaktperson 19 05 2011 14 33 Til martin jeanty dk Anders rsvp itu dk invites you to take a survey on Survey Pony Dear user please fill out the survey at this location http hotel itu dk Rsvp06_1 Survey Take STICZysyRWhrWnIBVIBDamIQOVI5b296bVIZbiNnU2c1 27 5 6 Account This manual explain how to change the password for your account 1 In the account management you can change your password or delete your account Note The delete account will delete your account with no further notice SurveyPony ManageAc x C fi hotel itu dk Rsvp06_1 Home ManageAccount Change password Old password New password Confirm new password cs Delete account Delete account 28 2 Change password Enter your current password and the new password twice finish by clicking Change Password D SurveyPony ManageAc x C fi hotel itu dk Rsvp06_1 Home ManageAccount Change password Old password Confirm new 2 assword Delete account Delete account 3 Given that the supplied current password was correct and the new password and confir mation matched your password has now been changed SurveyPony ManageAc x Change password Password was changed successfully Old password New passwo
3. O SurveyPony Index C fi 10 hotel itu dk Rsvp06_1 Participant Index 3623 Participant Management Add participant Anders rsvp itu dk Send Email Send out survey invitations Return to my surveys 25 3 Enter the email address of the participant you wish to add and click Add D SurveyPony Add partici x C ft 10 hotel itu dk Rsvp06_1 Participant Create 3623 Participant Email peter jensen dk Back to participant management O SurveyPony Details gt C fi Q hotel itu dk Rsvp06_1 Participant Create 3623 Succes Info Added the following participant Participant peter jensen dk Back to participant management 26 5 If you go back to manage participants the participant appears in the list and you can now send an invitation by email by clicking the Send Email link to send an invitation to a specific participant or use the Send out survey invitations link which will send out invitations to all participants in your survey O SurveyPony Index C fi O hotel itu dk Rsvp06_1 Participant Index 3623 Participant Management Add participant Email Anders rsvp itu dk Remove Send Email peter jensen dk Remove Send Email Send out survey invitations Return to my surveys 6 The Email the system generates to participants has a unique link so that others can t simply try and guess the server link and answer server an example follows
4. acc 1 let implodeRev l char list 1 gt List foldl fun el acc gt el ToString acc let implodeRev2 1 char list List fold fun acc el gt el ToString acc 1 Exercise 12 let toUpper str explode str gt List map System Char ToUpper gt implode let toUpperl str explode gt gt List map System Char ToUpper gt gt implode str let toUpper2 str str gt implode lt lt List map System Char ToUpper lt lt explode Exercise 13 let palindrome str string str ToLower implodeRev lt lt explode str ToLower Exercise 14 No input check let rec ack m n match m n with 0 0 gt nH m 0 gt ack m 1 1 m n gt ack m 1 ack m n 1 Exercise 15 let time f let start System DateTime Now let res f let finish System DateTime Now res start finish 66 let timeArgl f a let res start finish time fun gt f a res finish start Exercise 16 let rec inOrder tree match tree with Leaf gt Node v 1 r gt inOrder 1 Q v inOrder r Exercise 17 let rec mapInOrder f tree match tree with Leaf gt Leaf Node v 1 r gt let lv maplnOrder f 1 Node f v lv mapInOrder f r If you use a function like the following fun z gt printf ZA x ata then mapInOrder and mapPostOrder will return the same tree but will print the value
5. a BinTree a BinTree let rec inOrder binTree match binTree with Leaf gt 79 Node n left right gt inOrder left Q n inOrder right let intBinTree Node 43 Node 25 Node 56 Leaf Leaf Leaf Node 562 Leaf Node 78 Leaf Leaf printfn A inOrder intBinTree Exercise 17 Write a function mapInOrder a gt b gt a BinTree gt b BinTree that makes an in order traversal of the binary tree and apply the function on all nodes in the tree Can you give an example of why mapInOrder might give a result different from mapPostOrder but the result tree retruned in both cases is still the same let rec mapInOrder f tree match tree with Leaf gt Leaf Node n left right gt let leftSide mapInOrder f left Node f n leftSide mapInOrder f right printfn A mapInOrder fun n gt printfn A n n 2 intBinTree Exercise 18 Write a function foldInOrder a b gt b gt b gt a BinTree gt b that makes an in order traversal of the tree and folds over the elements let foldInOrder f acc tree List fold f acc inOrder tree printfn A foldInOrder fun n m gt printfn A A A n m nm n m 0 intBinTree Exercise 19 Extend the lecture s expression language with the additional operators max min and equals They all take two arguments The equals operator should return 1 when t
6. match expr with Const i gt i Prim exprl expr2 gt eval exprl env eval expr2 env Prim exprl expr2 gt eval exprl env eval expr2 env Prim exprl expr2 gt if eval exprl env eval expr2 env then 1 else 0 Prim min exprl expr2 gt System Math Min eval exprl env eval expr2 env Prim max exprl expr2 gt System Math Max eval exprl env eval expr2 env Prim opr gt printfn Operation_ s_not supported opr 0 If exprl expr2 expr3 gt if eval exprl env lt gt 0 then eval expr2 env else eval expr3 env Bind string exprl expr2 gt eval expr2 lt string eval exprl env env Var string gt lookup env string D 4 Nicolai Nicolai Skovvart Exercise 1 Write a function sqr int gt int so that sqr x returns x 2 let sqr x xxx Exercise 2 Write a function pow float gt float gt float so that pow x n returns x n You can use the library function System Math Pow Now write an integer version pow2 int gt int gt int For pow2 you have to write types explicitly and use type cast on System Math Pow Now write pow3 int gt int gt int using recursion let pow basenumber exponent basenumber exponent let pow2 basenumber int exponent int int float basenumber float exponent let rec pow3 number exponent match exponent with 1 gt numb
7. D SurveyPony My Surveys fi hotel itu dk Rsvp06_1 Survey My Surveys Grestenew Sores qa Name Actions Programmeringssprog og paradigmer Manage participants Statistics Delete Brand new template with custom name Manage participants Statistics Delete The survey to beat all surveys and test our stuff stuff Manage participants Statistics Delete Markis scrub Manage participants Statistics Delete Your favorite survey Manage participants Statistics Delete 2 You re now in the survey builder screen where you setup your survey 20 D SurveyPony Create new x C fi hotel itu dk Rsvp06_1 Survey Create Create new survey Survey name Note The survey name can only contain letters numbers and spaces Description Question Question type Multiple choice A Click to add an option _ Make this question required Add new question Back to my surveys 3 Setting up your survey has the following steps e Add a name for your survey e Add a description to your survey e Add one or more questions to your survey For each question you add to your survey minimum one you will have to e Define the question to be answered e Define the type of question among the following available types Checkbox multiple answers are allowed by ticking as many or as few checkboxes corresponding to each of your predefined questions as the user wants
8. Thursday o Time 1630 1830 Singapore o Time 0930 1130 Copenhagen Communication Tools eMails Skype Dropbox Google doc Page 1 of 2 Meeting Minutes 1 4 Next Meeting Target Date March 10 2010 Thursday Time 1630 hours Location Video Conference Singapore Set project deadlines Clarify requirement specification Sharing on project expectations and contribution Page 2 of 2 Meeting Minutes 2 ITU Project Date of Meeting March 10 2011 Venue of Meeting Online conference Time of Meeting 1630 hours Minutes Prepared By Lim Cheening 1 Purpose of Meeting gt Set project deadlines gt Clarify requirement specification gt Sharing on project expectations and contribution 2 Attendance at Meeting Name Attendance Alvin Chua Lim Cheening Kang Kai Xin Gabriel Yee Nicolai Absent Martin Ahmad Mark Absent Anders 3 Meeting Notes Decisions Issues Agreement on data communication document here http goo gl qLla Use of Google docs for meeting agendas and agreements in the future Project Matters SMU sends XML outline structure to ITU Struct explanation ITU will send sample code on how to do a user struct o Anda link to Microsoft struct explanation o This is done and placed in dropbox Documentation struct_example txt Page 1 of 2 Meeting Minutes 2 Along with the template the authentication information e mail password should also be sent SMU looks
9. guestListName fakeguestlist RSVPException RSVPException Add invitee to non existing guestlist host Host Legit host dk 1234 inviteeEmail herp derp com inviteeName herp derp guestListName fakeguestlist RSVPException RSVPException Add invitee to existing guestlist with a non existing host host Host NonLegit host dk 1234 inviteeEmail herp derp com inviteeName herp derp guestListName testguestlist RSVPException RSVPException Add invitee to existing guestlist with an existing host with wrong host password Host Legit host dk 4321 inviteeEmail herp derp com inviteeName herp derp MethodName bool ViewlnviteesFromGuestList string name Host host fs tnput Expected output Actual output Explanation name testguestlist View invitees from a guestlist host Host Legit host dk 1234 name nonlegitguestlist RSVPException RSVPException View invitees from non existing guest list host Host NonLegit host dk 1234 MethodName bool RemovelnviteeFromGuestList string guestListName Host host string inviteeEmail input Expected output Actual output Explanation guestListName testguestlist True True Remove an invitee from a guestlist host Host Legit host dk 1234 inviteeEmail herp derp com name fakeguestlist RSVPException RSVPException Remove an invitee from a
10. new password hostWrongPassword new RSVPException RSVPException Old password didn t match password up for host RSVPException RSVPException RSVPException New password is invalid New password is invalid is invalid validHost null RSVPException RSVPException New password is invalid SurveyTest Shared Data Service A default RSVPService object Host A Host object created with following email martin jeanty dk and password qwerty42millarder Surveyld The id of the survey created with following template template main begin end Method Name bool CreateSurvey string template Host host Method General Data Survey with no questions template emtpy_test_survey begin end Survey with mixed questions template mandatory_mix_test_survey begin mandatory select Do you like testing Yes No explanation You may not like testing but checkboxes What type of testing do you prefer Whitebox Blackbox Unit Automated Contracted text How much do you like testing end input Expected output Actual output Explanation template survey with no true true A valid template with questions no questions should be Host default regarded as valid template survey with mixed A survey with valid template questions should not give an error Host default created once template survey with mixed true true There should be no questions restrictions on creating Host default two survey
11. backward function composition lt lt let toUpper string implode List map fun c gt System Char ToUpper c explode string let toUpperl explode gt gt List map fun c gt System Char ToUpper c gt gt implode let toUpper2 string string gt explode gt implode lt lt List map fun c gt System Char ToUpper c printfn A toUpper caps lock printfn A toUpperl equals _cruisecontrol printfn A toUpper2 for cool Exercise 13 Write a function palindrome string gt bool so that palindrome s returns true if the string s is a palindrome otherwise false A string is called a palindrome if it is identical to the reversed string eg Anna is a palindrome but Ann is not let palindrome string if toUpper string implodeRev explode toUpper string then true else false let palindrome2 str let origStr toUpper str match str gt toUpper gt explode gt implodeRev with o when o origStr gt true gt false 78 printfn A palindrome Anna printfn A palindrome Michael Bolton printfn A palindrome2 Anna printfn A palindrome2 Michael Bolton Exercise 14 The Ackermann function is a recursive function where both value and number of mutually recursive calls grow rapidly Write the function ack int int gt int that implements the Ackermann funct
12. explode gt implode lt lt List map fun a gt System Char ToUpper a Exercise 13 let palindrome datstring string if datstring implodeRev explode datstring then true else false Exercise 14 let rec ack m n match m n with when m 0 gt n 1 when m gt 0 amp amp n 0 gt ack m 1 1 gt ack m 1 ack m n 1 ack 3 11 val it int 16381 Exercise 15 let timeArgl f a let start System DateTime Now in let res f a in let finish System DateTime Now in res finish start Exercise 16 type a BinTree Leaf Node of a x a BinTree a BinTree 69 let rec inOrder btree match btree with Leaf gt Node n lefttree righttree gt inOrder lefttree n inOrder righttree For test let IBT Node 43 Node 25 Node 56 Leaf Leaf Leaf Node 562 Leaf Node 78 Leaf Leaf Exercise 17 let rec mapInOrder f tree match tree with Leaf gt Leaf Node n lefttree righttree gt let left mapInOrder f lefttree Node f n left mapInOrder f righttree Exercise 18 let foldInOrder f acc t List fold f acc inOrder t Exercise 19 through 22 combined type expr Const of int If of expr expr expr Prim of string expr expr Bind of string expr expr Var of string let rec lookup env y match env with gt failwith Unknown variable y x v re
13. i 1 metode 2 let rec combinePairs xs match xs with _ gt x y xr gt x y combinePairs xr 10 let explode s string List ofArray s ToCharArray let rec explode2 s string if s Length 0 then else s 0 explode2 s Remove 0 1 11 a let rec foldr f b xs match xs with gt b x xs f x foldr f b xs metode 1 let implode c list lt char gt foldr fun char x gt char ToString x c metode 2 let implode c list lt char gt List fold fun x char gt x char ToString c metode 3 let implode chars list lt char gt new string for c in chars gt c b let implode2 c list lt char gt List foldBack fun acc elem gt acc ToString elem c Paa c let rec fold f b xs match xs with gt b x xs gt foldl f f x b xs let implodeRev c list lt char gt foldl fun char x gt char ToString x c d let implodeRev2 c list lt char gt List fold fun x char gt char ToString x C33 12 a let toUpper s string s ToUpper let stringToChar s string s ToCharArray let charArrayToUpperString chars char new string for c in chars gt System Char ToUpper c let toUpperl stringToChar gt gt charArrayToUpperString 83 let stringToChar s string s ToCharArray let charArrayToUpperString chars char
14. ome checkbox question la b checkboxes S ome checkbox question lt whitespace only gt NullReference Exception HelperName EncryptionHelper Method Encrypt 8 Decrypt question checkboxes S ome checkbox question a b checkboxes S ome checkbox question Failure description printed out anyways FIXED Failure description was interpreted as an empty string FIXED ignored when type is text Positive test Also tests Radiobuttons as same code is used except type is select for radio buttons Show that option list can be empty even though this might be invalidated by the server Show that unknown question types are ignored in this model and that only a string with whitespaces appear Show that there should be a failure when the description is null mp Expected output Actual output Explanation String Test Take a string encrypt it then decrypt and compare it with the original string HelperName ParticipantHelper Method UpdateList Input Expected output Actual output Explanation Invitee True True Positive test Takes Email a list and updates it stuff stuff dk with another list Name John Johnsson Method GetParticipant Input Expected output Actual output Explanation participant True True Adds a participant stuff stuff dk to the participant ParticipantModelList model
15. retrieves it ParticipantEmail and compares with stuff stuff dk the added participant HelperName TemplateConversionHelper Method IsQuestion Input Expected output Actual output Explanation q 10 true true Positive test multiple digit id CC Method IsOption q 10 o 1 Positive test q 1 o No option id given q Jo 1 No question id given Method IsType input Expected output Actual output Explanation Method IsRequired Input O Expected output Actual output Explanation Method IsValidTitleContent Input Expected output Actual output Explanation Something true true Positive test Something Method Questionld input Expected output Actual output Explanation q 01 1 1 Positive test zero lead Method Convert Input Expected output Actual output Explanation FormCollection template some_stuff template some_stuff Positive test format key gt value begin begin title gt some stuff explanation Foo explanation Foo description gt Foo mandatory mandatory q 1 gt Hello World select Hello World select Hello World gt 1 gt Radio Hello World Hello World q 1 o 0 gt Hello text Bar text Bar q 1 o 1 gt World end end req 1 gt q 2 gt Bar qt 2 gt Text Cont
16. the user is redirected back to the survey with an explanation of what was done wrong lhttp www asp net security tutorials forms authentication configuration and advanced topics cs step 5 33 Listing the surveys Listing the surveys was implemented through a web page that called the list survey web service for the currently authenticated user For convenience we also used the list page to show links for deletion participant management and viewing statistics for each survey The deletion part was simply implemented as a call to an action in the survey controller that takes a survey id and then delegates the call to the DeleteSurvey web service Participant handling Participant management was done through a web page where one could add and delete par ticipants via a specific controller and the user also had the ability in this page to email a participant or all participants with a generated link for the survey For sending emails the Web Mail helper in the ASP Net framework was used where one just input one s credentials the email server and the message to be sent and it automatically would handle all SMTP communication Displaying answers and charts A more interesting part of the client was showing the results as charts In this problem there was three parts to be solved 1 extracting all the important information from the XML formatted answers 2 transferring the data for presentation and 3 presenting the data in beautiful
17. y Const 5 Bind x Const 3 Prim Var x Var y let Swap example x 10 y 5 z x x y y 2 y x x 67 Bind x Const 10 Bind y Const 5 Bind z Var x Bind x Var y Bind y Var DE Prim Var y Prim Var x Var x let If example if max 10 2 10 then 1 else 1 If Prim Prim max Const 10 Const 2 Const 10 Const 1 Const 1 let Unknow variable example x Var x D 2 Mark FA Assignments by Mark Philip Andersen mpanQitu dk open System Exercise 1 let sqr x x x Exercise 2 let pow x n Math Pow x n let pow2 x int n int int Math Pow float x float n let rec pow3 x int n int if n 0 then 1 else xx pow3 x n 1 Exercise 3 let dup a string ata will assume a number will assume a string Exercise 4 let rec dupn a string n int if n 1 then a else a dupn a n 1 Exercise 5 let timediff hour int minut int hour 2 int minut_2 int hour_2 hour x60 minut_2 minut Exercise 6 let minutes hour int minut int timediff 00 00 hour minut Exercise 7 let rec downTo n int if n 1 then 1 else n downTo n 1 let rec downTo2 n int match n with 1 gt 1 n gt n downTo2 n 1 Exercis
18. 13 5 User manuals and examples 15 Sal a ode eke Na dy a ep hi ie eh LE eb eed Ge dye RDG ed A Bey 16 5 27 Create ACcount a A nel Se ees eh ee oS ek ae aoe da 18 5 3 Manage Surveys Create Survey ee ee 20 5 4 Manage Surveys Take Survey o 23 5 5 Manage Surveys Manage Participants oo 25 5 6 Account a 4 ba a a ee IGA Ret Ee ee ee Cs 28 6 Technical Description 30 A O E es Se ES ee eS EE ST JENS 30 GL TIT D ta insertion 6 Amers arse ot sh a ea ed Es le ees 31 6 1 2 Data extracto ios 68 a2 Bk eae Ro aoe ok ehh eae Be elk da 31 IN O aai a RN 32 G T Architecture it o dt Ge e ake ee A a 32 6 2 2 Authentication and authorization o eee eee eee 32 6 2 3 Survey Management e e 33 7 Test strategy 36 TI Servet A eee A A ark E E a 36 RA Unittest iaa e ee A AA AA E 36 122 UGLIENVE do ta e te a e A ts et Attain da de 37 TET UDINE y o AE A AE O A A 37 1 2 2 Integration testing voice dd a a a EE a 38 8 Documentation of communication 8 1 Internal communication 8 2 External communication oaoa a 8 2 1 Agreements from our initial meeting aoaaa a 8 3 Reflection on the process of the international collaboration 8 3 1 Experiences with used techniques e e 8 3 2 How did we perform as a group 00 00 eee eee 8 3 3 Experiences with SMU collaboration 24 9 Recommendations
19. Client design For the client there were no real restrictions on how we should present the data provided by the server We had free hands for choosing whether we wanted the client to e g be a normal application or an application hosted on the web The main purpose of the client is simply to present information provided by the server and send information back to it again for example the survey program logic is entirely handled by the server Looking at how surveys are offered electronically today they are nearly all hosted on the web and this makes perfect sense as this allows for the most people to be able to participate in the surveys without the need for e g running a dedicated application on each computer So the two main choices for the client was to either present it as an application which would run on each survey participants computer or to present it on the web providing wide availability for the 13 users Looking at the choice of having a dedicated application on each computer what jumps to mind as the easiest approach to this would be using NET Windows Forms Windows forms is widely used when developing applications under the NET framework it s based on C and is very easy to work with Having a look at the solution for having the client hosted on the web presents a wider variety of options A new promising feature under NET is Microsofts Silverlight Silverlight is designed to try and compete with Adobe Flash Silverlight i
20. able to store user and survey data in an MS SQL database corresponding to the data model which ensures functionality to support the web services below e The server must ensure access rights such that only authorized users may create edit and view statistics on surveys 2 2 Client e The source code must be written in C e The client must consist of a user interface which enables the user to call the web services described below e The client must be able to present data to the user according to the use cases described below e The client must have a high level of usability e It must be possible to compile and run the client program from a laptop with VS 2010 including F support installed and a browser 2 3 Web services e The web services must be written in the ASP NET framework e The web services must have methods supporting Creation deletion of survey hosts Authentication of a host Changing a host password Creation deletion of surveys Adding removing participants to from a survey Retrieving participants for a given survey Retrieving surveys for a given host Creation deletion of guests lists Retrieving defined guests list for a host Retrieving participants in a given guest list Adding removing participants to a guest list Viewing participants for a given survey Retrieving the questions from a given survey Responding to a survey question Checking that all mandatory questions for a survey has been answered Editing the re
21. about the following hing about the following type Explanation questions the following questions Type Explanation questions Required False Options a b QuestionModel explanation explanation Show that empty Description R qa descriptions are valid Type Explanation Required False Options us QuestionModel text Some text text Some text Positive test Description Some text question question question Type Text Required False Options QuestionModel mandatory mandatory Show that mandatory Description Some text text Some text text Some text will appear in template if question question question required property is true Type Text Required True Options QuestionModel text Some text text Some text Show that options are Description Some text question Type Text Required False Options fa b QuestionModel Description Some checkbox question Type Checkboxes Required False Options fa b QuestionModel Description Some checkbox question Type Checkboxes Required False Options QuestionModel Description Some question Type Unknown Required False Options QuestionMode Description NULL Type Explanation Required False Options Helpers question checkboxes S
22. charts For extracting the data we used LINQ extracting question types and description for each ques tion then if the type was text we chose to print all answers in a list If the data was of type checkboxes or select all options and corresponding vote count was extracted and saved in some variables to be sent for chart generation For generating charts a controller that utilized the ASP NET charting API was created This charting API contains methods for generating various types of charts using data series consisting of a list of x values which was used to display the option text and a corresponding list of y values which was used to display the vote count for that given option After generating the chart we saved the image to a memory stream and returned a temporary file for display into the statistics HTML page Although it might seem an easy task to transfer the data from the view to the chart generation controller there was no easy way to transfer lists using the default RouteValue dictionary for generating url parameters which is mapped to function parameters by the framework The default value for the framework was just to convert the list to a string using the default ToString method and the given input when it was a list of strings that was needed was Sys tem Collection Generic List the default ToString implementation of the NET framework A solution was found which required referring each item by the parame
23. create a user with password and confirm issword not matching empt to create a user that already exists empt to create a new user that doesn t exist password with wrong old password password with different new password and confirm new password with password with correct old password and matching new passwords Delete account Expected output Being returned to the login page Being returned to the login page Being returned to the welcome page Seeing the Create User page You see a list of your surveys and actions you can perform on them Explanation that you have no surveys if that is the case Being returned to the login page Being returned to the login page Error message that you don t have access to this survey Being returned to the login page Error message that you don t have access to this survey Being returned to the login page Error message that you don t have access to this survey Being returned to the login page Error message that you don t have access to this survey Failed logon explanation that syntax is not valid Failed logon explanation that password cannot be empty Failed logon explanation that the user doesn t exist Failed logon explanation that the user password combination doesn t exist Succesfull logon welcome page being shown Login cookie set to remain for 30 years Login is session based Creation failure explanation that email is invalid Creation failure explanation
24. need the user password send in clear text to the server when authenticating and then a hashing of the password would be done This is obviously not very secure and only gets worse on the client side as the password has to be saved someway The way we have saved the password on the client side is to make an encrypted cookie and store it in there but this is against any common security practice as it would be an vulnerability if the encryption algorithm is defeated and someone gets hold of the cookie file A small but better improvement is to include the hashing algorithm client side and only send and store the hash This of course is still a way of authenticating the user if someone decrypts the cookie but be more protective of the user password if used anywhere else Something that is much better than that is generating an authentication token that is time limited when a user is authenticated and thus minimize the flow of user credentials A small note to be taken is that we in a production environment would use HTTPS for web services that needed authentication but was omitted during development for ease of debugging and thus there would be no direct clear text transmission of user credentials 45 Chapter 10 Conclusion We have had a great experience working on the project The course has been well prepared and executed with precision The parts we enjoyed most have been F and the learning experience from working together with a team on the
25. new string for c in chars gt System Char ToUpper c let toUpper2 charArrayToUpperString lt lt stringToChar let toUpper3 s string s gt stringToChar gt charArrayToUpperString 13 let palindrome s string new string for i in s Length 1 1 0 gt s i ToUpper gt fun x gt x s ToUpper 14 let aboveZero x x gt 0 let rec ack m n match m n with 0 gt n 1 aboveZero 0 gt ack m 1 1 aboveZero gt ack m 1l ack m n 1 Result gt ack 3 11 val it int 16381 15 let timeArgl f a let start System DateTime Now in let res f a in let finish System DateTime Now in res finish start 16 type a BinTree Leaf Node of a x a BinTree a BinTree let rec inOrder tree match tree with Leaf gt Node n treeL treeR gt inOrder treeL Q n inOrder treeR 17 metode 1 let rec mapInOrder f tree match tree with Leaf gt Leaf Node n treeL treeR gt let left mapInOrder f treeL let n f n let right mapInOrder f treeR Node nn left right metode 2 der returnerer en liste let half x x 2 let mapInOrder tree List map half inOrder tree Depending on the type of function you use in the map you could get different result from running through the tree in different directions Eg if you bring a value with you it will have different impacts depe
26. non existing guestlist host Host NonLegit host dk 1234 inviteeEmail herp derp com guestListName testguestlist RSVPException RSVPException Remove non existing invitee from a guestlist host Host Legit host dk 1234 inviteeEmail herp derp com guestListName testguestlist RSVPException RSVPException Remove an invitee from a guestlist on a non existing host host Host NonLegit host dk 1234 inviteeEmail herp derp com HostTest Shared Data Service A default RSVPService object validHost A Host object created with following email valid google emailfYgmail com and password 1234 hostWrongPassword A Host object created with following email valid google email gmail com and password wrongPassWord validHost is created on the webservice Method bool AuthenticateHost Host host input Expected output Actual output Explanation Host email false true false true Authenticate host before test email com it is created on the password 1234 webservice gt Authenticate after host is created on the service Host Email false false Host doesn t exists does not exist Password speedy123 Host Email false false Authentication with does not exist password not specified Host Email false false Wrong email format no password Host Email null false false Wrong emai
27. out google doc Web Services Corrected 15 03 11 Objectives Target March 24 2010 Time 1630 Location Video Conference Date edi Singapore Page 2 of 2 Meeting Minutes 5 ITU Project Date of Meeting March 24 2011 Venue of Meeting Online conference Time of Meeting 1600 hours Minutes Prepared By Lim Chee Ning gt Project updates gt System Testing Name Attendance Alvin Chua Lim Cheening Kang Kai Xin Gabriel Yee Nicolai Martin Ahmad Mark Anders All web services will be up by today 24 March 2011 System Testing There is no web services for Update Survey How SMU will go about testing ITU web service methods o ITU to add dummy data e Reporting of any bugs Other project matters Page 1 of 2 Meeting Minutes 5 Is it ok to use attributes in XML does everybody know how this works SSD in progress Objectives Target Date March 31 2010 Time 1630 Location Video Conference ibi Singapore Page 2 of 2 Appendix D FF Assignments D 1 Ahmad Exercise Material module List let rec foldr f b xs match xs with 1 gt b x xs gt f x foldr f b xs let rec foldl f b xs match xs with gt b x xs gt foldl f f x b xs type a BinTree Leaf Node of a a BinTree a BinTree Exercise 1 let sqr x x x Exercise 2 let pow x n System Math Pow x n let pow2 x int n int int lt System
28. output ChangepasswordModel Positive test OldPassword test NewPassword test2 ConfirmNewPassword test2 ChangepasswordModel Negative test OldPassword test NewPassword and NewPassword test2 ConfirmNewPassword does ConfirmNewPassword not match test3 ChangepasswordModel Negative test empty field OldPassword null NewPassword test2 ConfirmNewPassword test2 ChangepasswordModel Negative test empty OldPassword test field and non matching NewPassword test2 Rod ado and ConfirmNewPassword onfirmNewPassword null ModelName AuthenticationModels_LoginModel Expected Actual output Explanation output LoginModel True Negative test invalid email Email Otest dk format Password 1234 RememberPassword true 115 LoginModel Negative test empty field Email test test dk Password null RememberPassword true LoginModel True True Positive test Email test test dk Password 1234 RememberPassword true ModelName AuthenticationModels_CreateModel Expected Actual output Explanation output CreateModel True True Positive test Email test test dk Password 1234 ConfirmPassword 1234 CreateModel True True Negative test invalid email Email test dk format Password 1234 ConfirmPassword 1234 CreateModel True True Negati
29. password in its pure form is simply a combination of letters signs and numbers To avoid having the password just appear like a string of text in the database we wanted a way to obfuscate this information The way this is done is often by performing hashing on the password The way hashing works is by transforming an input of data into a fixed sized bit string This is a one way deal the only way you could get the original data is by hashing that same data and comparing the hash values The way it will work is that the hash value generated from the password will be stored in the database and authentication will work by comparing the hash value of the password in the database with the hash value of the one provided This opens up for a security risk as it will be prone to hash dictionary attacks However there is exists measures to counter that type of attack Briefly this is done by attaching what is called a salt value to the input and hashing it all together thus requiring both the password and salt value to be guessed in order to crack the password There are many alternatives for encrypting data however in this case hashing the password together with a salt value provides strong security and is what we have chosen to encrypt our passwords Moving on to the communication between the program and the database we ran into a couple of choices The preferred way to handle communication from within the F or NET in general domain logic was to use L
30. questions So how could we store 10 this in the data model as a single question We ended up supporting it with groups Our group entity has a boolean called IsMatrix If this is set to TRUE then the client knows that it should represent this group as a matrix type question We had to implement two extra entities in our model after talking to our co students at SMU They wanted each user to be able to have different names in different surveys Also they wanted names on the list of users receiving a given survey The way we solved this was by adding GuestList and Guest to our data model It didn t break any functionality it only provided the extra functions they needed for their client Another thing we discussed and reworked a few times before getting it right was how to handle different user permissions We wanted to have different types of users in the system A user which could create modify and send out surveys an admin We also needed normal users who would receive a survey and give their answers We thought about having an enum type which would hold the role for each user That didn t work out because we wanted to be able to have different permissions roles on each survey What we did was to have a connection participant entity from user to survey that had another connection to a role entity That solved our problem because a role is dependant on participation in a survey We didn t manage to implement this in client
31. real database but in transactions which were rolled back in the end of each test as to get some kind of realism not achievable with a simulated database After writing our tests we uncovered 17 flaws in the web services mostly in the email checking and null reference input which we had to fix The testing of the server thus resulted in a greater confidence that our web services work as expected and that the SMU group should be able to 36 rely on our services without any problems For further information about our server tests please refer to our appendix H 1 server testing plan 7 2 Client 7 2 1 Unit test For the unit testing of our client wad chosen to programmatically blackbox test the models and helper classes in our architecture The reason we are not directly unit testing our controllers is because all of the most important functionality was refactored into helper classes for main tainability and usability and the majority of the functionality left was calls to the web service which was tested in the server part and passing the data to the clients which we rely on the framework upon The reason we had not unit tested the views programmatically was first because of the usage of client side scripting with javascript which would make it harder to test in C without sim ulating a browser and second because it would take a lot of time mocking the controllers and framework and then also the user clicks In anyway the control
32. that password cannot be blank Creation failure explanation that passwords do not match Creation failure explanation that user already exists Creation succes No update explanation that password was wrong No update explanation that password must match Succes Account is deleted Actual output Being returned to Being returned to the login page the login page Seeing the Create User page Seeing the Create User page You see a list of your surveys and actions you can perform on th you have no surveys if that is the case Being returned to Being returned to Error message Sorry an error occurred while processing Being returned to Error message Sorry an error occurred while processing Being returned to Error message Sorry an error occurred while processing Being returned to Being shown the submit form It does not he login page he login page your request he login page your request he login page your request he login page work when you submit however Failed logon expl valid Failed logon expl cannot be empty Failed logon exp user password combination doesn t exist Failed logon expl user password combination doesn t exist Succesfull logon shown Login cookie set lanation that the lanation that the welcome page being o remain for 30 years Login is session based Creation failure explanation that email is invalid Creation fai
33. use We created an email group called singapore bechmellson com that would forward to all the members at SMU Similarly we setup a group called itu bechmellson com which would send to all members at ITU This proved to be a handy way of communicating be cause one would only need to remember two email addresses All the technologies described so far has been our collaboration tools with the students from Singapore University Internally we used some of the same technologies and some additional ones as well Our primary internal project tool has been Google Docs Here we have written our daily meeting logs see appendix C on page 51 reports and all of our technical documents This has been very effective and its only had upsides for our usage We also had a shared folder on Dropbox which was only for the ITU team which had documents from various programs that Google docs doesnt support Mainly model design in OmniGraffle and diagrams in OmniPlanner Later in our project after we had the lesson on Scrum in system development and project organization BSUP we started using a new tool called Pivotal Tracker Tracker is an online collaborative tool for Scrum development Since we identified our own project management style as being so 4Program for drawing data models work breakdown structures and much more 5 Tool for keeping an overview on project management Shttp www pivotaltracker com 41 close to Scrum we decided to switch to regu
34. where needed SMU will create suggestions for survey id xml and statistics xml O 0 0 0 Agenda for 17 03 11 o statistics send images or raw data XML o show survey m We need a draft on the XML data maybe as C objects o deadline for SMU m which date the 24 3 or the 4 4 o Web services corrected walkthrough Agreements from 17 03 11 ITU will change void methods to return booleans to indicate that processing has occured Common terms Survey Collection of Questions to form a questionnaire Question Set of words to get an Answer Answer Set of words to respond to a Question Results Set of Answers to the Questions in a Survey Host User who creates Surveys Invitee User who gives Answers to the Questions in a Survey Guest List Collection of Invitees who can access a Survey Suggestions for chat o easy example for iterating over users ITU implements authenticate web service method SMU will consider the client handling email ITU will make an example on how to use webservices without parsing xml SMU will make a sample of answer structure probably xml Agenda for 10 03 11 o Agreement on data communication m document here http goo gl qLJla o Which web service methods should be available to SMU o Statistics is it okay with SMU if we send pure survey data m no generated images and such m XML o Are there any other issues SMU needs ITU to take care of in order to be able to continue with their work e Agreements from 10
35. 03 11 o SMU sends XML outline structure to ITU o Struct explanation ITU will send sample code on how to do a user struct m and a link to Microsoft struct explanation m This is done and placed in dropbox Documentation struct_example txt o Along with the template the autentication information e mail password should also be sent o Uncertainty about the Template language ITU checks with Niels what the requirements are on both ends SMU looks at the webservice list and gives possible input Once we agree upon the webservice we will put the documentation wsdl on the wiki page o We use Google docs for meeting agendas and agreements in the future First meeting between the ITU group and the SMU group We agreed on using dropbox for sharing documents and meeting summaries we will create the shared folder and make sure that invitations are sent out We agreed on reoccurring meetings every thursday at 9 30 ITU time 16 30 SMU time Meeting Minutes 1 ITU Project Date of Meeting March 3 2011 Venue of Meeting Online conference Time of Meeting 1630 hours Minutes Prepared By Lim Cheening 1 Purpose of Meeting gt Introduction gt Decide on preferred forms of communication gt Establish weekly meeting session 2 Attendance at Meeting Name Attendance Alvin Chua Lim Cheening Kang Kai Xin Gabriel Yee Nicolai Martin Ahmad Mark Anders 3 Meeting Notes Decisions Issues Scheduled Weekly Meeting Time slot
36. 1 The user manuals covers the following sections and functionality Login How to login to the RSVP system Create Account How to create an account so that you can login and start using the RSVP system Manage Surveys Create Survey Walkthrough of creating surveys Manage Surveys Take Survey Walkthrough of answering surveys Manage Surveys Manage Participants Walkthrough of managing participants and sending out invitations for surveys Account How to change account password or delete an account 15 5 1 Login The following manual describes how to login to the RSVP system 1 The first screen you meet when entering the survey system is the login screen E SurveyPony Index e Password Remember password Log in or Create a new account 2 Here you must type your email address and password and you have the option of saving the password so you don t have to login every time you visit the RSVP system default timeout is 30 minutes 3 Click Log in Note If you don t have an account already see the Create Account section for help 16 Remember password ona or Create a new account 4 Given you ve entered a valid email address and corresponding password you re now logged in and should a page similar to the following example D SurveyPony Index C fi O hotel itu dk Rsvp06_1 Hi morten jensen dk Were glad to see you here To hel
37. 11 Chapter 4 Problem analysis 4 1 Server design The purpose of the server would be to handle all the program logic required for a survey system to function The preliminary requirements was how the communication between the server and client is handled this had to be done using Web service which makes use of SOAP Simple Object Access Protocol The program logic for the server had to be written in the NET framework using the language F F does not natively support exposure of web services but as were using the NET framework it was easy to expose them using C Looking at the NET framework this presented us with two major frameworks for supporting SOAP web services over HTTP The two major frameworks that support exposure of web services are ASP NET and WCF Windows Communication Foundation Comparing the two ASP NET web services are designed to be used in conjunction with ASP NET and is essentially a simplistic approach to working with web services under ASP NET WCF is a general purpose framework that aims to provide information exchange between appli cations in the NET framework Our choice fell on using ASP NET web services as it felt like the simplest and cleanest solution that suited our needs for providing the information exchange between the server and the client A key design decision arose when discussing on how we wanted to represent the survey information that goes back and forth between the client and server this includ
38. 9 1 System improvements e 9 2 Code improvements pie i bde AA e 020 eee ee OR PEQUES ica do as A AAA A A Ee a Ta SER gr ZF 9 2 2 Functionality ti ao A Ee a da A o A O NN 10 Conclusion A Review report Explanation of data model Meeting Logs and agendas OH a Ww F Assignments Dei Amado Lu ote a IR Ao A soe we lo Ses See a ELS DD Mare x songs oo de pete ek Gs ee ohh IS A we RE oA ho th Oe Sa el DS Martin a eyo RSS AN a E A EE ioa DA Nicolai ed daa ds dd teed ee te oe Be s D5 Anders dara ta nn ee coed eee e asta dE E Responsible persons Group constitution Web services 007 0 Testing plans Hd Server unit tests 4 4 a a E oa a ee e Ma H 2 gt Client unitetestss is ek ee ee eg ee ee a Jet a H3 Integration test ins as ae ee OS Ee a a ie a Shae 39 39 40 40 40 42 42 44 44 44 44 45 45 46 47 49 51 Chapter 1 Problem explanation and background Performing surveys is a great way to gather opinions and confirm queries With the technological improvements of the present such as the internet and wide spread use of computers performing surveys have been made easier faster and significantly cheaper Online surveys allow users worldwide to answer questions at times that work for them and analyzing the results has become mostly automated saving more time and money Software development started of as something that d usually be done locally but with the creation of the inte
39. Add Remove Invitee To From Guest List Client calls AddInviteeToGuestList RemovelnviteeFromGuestList WS with guest list name host email password and the invitees email name for AddInvitee WS invokes addInviteeToGuestList removeInviteeFromGuestList function in the GuestList module which performs the query to the DB if the host authenticates Returns true if everything went well otherwise an exception is thrown with a message explaining what went wrong e View Guest Lists Client calls ViewGuestLists WS with host email and password WS invokes viewGuestLists function in the GuestList module which fetches the names of the guests lists for the supplied host if he authenticates Returns an array with strings containing the guest list names if everything went well otherwise and exception is thrown with a message explaining what went wrong e Change Host Password Client calls ChangeHostPassword WS with host email password and the new password WS invokes changeHostPassword function in the Host module which performs the query to the DB if the host authenticates Returns true if everything went well otherwise an exception is thrown with a message explaining what went wrong Chapter 3 data model When we had to choose a domain for our RSVP project we chose the survey domain In order for us to get a great system we started by looking at other survey systems The online service Survey Monkey seemed to ha
40. Email validHost true true Remove an existing invitee from a survey that has said invitee where host is the host of they survey surveyld inviteeEmail validHost RSVPException RSVPException Remove an invitee that does not exist on the survey surveyld inviteeEmail RSVPException RSVPException Host that isn t host of survey tries to wrongHost remove an invitee from survey MethodName Invitee ViewInviteesFromSurvey int surveyld Host host mp Expected output Actual output Explanation surveyld validHost Invitee Email Invitee Email Output from an existing survey where host example c_ host example c host is the host of the survey om Invitee Email om Invitee Email dan the man dan the man y surveyld wrongHost RSVPException RSVPException Wrong host tries to view output surveyld invalidHost RSVPException RSVPException Non existing and wrong host tries to view output 1 validHost RSVPException RSVPException survey doesn t exist SurveyAnswerTest Shared Data Service a default RSVPService object to call our web service methods Host a Host object with email Hans_pilgard gmail com and password Lise Invitee an Invitee object with email Bo_Michaelsen live dk and name Bo Michaelsen Empty Survey A survey with no questions Ordinary Survey A survey with no mandatory questions and mixed questiontypes select checkboxes and tex
41. INQ Language Integrated Query which we were introduced to Previously working in java we had used normal SQL by performing SQL string based queries to query the database Performing queries to this is prone to a type of security attack referred to as SQL Injections which can ruin a database completely LINQ is introduced as an integrated component on the NET platform and exists to make working with databases from within the NET platform a much easier and safer experience As opposed to performing SQL string based queries one of the features that LINQ offers is type safety and also security from SQL injection attacks LINQ offers two main variations which were interesting to us LINQ to SQL and LINQ to Entities Firstly LINQ To SQL is whats called an ORM Object relational mapping framework which provides direct 1 1 mapping from an MS SQL database to NET classes in terms of compatibility it is a MS SQL server exclusive feature LINQ to Entities is similar but has a few differences LINQ to Entities is part of the ADO NET Entitiy framework and as opposed to LINQ to SQL LINQ to Entities is not exclusive to MS SQL server only This allows for a wider compatibility range if you e g should choose to change to a different database It also offers easy generation of database entities from within Visual Studio as it is very integrated For out solution we chose LINQ to Entities at it provided an easy platform for us to develop our database on 4 2
42. Math Pow float x float n let rec pow3 x n x pow3 x n 1 Exercise 3 let dup str string str str There is now need for explicit type annotation on because it is made for string concatenation only where can be used by int float etc Although in F is a legacy construct for ML compatability Exercise 4 let rec dupn str string n str dupn str n 1 Exercise 5 1f tl is less than t2 then tl is assumed to be one day later Not validating input let timediff tl t2 let diff fst tl fst t2 60 snd tl snd t2 if diff gt 0 then diff else 1440 diff 65 Exercise 6 let minutes t timediff t 0 0 Exercise 7 let rec downTo n if n gt 1 then n downTo n 1 else let rec downTo2 n match n with 0 gt n gt n downTo n 1 Exercise 8 let rec removeEven l int list match with el e2 t gt el removeEven t e gt e ret ld Exercise 9 let rec combinePair l int list match with el e2 t gt el e2 combinePair t MA Exercise 10 let explode str string str ToCharArray gt Array toList let rec explode2 str string if str Length gt 0 then str 0 explode2 str Remove 0 1 else Exercise 11 let implode l char list 1 gt List foldr fun el acc gt el ToString acc let implode2 1 char list List foldBack fun el acc gt el ToString
43. RSVP Project cluster Second Year Project The IT University of Copenhagen Group 6 Martin Jeanty Larsen mjlaQitu dk 070678 Nicolai Bo Skovvart nbskQitu dk 231288 Mark Philip Andersen mpanQitu dk 031088 Ahmad Salim AlSibahi asal itu dk 040191 Anders Bech Mellson anbhQitu dk 310780 May 23 2011 Preface and introduction This project has been done on the fourth semester of our bachelors education in software de velopment at the IT University of Copenhagen We would like to thank Niels Hallenberg for teaching and guiding us through this project We would also like to thank the group we got to work with from the Singapore Management University hereafter mainly referred to as SMU which were Alvin Chua Lim Cheening Kang Kai Xin and Gabriel Yee Best regards Martin Nicolai Mark Ahmad and Anders This report can be downloaded as a PDF file here http mofus dk KF02 pdf The source code can be downloaded as a ZIP file here http mofus dk KFO2 zip Contents 1 Problem explanation and background 4 2 Requirements specifications 6 A A E ee Shas g Shea tA Se Bde BS 6 Dede Mess Bk ok ok kk A A ote e ON Bd BS A dhe kk BB vt in 6 2 3 Webservices 3 o eh eR ee See ae AA 7 DEA USELCASES sia rs ge ge Boe ks A ee a ae a Se a de 7 3 data model 10 3 1 Design decisions on the data model o o 0000000 10 4 Problem analysis 12 AT Server desir DA A AA to A A aek 12 4 2 Chent desi ns 239 4 td AA bik do le da
44. after that it starts describing the problems that were e Great section in the text about the cultural differences that had an impact on the final specifications of the web services e The part about womens rights seems a bit unclear to me why is it in this document Did the group experience problems related to this Also the section is asserting a lot without background I see that there is a footnote is it better documented in the text it is quoted from e Good finishing section about the strategic problems Maybe it would be nice to read about how the group actually handled this part 48 Appendix B Explanation of data model Here is an explanation of each entity and attribute in the data model e GuestList A list containing guests who can access a specific survey Id Unique identifying number Name Name for the guest list e Guest Entity used to dissolve a many to many connection Guest is a user in a guest list Since a user can be in many guest lists here the guest entity allows for a user to have a different name in each guest list Name Name for the guest e User This entity is a placeholder for all the information we need on a user Id Unique identifying number Email Users email Password Needed if the user is an admin otherwise it can be NULL Name Users name chosen by the user e Answer Answer to a question Text Text string if the type of question allows for the user to input t
45. al expr2 then 1 else 0 Prim min exprl expr2 gt System Math Min eval exprl Prim max exprl expr2 gt System Math Max eval exprl eval expr2 eval expr2 Prim opr gt printfn The_operation s is _not supported opr Exercise 20 let y28 eval Prim Const 32 Const 51 let y29 eval Prim Const 51 Const 51 let y30 eval Const 34 Exercise 21 type expr Const of int If of expr expr expr Prim of string expr expr let rec eval expr match expr with 74 Const i gt i Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt if eval exprl eval expr2 then 1 else 0 Prim min exprl expr2 gt System Math Min eval exprl eval expr2 Prim max exprl expr2 gt System Math Max eval exprl eval expr2 Prim opr gt printfn Operation_ s_not supported opr 0 If exprl expr2 expr3 gt if eval exprl lt gt 0 then eval expr2 else eval expr3 Exercise 22 type expr Const of int If of expr expr expr Bind of string expr expr Var of string Prim of string expr expr let rec lookup env y match env with gt failwith Unknown variable y x v rest gt if x y then v else lookup rest y let rec eval expr env
46. alled Shared host RSVPException RSVPException No surveys created by host SurveyInviteeTest Shared Data Service A default RSVPService object validHost Host Email host example com Password batman123 Name Sen r Host wrongHost Host Email another email com Password doctor x Name Matt Damon invalidHost Host Email host example com Password supergirl Name Sen r Host inviteeEmail dan the man surveyld the id of a created survey validHost and wrongHost are created on the webservice MethodName bool AddInviteeToSurvey int surveyld string inviteeEmail Host host Expected output Actual output Explanation surveyld inviteeEmail validHost Add a valid email to a valid survey surveyld inviteeEmail RSVPException RSVPException Valid host but not host for the survey wrongHost tries to add a participant to the survey surveyld inviteeEmail RSVPException RSVPException Host doesn t exist and isn t the host invalidHost of the survey tries to add a participant to the survey surveyld dan the animal RSVPException RSVPException Bad email syntax for inviteeEmail validHost surveyld inviteeEmail validHost RSVPException RSVPException Invitee already added to survey surveyld inviteeEmail validHost MethodName bool RemovelnviteeFromSurvey int surveyld string inviteeEmail Host host Oooo Expected output Actual output Explanation surveyld invitee
47. ame Throws Exception string s when unable to create host bool RSVPService DeleteHost Host host Deletes a host from the database host requires email password Optional parameters name Throws Exception string s when unable to delete host bool RSVPService AuthenticateHost Host host Authenticates a host checks if the email password combination corresponds to what is stored in the database int RSVPService CreateSurvey string template Host host Create a survey based on template host requires email password Returns surveyld Throws Exception string s when a Host with a blank or invalid bool RSVPService DeleteSurvey int surveyld Host host bool RSVPService AddInviteeToSurvey int surveyld string inviteeMail Host host bool RSVPService RemovelnviteeFromSurvey int surveyld string inviteeMail Host host Invitee RSVPService ViewInviteesFromSurvey int surveyld Host host string RSVPService GetSurveyQuestions int surveyld string RSVPService GetSurveyResults int surveyld Host host Survey RSVPService ViewSurveys Host host bool RSVPService SubmitQuestionAnswer int optionID string answer string inviteeEmail password tries to create a survey Also throws an exception if the TEMPLATE cannot be parsed correctly Delete survey with id surveyld host requires email password Throws Exception string s if it s not the surveys owner who tries to delete the survey Add an invitee as a par
48. at the webservice list and gives possible input Once ITU agree upon the webservice ITU will put the documentation wsdl on the wiki page Uncertainty Template language o ITU checks with Niels what the requirements are on both ends 4 Next Meeting Target Date March 17 2010 Thursday Time 1630 hours Location Video Conference Singapore Page 2 of 2 Meeting Minutes 3 ITU Project Date of Meeting March 17 2011 Venue of Meeting Online conference Time of Meeting 1630 hours Minutes Prepared By Lim Chee Ning 1 Purpose of Meeting Set project deadlines Clarify requirement specification Deadline for SMU Web services corrected walkthrough V V VV 2 Attendance at Meeting Name Attendance Alvin Chua Lim Cheening Kang Kai Xin Gabriel Yee Nicolai Martin Ahmad Mark Anders 3 Meeting Notes Decisions Issues Project Matters ITU will change void methods to return booleans to indicate that processing has occurred Common terms Survey Collection of Questions to form a questionnaire e Question Set of words to get an Answer Answer Set of words to respond to a Question e Results Set of Answers to the Questions in a Survey Host User who creates Surveys Page 1 of 2 Meeting Minutes 3 Invitee User who gives Answers to the Questions in a Survey Guest List Collection of Invitees who can access a Survey Suggestions for chat easy example for iterating over users ITU impleme
49. bool DeleteGuestList string name Host host input OER Expected output Actual output Explanation name testguestlist True True Delete existing guest list host Host Legit host dk name testguestlist RSVPException RSVPException Delete guestlist on non existing host host Host NonLegit host dk 1234 name NonExistingGuestList RSVPException RSVPException Delete non existing guestlist on a valid host host Host Legit host dk 1234 MethodName bool ViewGuestLists Host host 0000 mt Expected output Actual output Explanation host True True View guest lists Host Legit host dk 1234 host True True View non existing guestlist Host NonLegit host dk 1234 host RSVPException RSVPException View guestlist on non existing host Host NonLegit host dk 1234 InviteeGuestListTest Shared Data Service A default RSVPService object Host A Host object created with following email Aa bb cc and password 12512 Surveyld The id of the survey created with following template template main begin end MethodName bool AddInviteeToGuestList string guestListName Host host string inviteeEmail string inviteeName input Expected output Actual output Explanation guestListName testguestlist Add invitee to guestlist host Host Legit host dk 1234 inviteeEmail herp derp com inviteeName herp derp
50. d combination is correct then that it has access to perform the requested method For example a host must own a survey to be able to delete it An alternative to this would be to set up sessions with the clients but the group decided that we would rather have the server stateless to support better scaling 6 1 2 Data extraction While data extraction also involves querying the database it can be a bit more tricky returning the result to the client For simple web services such as AuthenticateHost that return a boolean it is easy to return the result directly Other methods return collections some of which are simple enough that you can just return arrays of values or arrays of simple structs containing values Some of the more tricky methods such as displaying all the data required to show the survey or to show the results of people who have answered the survey require some extra thought The result of the web service must include enough information for the client to be able to invoke other web services such as the IDs of questions and options We decided to implement it using XML as it s a very flexible format that can be used in just about any programming language It does require some effort to generate the XML and for clients to parse and interpret it It could potentially have been implemented using complex structs as well 31 6 2 Client 6 2 1 Architecture Website client Figure 6 2 The architecture of our clien
51. different level of technical expertise The technical experience along with communication ended up being the biggest challenges more on that later In order for our group to be well prepared for the collaboration we first had to handle our internal communication 8 1 Internal communication Alongside this project we had a course in system development and project organization BSUP Here we were taught several different ways to do project management and software development These models all have a different perspective on how to best handle either project management or software development Models we have seen for project management include PRINCE2 IPMA Scrum and more Descriptions of each model is excluded here but we have provided links in the foot notes for the interested reader to learn more about each model Our work together with Singapore SMU started before we were finished with the BSUP course This meant that we hadn t learned all the models when we started organizing ourselves Because of this we constructed our own model because the ones we had seen thus far werent fit for this project in our point of view The model we came up with was quite basic Every day we started out with a group meeting containing discussion about work progress and ideas that possibly needed to be converted into work assignments We also ended each day with a similar meeting our status meeting Early on we identified some roles to distribute among o
52. e 8 let rec removeEven mylist int list match mylist Length with 0 gt 1 gt mylist 2 gt mylist Head gt mylist Head removeEven mylist Tail Tail 68 Exercise 9 let rec combinePair mylist int list match mylist Length with 0 gt pase il gt mylist Head mylist Tail Head combinePair mylist Tail Tail Exercise 10 let explode a string List ofArray a ToCharArray let rec explode2 a string match a Length with 1 gt a Chars 0 gt a Chars 0 explode2 a Remove 0 1 Exercise 11 let rec foldr f b xs match xs with gt b x xs gt f x foldr f b xs let implode charlist char list charlist gt foldr fun char a gt char ToString a 3 let implode2 charlist char list charlist gt List fold fun a char a char ToString let implodeRev charlist char list charlist gt foldr fun char a gt a char ToString let implodeRev2 charlist char list charlist gt List fold fun a char gt char ToString a Exercise 12 let toUpper datstring string implode List map fun a gt System Char ToUpper a explode datstring let toUpperl datstring string datstring gt explode gt gt List map fun a gt System Char ToUpper a gt gt implode let toUpper2 datstring string datstring gt
53. e the survey submission will fail D SurveyPony Take survey C fi hotel itu dk Rsvp06_1 ManageSurveys TakeSurvey WXJxVzFVYWt0bmRaeUMzM1pGQzE1WC9jYXVFZ2UekY1 W QA Take survey Weird survey with many questions Do you want to participate iYes No Do you really want to participate Yes really Y No really no Is this a good survey OYes No Cool stuff blafoo Hithere Input something in this text field Nice survey This is another text field for arbitrary input Okay 24 5 5 Manage Surveys Manage Participants This manual explain how to add remove participants to your surveys and sending out survey invitations 1 From the manage surveys screen you can select Manage participants to add or remove participants and send out survey invitations for your surveys SurveyPony My Surveys x cnr o hotel itu dk Rsvp06_1 Survey My Surveys Create new Survey Name Actions Programmeringssprog 0g paradigmer Manage participants Statistics Delete Brand new template with custom name Manage participants Statistics Delete The survey to beat all surveys and test our stuff stuff Manage participants Statistics Delete Markis scrub Manage participants Statistics Delete Your favorite survey Se Manage participants Statistics Delete 2 Click the Add participant link to add a new participant to your survey
54. eat start At our first meeting we got a chance to see each other and put a face on the names from the emails We also got a first impression on the way our partners were handling their internal organization At this meeting we agreed on a weekly time slot for meetings And we also agreed upon which communication tools we would use initially Read the entire meeting log in appendix C on page 51 8 2 1 Agreements from our initial meeting Weekly Meeting Time slot Thursdays 1630 1830 Singapore 0930 1130 Copenhagen Email itu bechmellson com sends email to all ITU students in the project singapore bechmellson com sends email to all SMU students in the project Dropbox We setup a shared folder for exchanging files Google Docs A shared folder was opened to have easy realtime collaboration on documents Skype We agreed to do video meetings Skype All meeting logs are attached as appendix C on page 51 8 3 Reflection on the process of the international collabo ration 8 3 1 Experiences with used techniques Our experiences with the technology we used for collaboration was overall very satisfying Google Docs proved to be an indispensable tool for collaborative writing in realtime At most meetings we would have the document in question open on computers both at ITU and SMU So that while we were discussing its contents we could re write as we spoke This was a very effective way of understanding each other quickly and wit
55. ed in general information about a complete survey and answers to questions in the survey For this we needed a way to group this information and send it back in structured manner A data format called XML came to mind XML eXtensible Markup Language is used in tons of applications and is for example used by the SOAP protocol to represent data Another way of sending the information back and forth between the client and server could be to send a serialized object back which contained the information in some state Further options includes HTML JavaScript HTML was a potential candidate but it could lead to problems with differentiating the responsibilities of the client and server We wanted a clear separation of client and server and we didnt want the server to worry about how the client was going to represent the data it is sent We hoped to achieve a more data oriented structure by doing this Other negative aspects would include harder maintainability and updatability due to tighter coupling with the client Based on these thoughts we decided to use XML to represent survey data as it suited our needs by not telling how data should be represented in the client A second key design decision arose when talking about security For many of the web service calls that go back and forth between the the server and client an identifier is needed to determine 12 what rights and so on a user has to the specific call This of course includes a password A
56. en til string let dup x y x Vas 4 let rec dupn s n if n l then s else s dupn s n 1 5 metode 1 let hourFix hour if hour 0 then 24 else hour let abs x int System Math Abs x let max x int y int System Math Max hourFix x hourFix y let min x int y int System Math Min hourFix x hourFix y let timeDiff h1 ml1 h2 m2 if abs hourFix hl hourFix h2 gt 12 then abs max h1 h2 24 60 m1 min h1 h2 60 m2 else abs max h1 h2 60 m1 min h1 h2 60 m2 metode 2 let timeDiff hl m1 h2 m2 let abs x int System Math Abs x in let max x int y int System Math Max x y in let min x int y int System Math Min x y in let hl if hl 0 then 24 else hl in let h2 if h2 0 then 24 else h2 in let timel h1 60 ml in let time2 h2 60 m2 in let minutes if abs h1 h2 gt 12 then abs max timel time2 1440 min timel time2 else abs max timel time2 min timel time2 in minutes in 82 6 let minutes hl ml timediff 24 00 h1 ml 7 let rec downTo x int if x 1 then 1 else x downTo x 1 let rec downTo2 x int match x with 1 gt 1 x gt x downTo2 x 1 8 let removeEven xs list lt int gt for i in 1 List length xs do if i 2 1 then yield xs i 1 9 metode 1 let combinePairs xs list lt int gt for i in 0 List length xs 2 do if i 2 0 then yield xs i xs
57. eption Invalid email hostname must not have two subsequent dots RSVPException RSVPException Invalid email hostname must not start with a dot RSVPException RSVPException Invalid email hostname must not end with a dot RSVPException RSVPException Creating a host that already exists RSVPException RSVPException Creating a host with an email that is already taken by another host RSVPException RSVPException Creating a host with an invalid password RSVPException RSVPException Creating a host with an invalid password Host Email RSVPException RSVPException Creating a host with an valid ema il unspecified password Method bool DeleteHost Host host Expectedoutput output Actualoutput Actualoutput Explanation e Deleting a host that exists with the proper email password combination hostWrongPassword RSVPException RSVPException Deleting a host that exists with a bad email password combination Host Email RSVPException RSVPException Deleting a host that doesn t does notex ist exist Password wrong password Method bool ChangeHostPassword Host host string newPassword input Expected output Actual output Explanation validHost new password true true Changing a hosts password with a proper old email password combination and a new password Host Email RSVPException RSVPException Host doesn t exist does notex ist Password old password
58. er 75 gt number pow3 number exponent 1 printfn f pow 3 0 5 0 printfn i pow2 2 3 printfn i pow3 3 4 Exercise 3 Write a function dup string gt string that concatenates a string with itself Y1f you are using then you can write the type of the argument explicitly not necessary if you use Why is that Answer Because otherwise the default type is assumed to be an integer only works for strings so there s no ambiguity but it is not part of the standard FX configuration let dup string string string string printfn s dup hippopotomonstrosesquipedaliophobia Exercise 4 Write a function dupn string gt int gt string so that dupn s n creates the concatenation of n copies of s let rec dupn string string copies match copies with 1 string gt string dupn string copies 1 printfn s dupn Tora 3 Exercise 5 Assume the time of day is represented as a pair hh mm int int Write a function timediff int int gt int int gt int so that timediff tl t2 computes the difference in minutes between tl and t2 let timediff hh mm hh2 mm2 hh2 hh 60 mm2nm printfn i timediff 12 45 13 59 Exercise 6 Write a function minutes int int gt int to compute the number of minutes since midnight Easily done using the function timediff let timefrommidni
59. example expressions in the lecture s expression anguage in abstract syntax and evaluate them using the eval function printfn A eval Const 5 printfn A eval Prim Const 12 Const 5 printfn A eval Prim Prim max Const 20 Const 10 Prim Const 12 Prim min Const 12 Const 5 Exercise 21 Extend the expression language with conditional expressions If el e2 e3 corresponding to s expression el e2 e3 or F s expression if el then e2 else e3 The type abstract syntax for expressions may be extended as follows type expr Const of int If of expr expr expr Prim of string expr expr Extend the interpreter function eval correspondingly It should evaluate el and if el is non zero then evaluate e2 otherwise evaluate e3 printfn A eval If Const 5 Const 3 Const 4 Exercise 22 Extend the expression language with a Bind expression Bind x el e2 where x is a variable el is the value bound the x and e2 is the body in which x can be referenced A variable is referenced using the constructor Var x The type abstract syntax for expressions may be extended as follows type expr2 Const of int If of expr2 x expr2 expr2 Bind of string expr2 expr2 Var of string Prim of string expr2 expr2 Extend the interpreter function eval correspondi
60. ext IsComplete Boolean to indicate if the question is completed e Role The different roles a user can have admin participant and so on Id Unique identifying number Name Name of the role e Participant Dissolves a many to many connection A user can be a participant in many surveys and have many roles e Survey The actual survey that can be created and taken by users Id Unique identifying number Title Title of the survey 49 Description Short description of what the survey is about StartDate When is the survey accepting answers from EndDate When is the survey accepting answers to e Group Placeholder for questions Id Unique identifying number Title Title of the group Page Which page is this group supposed to be on Ordering Ordering is used to order groups on the same page The lower the ordering number the closer the group will be to the top of the page IsCascading Used to force only one answer per row in a matriz question IsMatrix Is this group a matrix question e Question Question that a user participating in a survey can answer Id Unique identifying number Ordering Ordering is used to order questions on the same page The lower the ordering number the closer the question will be to the top of the page Text Text describing the question MinAnswers Is this a required question It is if MinAnswer is above 0 MaxAnswers Mazimum
61. f the only ways to do an external integration test as it is the only things that takes external user interaction External testing of the view also reflects the way a normal user would use our client and thus would give us great confidence to put in a production environment if there were not many failures The way we chose to integration test our client was to identify key scenarios in our clients functionality e g creating a user and trying out various possibilities both for positive tests and negative tests In the example I had mentioned some of the things that could be tested is creating an user with an invalid email or trying to create a user with an email that already exist In this way we systematically tried to uncover some of the most ordinary scenarios an ordinary user could run into Overall while our integration test did not cover 100 of all possible scenarios which is usually impossible we are confident that our systematic approach to testing uncovered many of the most important flaws and thus we can conclude that we have a good and reliable client For the full testing schemes please refer to appendix H 3 client integration testing plan 38 Chapter 8 Documentation of communication As part of our project we had to do distributed development together with a team in Singapore This task provided some challenges regarding communication tools for collaborative work cul tural differences language barriers and our
62. ght hh mm timediff 0 0 hh nm printfn i timefrommidnight 5 23 Exercise 7 Write a function downTo int gt int list so that downTo n returns the nelement list n n 1 Sij Use if then else expressions to define the function Define the downTo2 function being equal to downTo except that you now must use pattern matching let rec downTo int if int 1 then 1 else int downTo int 1 let rec downTo2 int match int with 1 gt 1 gt int downTo2 int 1 printfn A downTo 5 printfn A downTo2 9 Exercise 8 Write a function removeEven int list gt int list so that removeEven xs removes the even indexed elements from the list xs removeEven xl x2 x3 x4 x5 Se Phe XO xs removeEven removeEven xl x1 76 let rec removeEven list match list with xl x2 xs gt x1 removeEven xs x gt x printfn A removeEven 1 2 3 4 5 6 7 8 9 Exercise 9 Write a function combinePair int list gt intxint list so that combinePair xs returns the list with elements from xs combined into pairs If xs contains an odd number of elements then the last element is thrown away combinePair xl x2 x3 x4 x1 x2 x3 x4 combinePair xl x2 x3 x1 x2 combinePair combinePair xl Hint Try use pattern matching let rec combinePair list int
63. have chosen to use the black box testing technique on the web service interfaces The reason we have chosen to do black box testing over white box testing is that even though we have access to all our code many parts of our code is LINQ queries of which we do not know how they will be compiled n The other part is that the branches that we do have in our queries are only for defensive programming and thus a good black box test will cover those as well Lastly it is because we needed to write a lot of valid data ourselves to test the many methods in different ways we could not use some kind of automated white box testing and manual white box testing would have taken too much time compared to the weight of testing While we have had some helper functions in the server in addition to the web service methods we have focused on testing the web service methods only The main reason is that the helper functions are small and not of great importance in addition to that they will be tested inside the web services In our testing of the server we have tried to cover as many use cases as possible doing both negative tests with invalid non existing and duplicate data and positive tests We have also tried to isolate many of the test methods to include one service method only but sometimes it was not possible e g SubmitQuestionAnswer is needed to SubmitSurveyAnswers Each of our test classes were structured in such way that they did an interaction with the
64. hould not make a difference All answers submitted and some when submitting a survey even if all answers deleted answers were submitted Ordinary survey true true Same as above Invitee email All answers submitted and then deleted again Ordinary survey true true For better reliability survey submission Invitee email should be idempodent Two submissions No Access survey RSVPException RSVPException One should not be able to submit a Invitee email survey one has not access to Mandatory mix survey RSVPException RSVPException One should not be able to submit Invitee email a survey without answering all No answer submitted mandatory questions Mandatory mix survey RSVPException RSVPException One should not be able to submit Invitee email a survey without answering all No mandatory answer mandatory questions even though one submitted has submitted other questions Mandatory mix survey One should be able to submit a Invitee email survey with all mandatory questions No ordinary answer submitted answered even though not all questions has been answered Mandatory mix survey A completed survey should allow a Invitee email submission All anwers submitted Mandatory only survey RSVPException RSVPException One should not be able to submit Invitee email a survey without answering all No answer submitted mandatory questions Mandatory only survey RSVPException RSVPException One should not be able to submit Invitee email a survey
65. hout fuzz Since both groups could see our agreements being written down in realtime this eradicated many errors We found that when we saw things 40 in writing it was very easy to understand each other and correct misunderstandings as they occurred instead of having to iron out the communication errors later We also had an overall good experience with Dropbox for sharing files However we did experience some smaller problems with the way we used it We had a shared folder for files which we at ITU thought would be for non document type files Now we realize that we didnt agree on which type of files to put in Dropbox this was an error from our team This did cause some confusion because where would we find the document we were looking for at Google docs or in Dropbox Our group at ITU tended to leave written documents to Google docs and only have drawings and odd file types on Dropbox Where as the SMU group placed both written documents in Dropbox and on Google Docs This is something that we will be more clear on in the future Basically we forgot to communicate what was in our heads we assumed that SMU thought the same This is a valuable lesson we will bring forward with us Our first video meeting with SMU went great primarily because we had access to ITUs video conferring system The quality of both video and audio was very good when using this system When we later tried to do our weekly meetings in Skype however the story was quite d
66. ifferent We learned that in order to do group video chat in Skype you need to have a pro account Something which we didnt have So instead we tried to gather around one computer at each university in order to overcome this obstacle But it didnt really work that great with the built in cameras in our computers We were simply to many persons in front of the computer The camera couldnt fit us all in its frame So what we learned from this was that either we should get Skype pro accounts or similar software Or we should have a more professional web camera What we ended up doing instead was to drop the video chat Instead we used a combination of audio and text chat Which actually worked very well As with the collaborative writing in Google docs it was nice to have text chat along with the audio This helped us break down language barriers Often just the pronunciation of words led to misunderstanding between our teams What struck us though after the first meetings was how much communication is lost when talking via video audio or text chat All the finer details of communication such as facial expressions tonality of the voice etc all these communication skills seemed impossible to benefit from with the tools we used It makes you realize how much you actually communicate with a person standing besides you without even talking Finally we used email for communication outside of the weekly meeting time slot We setup two email groups for ease of
67. in the manage questionnaire section there is both the creation of question naires and responding to them they should probably be split up in different tasks Generally the structure of this section is good the text gets around the purpose goal stakeholders and functional non functional requirements data model It is good that there is a picture at the start of the data model section as it provides an overview of the data model The data model is also so descriptive that one has the feeling that one knows all about it I would go as far as saying it is overly descriptive Many tables share the same similar attributes as ID that share functionality and repeated descriptions are thus not necessary Also some reflections are tautological e g on page 9 section 2 1 1 line 2 3 This statement and the like somehow leaves the impression that the text is underestimating the readers abilities 47 e Despite these unfortunate wordings the reasoning in the text seems very good and it has some valid arguments for the things written e We would suggest that instead of doing a description the way it is written now it should focus on more generally describing each relation and only highlighting special and non self explanatory attributes Reflection e Fine introduction simple and outlines what the reader is about to read e The text seems to have the SMU vs general collaboration parts reversed It says that there wasnt any problems right
68. ing the question Answer question with the option that has id optionID If a text question answer will contain the answer if not answer can be an empty string or null invitee requires email Throws Exception string s if invitee does not have access to the survey containing the question Call this when an invitee is finished with the survey Will return exceptions if mandatory questions are not answered describing which questions need answering Deletes a guest list and all invitees associated Returns true if successful and an exception if not Creates a new guest list associated with host host requires email password Returns true if successful and an exception if not Adds an invitee to host s guestlist with name guestListName invitee requires email host requires email password Throws Exception string s if unable to authenticate host or if guestListName doesn t exist Removes a invitee from host s guestlist with name guestListName invitee requires email host requires email password Returns true if successful and an exception if not string RSVP Service ViewGuestLists Host host Invitee RSVPService ViewInviteesFromGuestList string guestListName Host host bool RSVPService ChangeHostPassword Host host string newPassword Shows the name of all guestlists associated with host Host requires email password Optional parameters Host name Returns string if successful and an exce
69. inger Flertalsbestemning med tidsgr nse Samv r Sanktioner En 50 er bliver tilf jet til en pulje hvis man kommer mere for sent en 15 minutter uden at have givet lyd fra sig Puljen kan eventuelt blive brugt til at spise sammen efter projektet er f rdigt Kode konventioner e Projektledelsesmodel udviklingsmodel o Hvilken model arbejder vi ud fra o Fase opdelt Design e Brugere e Unikke link som passer til en email Roller e Mark Philip Andersen o mpan itu dk osiris mail dk o 2984 7167 e Martin Jeanty Larsen o 3074 7977 o martin jeanty dk e Anders Bech Mellson o 2211 6649 o anders bechmellson com e Nicolai Bo Skovvart o 2848 6086 o skovvart gmail com e Ahmad Salim Al Sibahi o 2521 3121 o asal at itu dot dk asal thegeek at gmail dot com Testing Vi tester hver gang en ny funktion er tilf jet Skal med fra starten Milestones e Datamodel o kig p Tofte s for inspiration e Ops tning af versionskontrol o Team Foundation Server m Codeplex m Vores egen Individuelle opgaver Start on your individual profile on the Wiki Read about the RSVP Case at ITU Appendix G Web services On the following pages you can find a list over the web services we agreed with SMU to implement on our server This version of the list is from the 22 03 2011 93 e Ton A bool RSVPService CreateHost Host host Adds a new host to the webservice host requires email password Optional parameters n
70. ion using pattern matching on the cases of m n as given to the right above What is the result of ack 3 11 Answer result is 16381 let rec ack m n match m n with Ou gt n lu Ou gt ack mlu lu GE gt ack mlu ack m n lu printfn A ack 3u 11u Exercise 15 The function time f unit gt a gt a TimeSpan below times the computation of f x and returns the result and the real time used for the computation let time f let start System DateTime Now in let res f in let finish System DateTime Now in res finish start Try compute time fun gt ack 3 11 Write a new function timeArgl fa a gt b gt a gt b x TimeSpan that times the computation of evaluating the function f with argument a Try timeArgl ack 8 11 Hint You can use the function time above if hide f a in a lambda function let time f let start System DateTime Now let res f let finish System DateTime Now res finish start printfn A time fun gt ack 3u 11u let timeArgl f a time fun gt f a printfn A timeArgl ack 3u 11u Exercise 16 Write a function inOrder a BinTree gt a list that makes an in order traversal of the tree and collect the elements in a result list Hint See slide for definition of in order type a BinTree Leaf Node of a
71. is manual describes how you respond to a survey invitation 1 If you have been invited to participate in a survey you should have recieved an email resembling the following example Click the link in the email to open the survey answering page PS Svar tilalle Videresend F j til kalender Slet Ikke u nsket Udskriv Forrige N ste Hr rsvpclient06 gmail com rsvpclient06 gmail com Tilf j kontaktperson 19 05 2011 14 33 Til martin jeanty dk Anders rsvp itu dk invites you to take a survey on Survey Pony Dear user please fill out the survey at this location http hotel itu dk Rsvp06_1 Survey Take STICZysyRWhrWnIBVIBDamlQOVI5b296bVIZbjNnU2c1 2 Example of a survey D SurveyPony Take survey C fi Q hotel itu dk Rsvp06_1 ManageSurveys TakeSurvey WXJxVzFVYWt0bmRaeUMzM1pGQzE1WC9jYXVFZ2UekY1 W QA Take survey Weird survey with many questions Do you want to participate Yes LiNo Do you really want to participate Yes really No really no Is this a good survey OYes ONo Cool stuff Oblafoo Hithere Input something in this text field This is another text field for arbitrary input Thisis an explanation 23 3 Fill out the survey as in the example below finish by clicking the Answer survey button Note Questions marked with a red asterisk are questions that you are required to answer If you don t answer one or more of thes
72. k to pick up the F language and has programmed the base of our code Besides being an excellent programmer he also showed great skills in help ing the rest of the group get up to speed with the coding and F skills He excelled at pair programming We didnt experience big technical issues while working We think it was because we had tested all the technologies before entering the collaboration with SMU We did have some minor glitches in our collaboration with SMU This was caused by the difference in our technical experience This led to some miscommunication about what our web services should be named and what functionality they should provide But we quickly overcame these problems and found solutions that benefited both parties 8 3 3 Experiences with SMU collaboration We have been pleased with our collaboration with SMU The majority of their group seemed very nice and was forthcoming As a whole we think it was a great collaboration It was however not without problems As briefly mentioned above the difference in coding experience between the teams was the biggest technical problem in the collaboration We at ITU are used to talking about code and its functionality Whereas it seemed that not everyone at SMU had the same level of code knowledge This quickly became a problem when we needed to do the web services An example was that SMU wanted a boolean returned every time a call was successful whereas we thought it would be better if they o
73. l null password Host false false No email or password specified Method bool CreateHost Host host input Expected output Actual output Explanation Host Email test email com Password 1234 Host Email bad example email Password Host Email bad example e Password Host Email bad example com Password Host Email bad example com Password Host Email ba d example com Password Host Email test exa mple com Password Host Email test exa mple com Password Host Email test exa mple com Password validHost Host email valid google email gmail com and password different password Host Email valid ema il Password Host Email valid ema il Password null Create a host that doesn t exist in the database already RSVPException RSVPException Invalid email host top level domain is too long to be considered valid RSVPException RSVPException Invalid email host top level domain is too short to be considered valid Invalid email local name must not start or end with a dot RSVPException RSVPException RSVPException RSVPException Invalid email local name must not start or end with a dot RSVPException RSVPException Invalid email local name must not have two subsequent dots RSVPException RSVPExc
74. lar Scrum for the remainder of the project Tracker supports daily meetings where we share ideas that can be broken down into tasks These tasks are then assigned to a member of the group Each development cycle is called a sprint and we decided to use a length of one week for every cycle Tracker seems to be very capable of handling the way we develop and work together 8 3 2 How did we perform as a group Before we started working on any design of our server we sat down as a group and formed a group constitution In this document we agreed on an overall structure of our group We identified and assigned individual roles work times and discussed sanctions if people were late This document See appendix F on page 89 has not been used much throughout the process but it formed the basis of what our group was And it has helped form a good working morale Throughout the process our group has been very focused professional and has kept our eyes on the target The overall rating of the groups performance is very satisfying Every piece of code has been tested rewritten and finalized into what we think is beautiful and clean code Even in the harder parts of the collaboration where SMU wanted to change the code into something we thought was worse our group prevailed and came up with solutions that would benefit both parties As a group we have had a tremendous boost because we were lucky to have an expert pro grammer in the group Ahmad was very quic
75. lers and the views will be covered by the integration tests In the testing of the models in our application we tried to test the model constraints we had put on for client side validation As we do not know how the constraints are implemented by the framework and wanted to test that we did have enough constraints and that the constraints we have were valid the only real option was to use extensive black box testing The way we tested the models was simple as we mocked a controller created the model with the variables we wanted to test and then passed the model to the controller Afterwards it was just an option to check if the ModelState a validation state that the controller has for checking model integrity was valid As with right to the helpers it would seem that we could have used white box testing as we had written all of them ourselves While some of the more complicated methods could be white box tested we chose to emphasize testing functionality with black box tests as they would be faster to write and also enables the mentality to test for special input like null values we might have missed checking in our branches It should be noted that we did not test very simple helper methods as many of the only gave readability and maintainability for some of the code as opposed to much functionality In the end unit testing our clients models and helpers made us uncover some of the hidden errors in our client application proved that man
76. let y15 explode star B let rec explode2 s string if s Length 0 then else let i s Chars 0 let q s Remove 0 1 i explode2 q let y16 explode2 star Exercise 11 let rec foldr f b xs match xs with gt b x xs gt f x foldr f b xs let implode xs char list xs gt foldr fun el acc gt el ToString acc let y17 implode a b c B let implode2 xs list lt char gt List foldBack fun el remaining gt el ToString remaining xs let y18 implode2 a b c let rec foldl f b xs match xs with gt b x xs gt foldl f f x b xs 72 let implodeRev xs list lt char gt xs gt foldl fun el remaining gt el ToString remaining let y19 implodeRev D let implodeRev2 xs list lt char gt List fold fun remaining el gt el ToString remaining xs ats bts te j let y20 implodeRev2 ae a O Exercise 12 A let toUpper str string explode str gt List map System Char ToUpper gt implode let y21 toUpper test B let toUpperl str string explode gt gt List map System Char ToUpper gt gt implode str let y22 toUpperl test O let toUpper2 str string str gt implode lt lt List map System Char ToUpper lt lt explode let y23 toUpper2 te
77. list match list with xl x2 xs gt xl x2 combinePair xs laa printfn A combinePair 1 2 3 4 5 Exercise 10 Write a function explode string gt char list so that explode s returns the list of characters in s explode star ll s t i a r Hint if s is a string then s ToCharArray returns an array of characters You can then use List ofArray to turn it into a list of characters Now write a function explode2 string char list similar to explode except that you now have to use the string functions s Chars or and s Remove where s is a string The definition of explode2 will be recursive let explode string string List ofArray lt char gt string ToCharArray let rec explode2 s string match s Length with 1 gt s 0 gt s Chars 0 explode2 s Remove 0 1 printfn A explode Batman printfn A explode2 Robin Exercise 11 Write a function implode char list gt string so that implode s returns the characters concatenated into a string implode a b c jra abc Hint Use foldr from lecture Now write a function implode2 char list string similar to implode Now you just have to use the build in List operation List foldBack The functions foldr and foldBack are similar except for their type hence the way arguments are given Now write a function implodeRev char list string so
78. lst function in Survey module which fetches the data for the given survey from the database if the host authenticates WS returns a string containing the survey results if everything went well otherwise an exception is thrown with a message about what went wrong e View Surveys Client calls ViewSurveys WS with host email password WS invokes viewSurveys function in Survey module which fetches the ids of surveys for the supplied host if he authenticates WS returns an array of Surveys if everything went well otherwise an exception is thrown with a message about what went wrong e Submit Remove Question Answer Client calls SubmitQuestionAnswer RemoveQuestionAnswer WS with optionId for the question invitee email and answer for the first of the two WS invokes submitQustionAnswer removeQuestionAnswer function in the Survey Answer module which ensures that the invitee is valid and is part of the survey which contains the question WS returns true if everything went well otherwise and exception is thrown explaining what went wrong e Create Delete Guest List Client calls CreateGuestList DeleteGuestList WS with host email password and the name of the guest list WS invokes createGuestList deleteGuestList function in GuestList module which per forms the query to the DB if the host authenticates WS returns true if everything went well otherwise an exception is thrown explaining what went wrong e
79. lure explanation that password cannot be blank Creation failure explanation that passwords do not match Creation failure generic failure responce Creation succes message that email was send no such thi No update no ex ing happens planation No update no explanation Succes Account is deleted em Explanation that lanation that syntax is not lanation that password Fixed Category Create survey Participants management Take survey Miscellaneous Input Click add new question Change question type Add an option Create survey with invalid characters in survey name Create survey with valid title and a combination of questiontypes and a variable amount of options per question Clicking manage participants Add participant with bad email syntax Add participant with right email syntax Send email to single participant Send email to all participants Remove participant Taking a survey without all mandatory questions answered Taking a survey with all mandatory questions answered Expected output A new area for entering a new question appears Parameters change according to the question A new area for entering a new option appears Creation failure explanation that the title contains invalid characters Succes Participants are shown Participant not added explanation that syntax is wrong Participant is added Email is sent Email is sent to all participants Participant is
80. maximum amount of answers on specific questions e Support for one to one mapping between questions and options in matrices i e one can not select the same option twice for two questions in a matrix e Support for start and expiry dates of surveys In the long run one feature we really wanted to do was to support advanced statistical compu tations from our client This includes filtering results for a question according to answers given in an other question statistical accuracy and the ability to approximate statistical distributions for a given set of answers e g the normal distribution with average and variance 9 2 2 Functionality Functionality wise there is some things we wanted to improve in our client but in the urge of time was excluded The first functionality in our client which could be improved is survey creation In survey creation we wanted to implement a live preview function so that when one had finished writing a question the user would have a better idea on how it would be displayed to the client and maybe choose a better question type Another thing that could be improved was an easier way to edit surveys as now one has to delete the old one and then create a new survey and add the participants again which could be easily automated behind the scenes 9 2 3 Security In the end there could also be small improvements of security in our application The way our applications work now is that the web services
81. n they werent so sure that their professor approved on using XML instead This behavior caused quite some problems throughout the project as they didnt always read the documents we used for communicating with them either Often their project leader would ask us to do things we already had done and documented The most heated discussion with them came as we were about to finalize our agreements on the web services We had a shared document with the description of all the services See appendix G on page 93 And we wanted to agree on the contents before coding It was very hard to finish this document because they were very slow in reading it and giving their feedback When they finally approved it they had their technical person approve it A couple of days after that their leader wanted to change a lot in the services again This was quite annoying since the changes were not very relevant and because they had already approved it But his mind was set and we had to implement these changes in order for the collaboration not to break down What went well though was the general communication with the rest of their group Especially the communication with their technical person was very good He was always polite effective and constructive There were also two other persons in their group but we never really talked to these two directly Next time we are going to do international collaboration it is essential to break down the decision structure befo
82. nding on the direction 18 let rec fold f b xs match xs with gt b x xs gt foldl f f x b xs 84 let foldInOrder f acc tree tree gt inOrder gt foldl f acc 19 type expr Const of int Prim of string expr expr let rec eval expr match expr with Const i gt i Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt if eval exprl eval expr2 then 1 else 0 Prim min expr1 expr2 gt System Math Min eval exprl eval expr2 Prim max exprl expr2 gt System Math Max eval exprl eval expr2 Prim opr gt printfn Operation_ s_not supported opr 0 20 eval Prim Const 32 Const 51 eval Prim Const 51 Const 51 eval Const 34 21 type expr Const of int If of expr expr expr Prim of string expr expr let rec eval expr match expr with Const i gt i Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt if eval exprl eval expr2 then 1 else 0 Prim min exprl expr2 gt System Math Min eval exprl eval expr2 Prim max exprl expr2 gt System Math Max eval exprl eval expr2 Prim opr gt printfn Operation s _not supported opr 0 If ex
83. ngly It should evaluate el and bind the result value to x and evaluate e2 with new environment printfn A eval Bind x Const 1337 Prim Var x Const 3 printfn A eval Bind x Const 1337 Bind y Const 22 Prim Var x Var y printfn A eval Bind x Const 1337 Bind x Const 5 Prim Var x Var x printfn A eval Bind x Const 1337 Bind x Const 5 Prim Var z Var q System Console ReadLine gt ignore 81 D 5 Anders You can download the source code online here http d pr U2wu FA Exercises Anders Bech Mellson anbhQitu dk 1 let sqr x x X 2 a let pow x n let pow x n System Math Pow x n System Math Pow x n b let pow2 x n int System Math Pow float x float n gt c Virker kun paa positive vaerdier let rec pow3 x n if n 0 then 1 else x pow3 x n 1 Virker paa negative vaerdier men den afrunder pga int let rec pow3 x n if n 0 then 1 else if n gt 0 then x pow3 x n 1 else pow3 x n 1 x Med float virker nu paa negative vaerdier Kan dog kun kaldes med hele talv ae rdier som b eg 1 0 4 0 let rec pow3 x n if n 0 0 then 1 0 else if n gt 0 0 then x pow3 x n 1 0 else pow3 x n 1 0 x 3 Hvis man bruger defaulter den til int Bruger man defaulter d
84. nly got an exception if the call failed We ended up doing both since they insisted on having the boolean returned Our biggest communication problem with SMU came about because of the way they had structured their group internally We never got any confirmation of how they handled their internal group on paper so this next part is just how we think it was handled based on our working experience with them They had appointed one guy as their leader which handled all communication and decision making This was a big problem firstly because of the bottleneck effect Secondly because the appointed person didnt seem to have a lot of technical experience This led to many confusing discussions as we were talking together but not understanding 42 each other We could have a meeting with him agree on something Then when we later talked about it again he couldnt understand what we were talking about Another problem was that they didnt seem to read through all the needed documents An example was that they told us in the beginning of the project that is wasnt mandatory for them to use the TEMPLATE language They said they would rather use XML which was okay with us as long as they had got an approval from their professor which they assured us they had We asked to see their mandatory requirements just to clarify since we were told otherwise by our professor In that document it stated they had to use TEMPLATE We explained this to them and the
85. ns that could access both the server and the client A client application that would allow users to take a survey on their mobile phones seems like something that could benefit the system And if administrators could create surveys and see statistics on their mobile devices this would surely be an added value 9 2 Code improvements In relation to code improvements there are three main areas that mainly could be looked at for improvement 1 features 2 functionality and 3 security 9 2 1 Features While our data model is rich enough to support many types of question types and formatting in the end our client only supported the four given types Select Check Boxes Explanation and Text If we had more time to improve our functionality we would first complete the implementation of the matrix type of questions This is because we already had extended the template parser to support it and only needed to output it as such in the XML in the web services and then of 44 course implement the client support In addition there are also a lot of small features we have not extended the template parser to support but which our datamodel supported including some of which our client already supports e Support for multiple pages e Support for other types of questions e Support for other answer types in the select and radiobutton question types e Support for specifying input as numerical e Support for minimum and
86. nt page Layout etc 1See the sample code online here http d pr xhGf 88 Appendix F Group constitution Unfortunately our constitution in danish But we have added it anyway hoping that the danish language is ok in this part The constitution follows on the next pages 89 RSVP Vi skal lave e Server o Skal underst tte et dom ne f eks test statistik afstemninger planl gning e Klient o Skal kunne kommunikere med serveren serveren skal ikke miste funktionalitet som Singaporianerne benytter e Beskrivelse af serveren og hvordan den skal bruges o SOAP REST e Datamodel o Deadline 1 Marts inkl testdata e Rapport vigtig Gruppekonstitution Organisation Roller ansvarlige Klient Mark Martin Server Nicolai Ahmad Testing Ahmad Dokumentation UML kodekommentarer Martin Teknik server admin Mark Projektleder Anders Kontaktperson Nicolai Rotation Foretages l bende efter behov M dested IT Universitet 3 sal Diskussioner Tidsbegr nsning med skiftende ordstyrer Dokumentation XMLDoc til metodesignaturer UML til overordnet programstruktur s som F moduler og namespaces Nar vi kender F bedre kan vi bestemme hvordan vi dokumenterer systemet overordnet Arbejdsblade til storre avancerede komponenter Referat fra m der Aftaler fx efter diskussion Korrekt kildehenvisning Arbejde Arbejdstider Forel sning 3 4 timer efter slut Normal 10 00 16 00 Beslutn
87. nts authenticate web service method SMU will consider the client handling email ITU will make an example on how to use webservices without parsing xml SMU will make a sample of answer structure probably xml 4 Next Meeting Target Date March 21 2010 Monday pines aa eae Mae Conference Page 2 of 2 Meeting Minutes 4 ITU Project Date of Meeting March 21 2011 Venue of Meeting Online conference Time of Meeting 1600 hours Minutes Prepared By Lim Chee Ning gt Project updates gt Web services request Name Attendance Alvin Chua Lim Cheening Absent with Reason Kang Kai Xin Absent with Reason Gabriel Yee Nicolai Martin Ahmad Mark Anders Common understanding Host amp invitees are the same host can be invitee invitee can be host invitee not need password oncreate survey system will check user for password see if they have account else system will prompt user to create account after creating acc will auto login and user able to create survey e ITU Page 1 of 2 SMU o Meeting Minutes 4 ITU will make sure that authentication and registration is working on the webservice for SMU to test by March 21 2011 ITU will finalize renaming web service methods to use common terms ITU will add an update password webservice method ITU will use exceptions where needed SMU will create suggestions for survey id xml and statistics xml For detail information please check
88. number of answers accepted for this question IsNumeric Is the question a numeric type e g what is your age e Type Which type is this question Id Unique identifying number Name Name of the question type e Option Subtype of question Can contain more text or an other field Id Unique identifying number IsOther Is this an other field 50 Appendix C Meeting Logs and agendas On the next pages you will find all our meeting logs and agendas from the SMU collaboration We have excluded a longer chat log from the 22 03 2011 but it can be found online see this footnote lnttp cl 1ly 6ohL Chat log from the 22 03 2011 51 Agenda for 24 03 11 Video Conference o Tests how will SMU test our webservice methods so we re sure everything works as intended and that we are in agreement on the method s behavior E g sample code we will provide sample code for each webservice method however Reporting of any bugs etc o Is it ok to use attributes in XML does everybody know how this works Agenda for 21 03 11 o Finalize various XML contracts such as the response from creating surveys and the format in which statistics will be presented Agreements for 21 03 11 o ITU will make sure that authentication and registration is working on the webservice for SMU to test ITU will finalize renaming web service methods to use common terms ITU will add an update password webservice method ITU will use exceptions
89. o improve distributed work Host fs contains various methods to create delete and alter host accounts Survey fs contains 30 methods to create delete and view surveys as well as some other methods for example view statistics for a survey It also contains the module Invitee that contains methods to view add and delete participants from a survey and the module Answers that contains methods to submit answers remove answers as well as completion of the survey It uses this approach for clients that allow partial answers to surveys to allow completion later We did not however have time to add a way to get the partial answers returned from the service We also have a Utility module with help methods that the various modules are utilizing such as password hashing email validation user validation and so forth Survey fs is also utilizing the provided Template parser that exists in a seperate F project The parser has been slightly modified and also supports the question type Matrix that allows for grid questions We did not however have time to implement this in the client The parser now also interprets underscores in the survey name as spaces on request of the Singapore team 6 1 1 Data insertion Insertions is generally just querying the database and requiring proper authorization Authorization is accomplished by requiring a Host struct containing a host email and pass word First a check is done to ensure that the email passwor
90. ormal submission should work fine Submit question answer should be idempodent and thus work with multiple submissions One should not be able to submit an answer to an question that doest not exist One should be able to submit a normal answer to a text question One should not be able to submit an answer with no text to a text based question One should not be able to submit an answer with no text to a text based question One should not be able to submit an answer with whitespaces to a text based question input Expected output Actual output Explanation optionld Valid option Id inviteeEmail Invitee email optionld Invalid option Id 1 inviteeEmail Invitee email true true RSVPException RSVPException A normal removal should work fine Removing an answer for a question one has not access to should not be optionld Valid option Id inviteeEmail Invitee email question not answered optionld Valid option Id RSVPException inviteeEmail Invitee email survey has been submitted RSVPException FIXED RSVPException Removing an answer for a question one has not answered should be ok and idempotent if one has already removed an answer to a question one has answered One cannot modify a questions answer after one has submitted the survey 114 H 2 Client unit tests Models ModelName AuthenticationModels_ChangePasswordModel Expected Actual output Explanation
91. other side of the world The collaboration process had its difficulties but we have learned from this And in the future we are now more prepared to work in an international team The video meetings arranged by the professors worked very well we think that more scheduled meetings in the conference rooms would benefit the process We would like to have seen SMU s requirements document when we started working together We think it would be nice to have all official requirements on the wiki We also had some technical issues with the server provided from ITU A working server throughout the project would improve the process In spite of minor technical glitches and collaboration issues we have had a great experience Our overall conclusion is that the project was a success We have learned a lot and are grateful of that 46 Appendix A Review report RSVP06s review of RSVP02s draft Requirements specification Fine introduction that explains why requirements are important Vaguely specified business goal the only requirement is that usability must be considered what about requirements related to survey results Stakeholders the text specifies these but there is no relation to specific requirements which takes each group into consideration E g its important that representatives of the employees are included in the usability test Tasks gives a fine picture of what the system must support but the text is mixing some things together
92. p you get started with SurveyPony please visit the help section To manage your account please visit the account page To manage your surveys please visit the survey management page To log out or switch users please go to the logout page 17 5 2 Create Account The following section describes how to create a new account in the RSVP system so that you can start creating surveys 1 If you don t have an account already you will have to click the Create a new account link on the frontpage C ft O hotel itu dk Rsvp06_1 Remember password ona or Create a new account 2 Type in a valid email address and the password you wish twice to confirm finish with Create Account E SurveyPony Create gt C fi hotel itu dk Rsvp06_1 Home Create Create new account Email morten jensen dk Password 18 3 Given you ve typed a valid email address your account has now been created and you should see the following page D SurveyPony Index Z Account was created successfully You can now login Login Email Password Remember password ona or Create a new account 19 5 3 Manage Surveys Create Survey This manual explains how to create a survey and specifies the different types of questions in the RSVP system 1 From the My Surveys menu you can create a new survey by clicking the Create new survey link
93. prl expr2 expr3 gt if eval exprl lt gt 0 then eval expr2 else eval expr3 22 type expr Const of int If of expr expr expr Bind of string expr expr Var of string Prim of string expr expr let rec lookup env y match env with gt failwith Unknown variable y x v rest gt if x y then v else lookup rest y let rec eval expr env match expr with Const i gt i Prim exprl expr2 gt eval exprl env eval expr2 env Prim exprl expr2 gt eval exprl env eval expr2 env Prim exprl expr2 gt if eval exprl env eval expr2 env then 1 else 0 Prim min exprl expr2 gt System Math Min eval exprl env eval expr2 env Prim max exprl expr2 gt System Math Max eval exprl env eval expr2 env Prim opr gt printfn Operation_ s_not supported opr 0 85 If exprl expr2 expr3 gt if eval exprl env lt gt 0 then eval expr2 env else eval expr3 env Bind string exprl expr2 gt eval expr2 lt string eval exprl env env Var string gt lookup env string 86 Appendix E Responsible persons This is a list of our individually responsible areas of the project We all have many overlaps so this is not a completely accurate picture only a birds view on which key areas we each have been responsible for e Ahmad Test manager Coding the plu
94. ption if not return exception if Host has no guest list exception message No guest lists available Show all invitees belonging to a host s guestlist with name name Host requires email password Returns invitee if successful and an exception if not return exception if list has no invitees exception message No invitees available Change the password for host Host requires email password Password can be null or an emptystring but newPassword must not be null or an emptystring Throws Exception string s if unable to validate host 98 Appendix H Testing plans H 1 Server unit tests Test plan Server GuestListTest Shared Data Service A default RSVPService object Host A Host object created with following email Aa bb cc and password 12512 Surveyld The id of the survey created with following template template main begin end MethodName bool CreateGuestList string name Host host input OERS Expected output Actual output Explanation name testguestlist True True Create a guest list on a valid host host Host Legit host dk 1234 name testguestlist RSVPException RSVPException Create a guest list on a non existing host host Host NonLegit host dk 1234 name testguestlist RSVPException RSVPException Create guest list on a valid host with wrong password host Host Legit host dk 4321 MethodName
95. question Clicking manage participants Add participant with bad email syntax Add participant with right email syntax Send email to single participant Send email to all participants Remove participant Taking a survey without all mandatory questions answered Taking a survey with all mandatory questions answered Attempt to take a survey that has already been completed Clicking help link Visiting Home Logout Delete survey Click statistics link Viewing graphs for statistics that has options with no text Expected output A new area for entering a new question appears Parameters change according to the question A new area for entering a new option appears Creation failure explanation that the title contains invalid characters Succes Participants are shown Participant not added explanation that syntax is wrong Participant is added Email is sent Email is sent to all participants Participant is removed Error that not all mandatory questions are answered Succes Notice that it has already been completed and cannot be taken again Help page is shown User is logged out Survey is deleted Statistics for the survey is shown No text being used Actual output Fixed A new area for entering a new question appears Parameters change according to the question A new area for entering a new option appears Creation failure explanation that the title contains invalid characters Succes Participants a
96. question and q 0 o 0 for the first option for the first question we still had to identify them using our source code We came up with a solution of using regular expressions to identify a form key depending on the notation we used and then we had to solve how to add information for a question Our solution was to create an intermediate type storing the information in there and using a sorted map with an integer identifying the ordering of the question as key and the intermediate question type as values For easier conversion to template we made each question be able to convert itself dependent on its type The only thing that was left was to assemble the full template with a name and call the web service to create the survey 2The Document Object Model http www w3 org DOM 35 Chapter 7 Test strategy To ensure that our applications work as intended we have created a series of tests to try and test out the RSVP web services on the server and our implementation of the RSVP client For the server part we have chosen to only do unit testing of the most important methods as many methods are called independently of others and integration should be achieved if every tested method work For the client part we have chosen a model view controller pattern and thus we are testing each important part of the three layers model view controller 7 1 Server 7 1 1 Unit test For the unit testing of the server part of our program we
97. rality of web services Coding following things in the client Forms to template conversion In collaboration with Martin Authentication and account management Charting and statistics of surveys Sections of this report Technical description Client x Testing Code improvement e Martin Coding of some web services and tests Coding following things in the client Help section In collaboration with Ahmad Authentication and account management Charting and statistics of surveys Sections of this report Requirements User manual e Nicolai 87 Contact person between the group and the course manager Sections of this report Problem explanation and background Interface design analysis Integration tests Coding the following things in the client Layout x Survey listing Survey creation page Take Survey Integration test bug fixes e Mark Server master admin Coding of some web services Coding following things in the client x Participant management module Testing of parts of Server and Client Sections of this report x Problem Analysis e Anders Project Manager Communication and agreements with SMU Example code of all web services Coding of some web services Setup of reports in LaTeX Sections of this report Preface and introduction Data Model Documentation of communication x Appendixes Fro
98. rd Confirm new password rs uns Delete account Delete account 29 Chapter 6 Technical Description 6 1 Server The purpose of the server is to handle data Thus it must support methods for supporting insertion and extraction of data The server should be able to display create and delete surveys as well as fetching the results of a survey It should also allow people to answer surveys It should also allow listing adding and removing participants from a survey The web services of the server is implemented in F using the ADO NET entity framework for object relational mapping The actual services are exposed in C using ASP NET web services The reason for using ASP NET web services is because of issues with exposing web services natively from F All services are structured hierarchically in modules but there is a super module WebSer vice fs that gathers all methods for the C class to expose via the ASP NET web service A Server F A Server C C dass Kk RSVPService asmx cs WebService 1 1 WebServicess Y WebService fs WebService fs 1 1 WebService fs 1 Host fs 1 Survey fs 1 Guestlistfs 1 y m y y Host fs E Survey fs Y GuestList fs Hosts 1 Survey fs 1 Guestlistfs 1 Utilityfs 1 Utilityfs Y Utility fs Utilityfs 1 1 Figure 6 1 Illustration of the structure of the server The reasoning behind the module structure was to logically separate methods and t
99. re shown Participant not added explanation that syntax is wrong Participant is added Email is sent Email is sent to all participants Participant is removed Unfiltered exception with the first thing to fail spelling error Y Succes Notice that it has already been completed and cannot be taken again Help page is shown User is logged out Survey is deleted Statistics for the survey is shown Graph breaks Y
100. rehand It made absolutely no sense that their leader should overrule great decisions their team had already made But since its an internal thing for each team to decide its probably not something we have any influence on Some of the positive things we can take into our next ventures are things like written agree ments email forwarding and our general use of collaborative tools 43 Chapter 9 Recommendations In this chapter we have identified a couple of things that we think could have been better We think these could improve a future revision of the system The recommendations was something we could have done if we had more time to work on the project 9 1 System improvements Usability testing was something we didn t manage to fit in our schedule for the client development Usability testing could have have improved the user experience of the program The problem is that we think as programmers because we are And since we have written the program ourselves we are blind to the usability problems the client surely has The user experience of the client could also be vastly improved if we worked more on the interface design This is a natural extension of usability testing where to place buttons which areas to highlight and so on Unified login would also be an improvement both to the server and the client We could sup port OpenID or Google login which prevents the user from having too many logins to remember Mobile applicatio
101. removed Error that not all mandatory questions are answered Succes Notice that it has already been completed and cannot be Attempt to take a survey that has already been completed taken again Clicking help link Visiting Home Logout Delete survey Click statistics link Viewing graphs for statistics that has options with no text Help page is shown User is logged out Survey is deleted Statistics for the survey is shown No text being used Actual output Fixed A new area for entering a new question appears Parameters change according to the question A new area for entering a new option appears Creation failure explanation that the title contains invalid characters Succes Participants are shown Participant not added explanation that syntax is wrong Participant is added Email is sent Email is sent to all participants Participant is removed Unfiltered exception with the first thing to fail spelling error Y Succes Notice that it has already been completed and cannot be taken again Help page is shown User is logged out Survey is deleted Statistics for the survey is shown Graph breaks Y Category Create survey Participants management Take survey Miscellaneous Input Click add new question Change question type Add an option Create survey with invalid characters in survey name Create survey with valid title and a combination of questiontypes and a variable amount of options per
102. rnet working globally is also an increasingly seen trend Global development has been seeing increased exposure as it potentially allows for development on all 24 hours of the day Using software development teams in other countries can potentially have a positive economic effect for organizations For this project we ve been working with both of these areas We have in cooperation with a software development team in Singapore been developing an online RSVP system r spondez s il vous plait also known as a survey system The Danish team has been developing a web service that allows for a variety of clients to perform surveys while the Singaporian team has been developing a client to be used with the server A client could be created using everything from web development programming languages such as PHP or ASP to more graphically oriented solutions made in for example Microsoft Silverlight or Adobe Flash to regular programs running on desktops or even mobile devices such as phones or tablets The only requirement for a client is that it can communicate with web services over the internet Some goals we ve had for the survey system was for it to be super flexible allowing a wide range of various clients to present themselves in ways that make sense for that particular client This has been a great influence in our design of everything from the data model to the exposed web services and where we ve placed the responsibility for analyzing data Beca
103. rollers H 3 Integration test 123 Category Authorization Login Create user Manage account Input Visiting Survey while not logged in Visiting Home ManageAcount while not logged in Visiting Home Create while logged in Visiting Home Create while not logged in Visiting Survey while logged in Visiting Survey Create while not logged in Visiting Participan Visiting Participan Visiting Participan logged in Visiting Participan you don t own Visiting Participan while not logged in Visiting Participan a survey you don t Visiting Participan Visiting Participan gt gt PPP gt Q gt ecked 2RRXR eZ gt empt to change A Attempt to change Attempt to change Index xxx while not logged in Index xxx on a survey you don t own SendMailEveryone xxx while not SendMailEveryone xxx on a survey SendEmail xxx email xxx DxxxX xX SendEmail xxx email xxx xxx xx on own Create xxx while not logged in Create xxx on a survey you don t own empt to log in using invalid user name email syntax empt to log in with no password empt to log in with non existing user empt to log in with existing user wrong password empt to log in with existing user right password empt to log in with Remember password checked empt to log in with Remember password not empt to create a user with invalid email syntax empt to create a user with a blank password empt to
104. rue and 0 when false type expr Const of int If of expr expr expr Prim of string expr expr Var of string Bind of string expr expr let rec replace scope str value match scope with Var x when x str gt value Var x gt Var x Prim opr exprl expr2 gt Prim opr replace exprl str value replace expr2 str value If cond exprl expr2 gt If replace cond str value replace exprl str value replace expr2 str value Bind str exprl expr2 when str lt gt str gt Bind str replace exprl str value replace expr2 str value Bind str exprl expr2 gt Bind str exprl expr2 Const i gt Const i let rec eval expr match expr with Const i gt i 80 Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt eval exprl eval expr2 Prim max exprl expr2 gt if eval exprl gt eval expr2 then eval exprl else eval expr2 Prim min exprl expr2 gt if eval exprl gt eval expr2 then eval expr2 else eval exprl Prim exprl expr2 gt if eval exprl eval expr2 then 1 else 0 Prim opr gt printfn Operation_ s not supported opr 0 If cond _ expr when eval cond 0 gt eval expr If exprl expr2 _ gt eval expr2 Bind str value scope gt eval lt replace scope str value gt 0 Exercise 20 Write more
105. s based on the WPF Windows Presentation Foundation framework which can been seen as a successor or an upgrade to the older Windows Forms Siverlight feels like a normal application you would have running on your computer but the key difference is that it is hosted on the web instead the framework is easy to use if you already have experience with developing applications using Windows Forms Some other options include ASP NET which is essentially web pages that utilizes the NET platform and thus can make use of all the NET features and languages like C Our choice on what we wanted the client to be fell on web based solution under ASP NET as this appealed to the majority of the group ASP NET also provides a more managed design oriented approach for development webpages called ASP NET MVC and having already coded our web services in ASP NET this seemed like a natural choice MVC incorporates the Mod el View Controller design pattern whose purpose is to separate the programs domain logic from the user interface providing easier extendibility and overview Testing is also made easier when developing using this pattern as the components can be tested seperately 14 Chapter 5 User manuals and examples In this section we have created user manuals to help users understand how the system works and at the same time provide walkthroughs of the various parts of the system The RSVP system can be reached at http hotel itu dk Rsvp06_
106. s in different orderx Excercise 18 let foldInOrder f acc tree tree gt inOrder gt List foldl f acc Exercise 19 22 type expr Const of int If of expr expr expr Bind of string expr expr Var of string Prim of string expr expr let rec lookup l key match with k v t gt if k key then v else lookup t key gt failwith Unknown variable _name key let rec eval expr env match expr with Const i gt i If exprb exprl expr2 gt if eval exprb env lt gt 0 then eval exprl env else eval expr2 env Bind varname exprl expr2 gt eval expr2 varname eval exprl env env Var varname gt lookup env varname Prim exprl expr2 gt eval exprl env eval expr2 env Prim exprl expr2 gt eval exprl env eval expr2 env Prim max exprl expr2 gt System Math Max eval exprl env eval expr2 env Prim min exprl expr2 gt System Math Min eval exprl env eval expr2 env Prim exprl expr2 gt if eval exprl env eval expr2 env then 1 else 0 Prim opr gt printfn Operation_ s_not supported opr 0 Examples let 24 2 Prim Const 2 Const 2 let x 10 y 5 x y Bind x Const 10 Bind y Const 5 Prim Var x Var y let Overshadow example x 10 y 5 x 3 x y Bind x Const 10 Bind
107. s with the same created twice questions template none given RSVPException RSVPException One cannot create a Host default survey without a template description template RSVPException RSVPException One cannot create a Host default survey without a template description template invalid RSVPException RSVPException One cannot create a survey Host default with invalid template template survey with mixed RSVPException RSVPException One cannot create a survey questions with an invalid host Host invalid Method Name string GetSurveyQuestions int surveyld Method General Data Survey with no questions template emtpy_test_survey begin end Survey with mixed questions template mandatory_mix_test_survey begin mandatory select Do you like testing Yes No explanation You may not like testing but checkboxes What type of testing do you prefer Whitebox Blackbox Unit Automated Contracted text How much do you like testing end input Expected output Actual output Explanation survey survey with no valid survey question XML valid survey question XML questions survey survey with mixed valid survey question XML valid survey question XML questions suvey non existing survey RSVPException RSVPException Te Method Name string GetSurveyResults int surveyld Host host Method General Data Survey with mixed questions template mandatory_mix_test_survey begin mandatory select Do
108. sponse to a survey question Retrieving results for a given survey 2 4 Use cases e Create Delete Host Client calls CreateHost DeleteHost WS with email and password WS invokes CreateHost DeleteHost function in Host module Controller performs DB query needed to create or delete the host WS returns true if everything went well otherwise an exception is thrown with a message about what went wrong e Authenticate Host Client calls AuthenticateHost WS with email and password WS invokes authenticateHost function in the Utility module which queries the DB to check if the passed parameters corresponds to a valid host and the password is correct WS returns true if the host authenticates otherwise an exception is thrown with a message about what went wrong e Create Survey Client has filled out the create survey form and calls CreateSurvey WS with email password and survey contents in the Template language WS invokes CreateSurvey function in Survey module including submitted data The function parses the data into SQL which is written to the Database WS returns the Id of the created survey to the Client if it went well otherwise an exception is thrown with a message about what went wrong e Delete Survey Client calls DeleteSurvey WS with surveyld username and password WS invokes deleteSurvey function in the Survey module which queries the DB to check if the survey exists and the supplied user authentica
109. st Exercise 13 let palindrome str string str ToLower implodeRev lt lt explode str ToLower let y24 palindrome Anna true let y25 palindrome Ann false Exercise 14 let rec ack x y match x y with 0 n gt y l x 0 gt ack x 1 1 x y gt ack x 1 ack x y 1 let y26 ack 3 11 Exercise 15 11 A let time f let start System DateTime Now let res f let finish System DateTime Now res start finish let y27 time fun gt ack 3 11 73 B let timeArgl f a let res start finish time fun gt f a res finish start Exercise 16 type a BinTree Leaf Node of a x a BinTree a BinTree let rec inOrder tree match tree with Leaf gt Node v 1 r gt inOrder 1 Q v inOrder r Exercise 17 let rec mapInOrder f tree match tree with Leaf gt Leaf Node v 1 r gt let lv maplnOrder f 1 Node f v lv mapInOrder f r Exercise 18 let foldInOrder f remaining tree tree gt inOrder gt foldl f remaining Exercise 19 type expr Const of int Prim of string expr expr let rec eval expr match expr with Const i gt i Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt eval exprl eval expr2 Prim exprl expr2 gt if eval exprl ev
110. st gt if x y then v else lookup rest y let rec eval env expr match expr with Const i gt i Prim exprl expr2 gt eval env exprl eval env expr2 Prim exprl expr2 gt eval env exprl eval env expr2 Prim max exprl expr2 gt System Math Min eval env exprl eval env expr2 Prim min exprl expr2 gt System Math Max eval env exprl eval env expr2 Prim exprl expr2 gt if eval env exprl eval env expr2 then 1 else 0 If exprl expr2 expr3 gt if eval env exprl lt gt 0 then eval env expr2 else eval env expr3 Var a gt lookup env a Bind var exprl expr2 gt eval var eval env exprl env expr2 Prim opr gt printfn Operation_ s_not supported opr 0 Some examples 100 100 eval Prim Const 100 Const 100 100 100 eval Prim Const 100 Const 100 100 100 eval Prim Prim max Const 1 Const 100 Prim min Const 100 Const 1000 5 if 100 100 then 9000 else 8999 eval 1f Prim Prim max Const 1 Const 100 Prim min Const 1000 Const 100 Const 9000 Const 8999 a 100 b 100 a b eval Bind a Const 100 Bind b Const 100 Prim Var a Var b 33 o 70 D 3 Martin Author Martin Jeanty Larsen mjla itu dk Exercise 1 let sqr
111. t As we have chosen the ASP NET MVC framework to program our client in it seemed natural to code our client according to the Model View Controller architecture pattern The model view controller architecture pattern is a pattern for separating the main concerns in an application manipulating data using business logic the model presenting the application through an interface the view and managing user input and executing requests by communi cating to the two layers the controller This pattern has multiple advantages 1 it enables readability and maintainability of code as changing business logic only happens one place and adding another UI would not change the base logic 2 it enables better testability because of the independence of the three modules thus making testing logic and presentation easier and finding errors faster and 3 lastly it allows independent development of user interface and business logic which allows easier distribution of work items To achieve the optimal usage of the framework we had tried to adhere as strictly as possible to this pattern but chose also to refactor some of the most used functionality in the controllers into helper classes for more reusability Furthermore we focused on making the controllers the only part that communicated with the web services which also present some kind of bussiness logic to ensure the maintainability of our client 6 2 2 Authentication and authorization By design authen
112. t Mandatory Mix Survey A survey with some mandatory questions and mixed questiontypes select checkboxes and text Mandatory Only Survey A survey with only mandatory questions and mixed questiontypes select checkboxes and text No Access Survey Like ordinary survey but the invitee has no access to it Method Name bool SubmitSurveyAnswers int surveyld string inviteeEmail General Comment This method it tested along with help of SubmitQuestionAnswer and RemoveQuestionAnswer as an individual test won t make sense input Expected output Actual output Explanation Empty survey true true Try to submit an empty survey as Invitee email it has no questions and thus no mandatory questions unanswered submission should be fine Ordinary survey true true As there are no mandatory questions Invitee email in ordinary survey one should be able No answers submitted to submit it without any answer Ordinary survey true true As there are no mandatory questions Invitee email in ordinary survey one should be Some answers submitted able to submit it without answering all questions Ordinary survey true true Removing nonmandatory answers Invitee email should not make a difference when Some answers submitted and submitting a survey some answers deleted Ordinary survey true true A completed survey should allow a Invitee email submission All answers submitted Ordinary survey Removing nonmandatory question s Invitee email answers s
113. t x x x let x sqrt 2 Exercise 2 A let pow x float n float System Math Pow x n let y pow 2 0 4 0 B let pow2 x int n int int System Math Pow float x float n let y2 pow2 2 4 O let rec pow3 x int n int match n with 0 gt 1 n gt x pow3 x n 1 let y3 pow3 2 5 Exercise 3 let dup s s s let y4 dup Hey Exercise 4 let rec dupn s string n int if n 1 then s else s dupn s n 1 let y5 dupn Test 4 Exercise 5 let timediff h1 m1 h2 m2 System Math Abs h1 60 ml h2 x 60 m2 let y6 timediff 14 30 17 40 Exercise 6 let minutes x y timediff x y 0 0 let y7 minutes 1 0 Exercise 7 let rec downTo n if n 1 then n else n downTo n 1 let y8 downTo 5 let rec downTo2 n match n with 1 gt a gt n downTo2 n 1 71 let y9 downTo 5 Exercise 8 let rec removeEven xs list lt int gt match xs with I gt gt xs g xs gt g removeEven xs Tail let y10 removeEven 1 2 3 4 5 Exercise 9 let rec combinePair xs list lt int gt match xs with H bead ee g xs gt g xs Head combinePair xs Tail let yll combinePair 1 2 3 4 let y12 combinePair 1 2 3 4 5 let y13 combinePair let yl4 combinePair 1 Exercise 10 A let explode s string List ofArray s ToCharArray
114. ter list name and then an index referring to their position e g the first item of the xs list should be given as xs 0 By formatting the list elements this way the URL parameters was given correctly and the chart generation worked as expected Survey creation The most interesting part of our client was the survey creation feature For survey creation we wanted a more user friendly solution than just plain editing of template which required some knowledge and technical skills to use We decided to use an HTML based form solution which resulted in some interesting issues The 34 first issue was that we did not know how many questions a user would create in advance and furthermore how many options there would be for each question thus we could not create a plain static HTML page We thus had to use client side Javascript to dynamically alter the HTML DOM and adding and removing questions could be done dynamically Although there are some drawbacks with this method The HTML was written as strings in the Javascript which made it harder to maintain and test The other drawback was that if there was some erroneous input the user would be redirected back and only the questions written in the static part are remembered thus forcing the user to retype his questions After taking the user input we had to convert the form data to the template language While we used a notation in the form keys to explain what the type is e g q 0 for the first
115. tes and is host for the survey WS returns true if everything went well otherwise an exception is thrown with a message about what went wrong e Add Remove Invitee to Survey Client calls AddInviteeToSurvey RemovelnviteeFromSurvey WS with survey Id in vitee email and host email password WS invokes addInviteeToSurvey removelnviteeFromSurvey function in the Survey module which performs the query to the DB which adds removes the invitee from the survey WS returns true if everything went well otherwise an exception is thrown with a message about what went wrong e View Invitees From Survey Client calls ViewInvitees FromSurvey WS with survey Id and host email password WS invokes viewInviteeFromSurvey function in the Survey _Invitee module which fetches the participants from the DB if the host authenticates WS returns and array of Invitees if everything went well otherwise and exception is thrown with a message about what went wrong e Get Survey Questions Client calls GetSurveyQuestions WS with survey Id WS invokes getSurveyQuestions function in Survey module which fetches the data for the given survey from the database WS returns a string containing the survey questions if everything went well otherwise an exception is thrown with a message about what went wrong e Get Survey Results Client calls GetSurveyResults WS with survey Id and host email password WS invokes getSurveyResu
116. that implodeRev s returns the characters concatenated in reverse order into a string implodeRev a b c cba Hint Use foldl from lecture Now write a function implodeRev2 char list string similar to implodeRev You have to use the build in List operation List fold let implode list char list new System String list gt Array ofList 77 let implode2 list char list List foldBack fun char act gt string char act list let rec implodeRev list char list match list Length with 1 string list 0 gt implodeRev list Tail string list 0 let implodeRev2 list char list List fold fun char act char gt string act char list let captain POPA P P P PA DP py N let planet PP DL A N E T printfn A implode captain printfn A implode2 planet printfn A implodeRev captain printfn A implodeRev2 planet Exercise 12 Write a function toUpper string gt string so that toUpper s returns the string s with all characters in upper case toUpper Hej HEJ Hint Use System Char ToUpper to convert characters to upper case You can do it in one line using implode List map and explode Aside Write the same function toUpperl using forward function composition f gt gt g x g f x Aside Write the same function toUpper2 using the pipe forward operator gt and
117. tication is needed in our web services requiring user email and password on every important web service call We thus had to find a suitable way of storing these data when a user gets authenticated as to not ask the user his email and password every time As the ASP NET MVC framework already had a way of basic authentication called Forms Authen tication which already took care of creation of encrypted cookies and handling authorization 32 on web pages by using the authorize attribute we wanted to extend the capabilities of the framework as to reuse as much as possible The specific problem with just using forms authentication was that one could only save a users name and we needed to also store the user password for use on the web services A way this could be resolved was proposed by Microsoft and the idea is to change the default user and user identity objects in the controllers with custom implementations using their respective IPrincipal and Identity interfaces and then modifying the cookie to include this new type of information We thus created our own implementation of User called RSVPPrincipal containing our cus tom RSVPldentity that included the data for email and password To store the new information in a cookie we thought it would be easier to create the default forms authentication cookie and then modify the information afterwards in postauthenticate request In this way we could use the default way of routing una
118. ticipant to survey with id surveyld participant requires email host requires email password Throws Exception string s if unable to authenticate host Remove a participant from a survey participant requires email host requires email password Throws Exception string s if unable to authenticate host Get an array of Invitee s for the given survey Throws Exception string s if unable to authenticate host Show generated XML for survey with id surveyld Show statistics for survey with id surveyld The host requires password and email Throws Exception string s if unable to authenticate host Lists the surveys a host has access to Throws Exception string s if unable to authenticate host Answer question with the option that has id optionID If a text question answer will contain the answer if not answer can be bool RSVPService RemoveQuestionAnswer int optionID string inviteeEmail bool RSVPService SubmitSurveyAnswers int SurveylD string inviteeEmail bool RSVPService DeleteGuestlist string name Host host bool RSVPService CreateGuestlist string name Host host bool RSVPService AddinviteeToGuestList string guestListName Host host string inviteeEmail string inviteeName bool RSVPService RemovelnviteeFromGuestList string guestListName Host host string inviteeEmail an empty string or null invitee requires email Throws Exception string s if invitee does not have access to the survey contain
119. urselves We wrote all the roles we identified down and handed each of them out to group members We had quite many roles at the start but as the process advanced we found that some were dispensable We kept roles such as responsible persons in each are of development server client and test And we also kept the role of project manager and had a person responsible for documentation After we were taught about Scrum in BSUP we realized that our own model was actually quite close to that development model The main difference being that we had split the group in different roles and that is not normal practice in Scrum development lnttp www prince officialsite com 2http www ipma ch Shttp www scrumalliance org 39 8 2 External communication Our first meeting with our partner group from SMU was arranged for us by the professors in the course Niels and Ben We got a time slot for a video meeting at ITUs video conference room and the SMU group was in a conference room at their university Before our first meeting we sent an email to our new partners explaining who we were and specifying our contact information Along with these formalities we also sent a message saying that we were looking forward to be working together This email was answered with contact information from their side which was nice to have before the first meeting They also acknowledged our greeting and replied with their own Everything was well underway for a gr
120. use of the need for flexibility we ve decided to create a system where the client is responsible for presenting surveys and the data from completed surveys while the server is responsible for allowing safe manipulation of data During the project we ve also had other constraints we ve worked with We have for example been improving our software development process We ve also been taught the programming language F as well as a new programming paradigm functional programming which has been used to implement the Server Following the cooperation with Singapore we ve also implemented a client of our own The client was written in ASP NET as the biggest platform for surveys is the online variety performed in browsers Surveys such as this can also be performed on most mobile devices even if this isn t always ideal The client was made with the idea in mind that taking a survey should be fast and easy should work in most if not all internet browsers and it should be easy to analyze and get an overview of the results in a given survey Chapter 2 Requirements specifications In the following we have listed the requirements for the server and client including the necessary web services and use cases for these 2 1 Server e The source code must be written in F and or C e The server must be running on hotel itu dk e The server must make web services available and allow invocation of the methods described below e The server must be
121. uthorized requests with the authorize attribute on actions that required authentication and also store the information for easy access in the controllers by just casting the user identity object to an RSVPlIdentity and getting the custom attributes from there 6 2 3 Survey Management A key feature of a survey system is of course survey management In this part there were many problems here to be solved 1 How to format the XML given by the service for seeing and taking the survey 2 How to list and delete the surveys that a user has 3 How to manage participants for a given survey 4 How to create a survey in an easy intuitive way Displaying a survey For displaying the surveys to the user for taking we chose a fairly simple approach A user gains access to the survey by using an encoded URL containing the survey id and his email address and then got presented with the corresponding survey given by the survey id viewing the survey does not require authentication The user is presented with a HTML web form interpreted from the given XML formatted survey data The form was converted to the corresponding input types by iterating through the XML by using XPath expressions with the help of the LINQ to XML framework When answers are given the given form data is parsed accordingly to the type of question and a call is made to the question submission web services If there were any errors e g the user has not answered the required questions
122. ve all the functionality we were after it has been a great inspiration on what a good survey system must include When designing our data model we used this inspiration to make sure we could support all the functionality in our model 3 1 Design decisions on the data model Our process towards agreeing on a data model has been very democratic We used a whiteboard for drawing sketches for each other Then we stared at the solution for a while and if we didn t see any errors we moved on If something was wrong we drew another sketch and continued doing this After some iterations and discussions we finally came up with our final model as seen below 1or0to1orO Id Name lt 10r0to0 or many GuestList 4 lt 1 andonly 1 to 1 or many Name Id Email Password Name Text IsComplete Guest PP User lt Answer ld Name Id Name A Type Role E gt Participant y Id Ordering Text MinAnswers MaxAnswers IsNumeric Survey H lt Group H Question P lt _ Option Id Title Description Id Title Page Ordering Id Text IsOther StartDate EndDate IsCascading IsMatrix l i Figure 3 1 Our final data model explanation in appendix B on page 49 Our main problem designing the data model was how we could support matrix questions The problem with matrix questions is that it is actually several
123. ve test Password Email test test dk and ConfirmPassword does Password 1234 not match ConfirmPassword 12345 ModelName ParticipantModel Expected Actual output Explanation output ParticipantModel True True Negative test incorrect ParticipantEmail email should fail stuff ParticipantModel Negative test incorrect ParticipantEmail email should fail stuff stuff ParticipantModel Negative test incorrect ParticipantEmail email should fail stuff dk ParticipantModel Positive test correct email ParticipantEmail should fail stuff stuff dk ModelName QuestionModel Method ToTemplate Expected Actual output Explanation output QuestionModel explanat explanation S Positive test Description Something ion Somet omething about about the following hing about the following questions the following questions Type Explanation questions Required False Options QuestionModel explanat explanation S Test that the Required Description Something ion Somet omething about attribute is ignored when about the following hing about the following using type Explanation questions the following questions Type Explanation questions Required True Options QuestionModel explanat explanation S Show that options are Description Something ion Somet omething about ignored when using
124. without answering all Some answers submitted mandatory questions Mandatory only survey A completed survey should allow a Invitee email submission All answers submitted Mandatory only survey RSVPException RSVPException One should be able to submit a Invitee email survey with all mandatory questions All answers submitted and some answered even though they were deleted answered and then deleted Method Name bool SubmitQuestionAnswer int optionld string answerText string inviteeEmail input Expected output Actual output Explanation optionld Valid option Id inviteeEmail Invitee email submitted once optionld Valid option Id inviteeEmail Invitee email submitted twice optionld Invalid options ld 1 inviteeEmail Invitee email optionld Valid option Id answerText 100 inviteeEmail Invitee email answering a text question optionld Valid option Id answerText null inviteeEmail Invitee email answering a text question optionld Valid option Id answerText inviteeEmail Invitee email answering a text question optionld Valid option Id answerText n t r n r inviteeEmail Invitee email answering a text question Method Name bool RemoveQuestionAnswer int optionld string inviteeEmail true true true RSVPException RSVPException RSVPException RSVPException RSVPException FIXED RSVPException RSVPException RSVPException RSVPException A n
125. y important functions of our client application works and increased the reliability in those modules For the full testing schemes please look at appendix H 2 client unit testing plan 37 7 2 2 Integration testing While the unit tests of some of the most important layers in our client s architecture resulted in increased reliability in the client we had not proved that our modules worked well with each other and there were still some parts that was not completely covered by our unit tests i e our controllers and our views While most of the real functionality on the controllers was in the helpers we thought that it would not be a complete guarantee that our controllers worked as expected As such there could still be some error checks in which the controllers behaved erroneously or some views that missed data from the given controllers We had also used the framework option of annotating methods and classes that required authorization with the authorize attribute and testing that it worked the way we wanted would have been hard using unit tests and thus the only resort was to uncover errors by integration testing Testing the views with the use of integration test was clearly a good idea for us as it also was easier to test our client side scripts Alternatively the client side scripts should have been tested with a javascript testing framework which required much time and in which we were inexperienced with Using the views is also one o
126. you like testing Yes No explanation You may not like testing but checkboxes What type of testing do you prefer Whitebox Blackbox Unit Automated Contracted text How much do you like testing end input Expected output Actual output Explanation survey survey with mixed valid XML valid XML questions host default survey non existing survey RSVPException RSVPException host default survey survey with mixed RSVPException valid XML Error the email was questions FIXED checked with itself instead host invalid of checked with database when checking ownership Method Name bool DeleteSurvey int surveyld Host host Empate Expected output Actual output Explanation surveyld default true true email martin jeanty dk password qwerty42millarder surveyld 666 RSVPException RSVPException email martin jeanty dk password qwerty42millarder surveyld default RSVPRSVPExcepti Error in SQL checking that the given email evilguy hell org on host has admin role to the specified password 666 survey MethodName Survey ViewSurveys Host host mpt OES Expected output Actual output Explanation Shared host true true 5 surveys created by host cheks that all created surveyld s from the created surveys are contained in the returned array Shared host RSVPException RSVPException 5 surveys created by host then deleted again before method is c
Download Pdf Manuals
Related Search
Related Contents
Manual Graco 309495F User's Manual User's Manual Bedienungsanleitung Sony-Ericsson S302 Controller Samsung Galaxy Note edge Lietotāja rokasgrāmata(LL) User's Manual Manuel d`utilisation Nokia C2–02 - Migros O motivo da nossa existência Eu lhe proponho agora um pequeno MANUAL DE INSTRUÇÕES Copyright © All rights reserved.
Failed to retrieve file