JavaScript unit testing quiz answer

Now I’m not entirely sure… but the first question for learning JavaScript unit testing was slightly weird. The question is as follows " Nikki’s blog application allows users to create, read, and update blog posts. Given this context, which of these is an example of regression ?"
the options are as follows
A. Nikki adds a deletion feature to her application. In testing, she discovers that the creation feature no longer behaves as expected.

B. Before Nikki makes any changes to her app, a blogger discovers a bug in the reading feature.

C. Nikki writes a new test, which is failing.

D. Nikki decides to replace updating with deletion. She adds a deletion feature and removes the updating feature.

However, None of the given scenarios can be considered as an example of regression.

Regression refers to a software bug where a previously working feature of an application stops functioning correctly after a new update or change has been made to the code. It occurs when changes made to the codebase unintentionally affect the existing functionality of the software.

Option A talks about a bug in the creation feature when Nikki adds a deletion feature. This is an example of a functional bug and not regression.

Option B refers to a bug in the reading feature. This is also an example of a functional bug, not regression.

Option C refers to a failing test, which could indicate a bug in the application, but not necessarily regression.

Option D talks about replacing updating with deletion. This is a planned change in the code and does not indicate regression.

Therefore, none of these options provide an example of regression.

Am I missing something here?

From your description, I’d say Option A fits the definition. The previously working creation feature (I’m assuming this is how users create new blog posts) stopped working as expected after she added the option to delete a post.

I believe that “no longer” is intended to imply that it previously did behave as expected.

So Nikki made an update/change to the code. After which, an existing, previously working feature, the creation feature, no longer functions. This is an example of regression because new code has broken the functionality of existing code, thus causing the app to regress to a previous state before the creation feature worked.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.