1. Homepage
  2. Programming
  3. [2022] COMP1531 Software Engineering Fundamentals - Lab03 Password

[2022] COMP1531 Software Engineering Fundamentals - Lab03 Password

Engage in a Conversation
COMP1531Software Engineering FundamentalsUNSWLab03 PasswordProgramming HelpJavascript

Lab03 - Password CourseNana.COM

Background CourseNana.COM

Rationale CourseNana.COM

Users are not very clever. They tend to choose the laziest most convenient option available despite being fully aware of the drawbacks that it entails. Take passwords, for example - how often do people: CourseNana.COM

1. use a common phrase such as password ,
2. re-use the same password across different accounts, or
3. use/combine simple words (e.g.
hearsay ) to make a weak password, CourseNana.COM

thus sacrificing security for the sake of not having to remember a strong yet difficult string of authentication. CourseNana.COM

In this lab, your goal is to rate the strength of a password using a set of requirements and produce a test suite that can dynamically verify, to a satisfactory extent, that a particular solution will meet these requirements. CourseNana.COM

Getting Started CourseNana.COM

Copy the SSH clone link from Gitlab and clone this repository on either VLAB or your local machine.
In your terminal, change your directory (using the
cd command) into the newly cloned lab. To check if you have done this correctly, type ls in this new directory to see if you can see the relevant files (including password.js). CourseNana.COM

Jest Installation CourseNana.COM

Jest is a delightful JavaScript Testing Framework with a focus on simplicity. To get started, CourseNana.COM

1.      Install Jest as a development dependency by specifying the option --save-dev . We do this because testing packages are unnecessary in production code. CourseNana.COM

1      $ npm install --save-dev jest # shortcut: npm i -D jest CourseNana.COM

2.      For compatibility with our new import/export syntax, we will also install @babel/preset-env. CourseNana.COM

1      $ npm install --save-dev @babel/preset-env # shortcut: npm i -D @babel/preset-env CourseNana.COM

3.      Open package.json and confirm that jest and @babel/preset-env are shown in "devDependencies" , e.g CourseNana.COM

1      "devDependencies": { "@babel/preset-env": "^7.17.10", "jest": "^28.1.0" CourseNana.COM

2      } CourseNana.COM

  CourseNana.COM

4.      Also, under "scripts" , you should see a section similar to: CourseNana.COM

1      "scripts": {
"test":
"echo \"Error: no test specified\" && exit 1" CourseNana.COM

2      } CourseNana.COM

  CourseNana.COM

Modify the value of the key test to jest : CourseNana.COM

1      "scripts": { "test": "jest" CourseNana.COM

2      } CourseNana.COM

5.      You can run your added scripts with the command npm run [script] . However, since test is a special keyword in npm , you can use any of the three commands below: CourseNana.COM

1   $ npm run test CourseNana.COM

2      $ npm test CourseNana.COM

3      $ npm t CourseNana.COM

6.      To check that you have completed the steps correctly, compare your package.json with our sample package.json in the Additional Information section. CourseNana.COM

7.      Type git status in your terminal. You should see that package.json and package-lock.json have been modified or is untracked. Use git to add, commit and push these changes. CourseNana.COM

Interface: Data Types CourseNana.COM

Variable Name Type CourseNana.COM

password string CourseNana.COM

Task CourseNana.COM

Writing Tests CourseNana.COM

Before implementing checkPassword , CourseNana.COM

1. Open the file password.test.js.
2. Write at least 10 tests for
checkPassword . CourseNana.COM

you should avoid repeated/redundant tests.
ensure that each test targets exactly one specific case.
aim to cover as many different cases for the function as you can. You will be assessed on this. try to follow the specification as closely as possible when designing your tests.
CourseNana.COM

3. Run your tests with CourseNana.COM

4      $ npm t CourseNana.COM

4. Ensure that there are unexpected errors. You should expect the current stub code in checkPassword to fail most tests. 5. Use git to add, commit and push password.test.js. CourseNana.COM

Tips with Jest CourseNana.COM

View the API and documentation at https://jestjs.io/docs/api CourseNana.COM

You may want to explore test.each - this is a way to write multiple tests succinctly. CourseNana.COM

Implementation CourseNana.COM

Once you have written your test suite, CourseNana.COM

1. Open password.js and implement checkPassword according to its documentation CourseNana.COM

2. Run your test
3. Fix any bug in your implementation
4. Git add, commit and push your code
CourseNana.COM

Share your experience! CourseNana.COM

Share your thoughts HERE on any of the following: CourseNana.COM

1. How did you find this activity? What were the challenges?
2. What is something you learned from this activity?
3. What are a few of your favourite passwords? (just kidding, please don't answer this honestly)
CourseNana.COM

4. What are some other ways we can make passwords stronger? CourseNana.COM

Submission CourseNana.COM

Use git to add , commit , and push your changes on your master branch.
Check that your code has been uploaded to your Gitlab repository on this website (you may need to refresh the page).
CourseNana.COM

If you have pushed your latest changes to master on Gitlab no further action is required! At the due date and time, we automatically collect your work from what's on your master branch on Gitlab. CourseNana.COM

Notes CourseNana.COM

You should only test the requirements specified in the Interface: Functions.
You should not be testing any undefined behaviour (e.g do not pass in a
number instead of a string for a password). You are not allowed to use any other external libraries/modules in this exercise. CourseNana.COM

Additional Information CourseNana.COM

Click to view our sample package.json CourseNana.COM

Miscellaneous CourseNana.COM

Other information that is not core to the course CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
COMP1531代写,Software Engineering Fundamentals代写,UNSW代写,Lab03 Password代写,Programming Help代写,Javascript代写,COMP1531代编,Software Engineering Fundamentals代编,UNSW代编,Lab03 Password代编,Programming Help代编,Javascript代编,COMP1531代考,Software Engineering Fundamentals代考,UNSW代考,Lab03 Password代考,Programming Help代考,Javascript代考,COMP1531help,Software Engineering Fundamentalshelp,UNSWhelp,Lab03 Passwordhelp,Programming Helphelp,Javascripthelp,COMP1531作业代写,Software Engineering Fundamentals作业代写,UNSW作业代写,Lab03 Password作业代写,Programming Help作业代写,Javascript作业代写,COMP1531编程代写,Software Engineering Fundamentals编程代写,UNSW编程代写,Lab03 Password编程代写,Programming Help编程代写,Javascript编程代写,COMP1531programming help,Software Engineering Fundamentalsprogramming help,UNSWprogramming help,Lab03 Passwordprogramming help,Programming Helpprogramming help,Javascriptprogramming help,COMP1531assignment help,Software Engineering Fundamentalsassignment help,UNSWassignment help,Lab03 Passwordassignment help,Programming Helpassignment help,Javascriptassignment help,COMP1531solution,Software Engineering Fundamentalssolution,UNSWsolution,Lab03 Passwordsolution,Programming Helpsolution,Javascriptsolution,