All Coursera Quiz Answers

Module quiz: Testing Quiz Answers

In this article i am gone to share Coursera Course: Programming with JavaScript Week 4 |  Module quiz: Testing Quiz Answers with you..

Programming with JavaScript Coursera Quiz Answers

Enroll Link: Programming with JavaScript


Also visit: Module quiz: Programming Paradigms Quiz Answers


 

Module quiz: Testing Quiz Answers

Question 1)
What is unit testing?

  • Unit testing gives you an efficiency rating for your code measured in units.
  • Unit testing tries to imitate how a user might interact with your app.
  • Unit testing is testing how parts of your system interact with other parts of your system.
  • Unit testing revolves around the idea of having separate, small pieces of code that are easy to test.

Question 2)
When the following test executes, what will the test result be?

function subtract(a, b) { return a - b; } expect(subtract(10, 4)).toBe(6);
  • Success.
  • Fail.

Question 3)
What is End-to-end testing (e2e)?

  • End-to-end testing revolves around the idea of having separate, small pieces of code that are easy to test.
  • End-to-end testing tries to imitate how a user might interact with your application.
  • End-to-end testing is a comprehensive test that starts at the beginning of your code and runs to the end.
  • End-to-end testing is testing how parts of your system interact with other parts of your system.

Question 4)
What reason would you want to know about your code coverage?

  • It lets you know if your code is in Javascript.
  • It lets you know if you are testing correctly.
  • It lets you know if you are done writing code.
  • It lets you know where more testing may be required.

Question 5)
Which of the following runtimes are typically used for building backends?

  • Cyprus
  • Protractor
  • Jest
  • Node.js

Question 6)
Which of the following are NOT one of the three types of testing?

  • Post-hoc testing
  • End-to-end testing
  • Unit testing
  • Integration testing

Question 7)
Which command is used to install a Node package?

  • npm
  • pkg
  • node
  • package

Question 8)
Which file lists all your application’s required node packages?

  • npm.json
  • node.json
  • package.json
  • pkg.json

Question 9)
A person on your team wants to help with testing. However, they are not a developer and cannot write code. What type of testing is most suited for them?

  • Unit testing
  • Post-hoc testing
  • End-to-end testing
  • Integration testing

Question 10)
Which of the below statements would NOT be a benefit of Mocking?

  • Mocking allows you to separate the code that you are testing from its related dependencies.
  • You can test the front end functionality of your web app by mocking the data as if it came back from a server.
  • Mocking is a substitute for testing.
  • Mocks, allow you to pretend that users are already there if the backend hasn’t been built yet.

 

Question 11)
Which of the following is a framework that can help you run a unit test?

  • JavaFrame
  • JFrame
  • Jest
  • JavaTest

Question 12)
True or False: End-to-end testing is the slowest and most expensive type of testing.

  • True.
  • False

Question 13)
Which of the following describes a measure of what percentage of your code is covered by tests?

  • Test coverage
  • Test%
  • Code coverage
  • TestMeasure

Question 14)
Node package manager (npm) is used to do which of the following?

  • Build a back end.
  • Use a large number of libraries and frameworks as Node.js modules.
  • Add code from places like Stack Overflow or github.
  • Test code coverage.

Question 15)
What is the recommended way to separate the code that you are testing from its related dependencies?

  • Fakes
  • module.exports
  • End-to-end testing
  • Mocking

Question 16)
The development of Node.js led to the ability to do which of the following?

  • Download and manage packages
  • Run unit tests
  • Estimate code coverage
  • Write full-stack JavaScript programs.

Question 17)
Which of the following statements are NOT benefits of using Test-Driven Development or TDD?

  • Minimizing regressions like accidental bugs introduced to old code.
  • You can automate these tests easily and thus keep verifying again and again that the system works as expected.
  • You have proof that your new implementation is not breaking other parts of the app.
  • You can run tests without setting them up.

Question 18)
In Jest you use mocking by employing which of the following?

  • External mock libraries
  • Jest Mock functions
  • Jest Fakes
  • Jest Snapshot

Question 19)
When the following test executes, what will the test result be?

function multiply(a, b) { return a; } expect(multiply(2, 2)).toBe(4);
  • Success.
  • Fail.

Question 20)
Which of the following testing types revolves around the idea of having separate, small pieces of code that are easy to test?

  • Post-hoc testing.
  • End-to-end testing.
  • Unit testing.
  • Integration testing.

Question 21)
package.json is used to do which of the following?

  • Turn your code into an application.
  • Store all the testing code.
  • Store all the dependencies required for application.
  • Download npm packages.

Question 22)
Which of the following is testing how parts of your system interact with other parts of your system?

  • End-to-end testing
  • Integration testing
  • Post-hoc testing
  • Unit testing

Question 23)
True or False: You can install packages from the npm repository using the node command.

  • True
  • False

Question 24)
True or False: End-to-end tests can be performed in a web browser without writing code.

  • True
  • False

Question 25)
The idea of having separate, small pieces of code that are easy to test is called what?

  • Post-hoc testing
  • End-to-end testing
  • Integration testing
  • Unit testing

Question 26)
When the following test executes, what format will the result be?

function subtract(a, b) { return a - b; } expect(subtract(10, 4)).toBe(6);
  • String
  • Success/Fail
  • True/False
  • Function

Question 28)
What is Code Coverage?

  • A measure of what percentage of your code is covered by tests.
  • A measure of what percentage of your code has failing tests.
  • What percentage of your code is in Javascript.
  • What percentage of your code is complete.

Question 29)
True or False: If you have built a project with different node packages, they will all be listed inside the package.json file.

  • True
  • False