nerdexam
Scrum

PSD · Question #126

You are asked to refactor part of the codebase for an application. When you are done, all unit tests pass with 50% code coverage. What can you infer from this?

The correct answer is D. You did not break any of the unit tests that already existed. You can't really say anything because you don't know what the unit tests are testing and whether they are correctly representing whether the application is working correctly. However, if all the tests passes you didn't break any already existing tests. Also, if none tests existed

Test Driven Development

Question

You are asked to refactor part of the codebase for an application. When you are done, all unit tests pass with 50% code coverage. What can you infer from this?

Options

  • ALess than 50% of the application is working correctly
  • BThere are no bugs in the application
  • CAt least 50% of the application is working correctly
  • DYou did not break any of the unit tests that already existed

How the community answered

(48 responses)
  • A
    27% (13)
  • B
    17% (8)
  • C
    6% (3)
  • D
    50% (24)

Explanation

You can't really say anything because you don't know what the unit tests are testing and whether they are correctly representing whether the application is working correctly. However, if all the tests passes you didn't break any already existing tests. Also, if none tests existed yet, you did

Topics

#code coverage#unit tests#refactoring#test inference

Community Discussion

No community discussion yet for this question.

Full PSD Practice