Question: Here is index.js Here is test.js Consider the software package is-positive. Examine its source code (see index.js) and its test suite (see test.js), then complete

 Here is index.js Here is test.js Consider the software package is-positive.

Here is index.js

Examine its source code (see index.js) and its test suite (see test.js),

Here is test.js

then complete these questions. 1. Describe the API surface of this package.

Consider the software package is-positive. Examine its source code (see index.js) and its test suite (see test.js), then complete these questions. 1. Describe the API surface of this package. (2 points) 2. Describe how you would test this package. Describe how and why your approach would change if you maintained a similar package in a different programming language of your choice. (2 points) 3. According to npmjs.com, this package receives over 16,000 downloads each month. a. Why might an engineer choose to use this package? (4 points) b. Why might an engineer choose not to use this package? (You may find insights from the chapter about dependencies in SE@Google) (4 points) 4. Do you think npmis should exclude such packages from its registry? Discuss. (8 points) 1 2 "use strict'; module.exports function (n) { return toString.call(n) }; 3 '[object Number]' && n > 0; 4 1 2 /* eslint no-new-wrappers: 0 */ import test from 'ava'; import m from './'; 3 4 5 6 7 8 9 test(t => { t.true (m(1)); t.true (m(new Number(1))); t. false (m()); t. false (m(-1)); t.false(m('1')); t. false (m(NaN)); t. false (m(true)); t. false(m()); } 10 11 12 13 14 Consider the software package is-positive. Examine its source code (see index.js) and its test suite (see test.js), then complete these questions. 1. Describe the API surface of this package. (2 points) 2. Describe how you would test this package. Describe how and why your approach would change if you maintained a similar package in a different programming language of your choice. (2 points) 3. According to npmjs.com, this package receives over 16,000 downloads each month. a. Why might an engineer choose to use this package? (4 points) b. Why might an engineer choose not to use this package? (You may find insights from the chapter about dependencies in SE@Google) (4 points) 4. Do you think npmis should exclude such packages from its registry? Discuss. (8 points) 1 2 "use strict'; module.exports function (n) { return toString.call(n) }; 3 '[object Number]' && n > 0; 4 1 2 /* eslint no-new-wrappers: 0 */ import test from 'ava'; import m from './'; 3 4 5 6 7 8 9 test(t => { t.true (m(1)); t.true (m(new Number(1))); t. false (m()); t. false (m(-1)); t.false(m('1')); t. false (m(NaN)); t. false (m(true)); t. false(m()); } 10 11 12 13 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Describe the API Surface of This Package The ispositive package exports a single function that checks if a given input is a positive number Function ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!