recategorized by
4,728 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
recategorized by

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 votes
1 votes

$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. 
 

 

Related questions

2 votes
2 votes
3 answers
2
Pooja Khatri asked Jul 13, 2018
2,756 views
Match the following in Software Engineering :$\begin{array}{clcl} &\textbf{List-I}& & \textbf{List-II} \\ \text{(a)}& \text{Product Complexity} & \text{(i)} & \text{Soft...
1 votes
1 votes
4 answers
3
Pooja Khatri asked Jul 13, 2018
1,734 views
Which one of the following is not typically provided by Source Code Management Software?SynchronizationVersioning and Revision historySyntax highlightingProject forking
0 votes
0 votes
3 answers
4
Pooja Khatri asked Jul 13, 2018
2,000 views
A software system crashed 20 times in the year 2017 and for each crash, it took 2 minutes to restart. Approximately, what was the software availability in that year?96.99...