in IS&Software Engineering recategorized by
4,736 views
0 votes
0 votes

Which of the following statements is/are True?

P: Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves the internal architecture

Q: An example of refactoring is adding new features to satisfy a customer requirement discovered after a project is shipped

Code:

  1. P only
  2. Q only
  3. Both P and Q
  4. Neither P nor Q
in IS&Software Engineering recategorized by
4.7k views

1 comment

Answer according to official key is OPTION (A) i.e P only.

0
0

4 Answers

2 votes
2 votes
Statement P is a definition of Refactoring, New Features are not added in Refactoring.
So Option (1) P Only is correct.
1 vote
1 vote

$P:$ $True$ $\rightarrow$ The definition of Code refactoring.

"Code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior. Refactoring improves nonfunctional attributes of the software. Advantages include improved code readability and reduced complexity" -  Wikipedia

$Q:$ $False$ $\rightarrow$ Code refactoring does not change the external behaviour as stated above, so $adding\space new\space features$ after the product is shipped is $not$ an example of code refactoring.

So, the answer is $(1)$ $P$ $Only$.

0 votes
0 votes

Answer : (3). Both P and Q only 

Reason : 

Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. The statement is TRUE and given by MartinFowler in Refactoring Improving The Design Of Existing Code.
 
Refactoring essentially is cleaning up an existing code base to enable changes to be made more efficiently, or to improve the performance of the existing system.  Refactoring usually involves restructuring or rewriting portions of code which are convoluted, difficult to understand, poorly documented or unnecessarily complex.  Refactoring, the engineers argued, is essential to add future features, so developers should be given time to “refactor” existing code– even if it is the only activity in that sprint or release.
 
So Both the statements are TRUE. 
 

 

0 votes
0 votes
Option a is correct

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true