Question: Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name them. [3] b. Refractor the

 Q4. Consider the following code snippet. [CO5] a. Identify at least

Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name them. [3] b. Refractor the source code to remove 4 different Code smells( write the code segment in your copy which has code smell and then show the correct way to refactor it). [4.5] NB: The "System.out.println" statements should not cause any smells \begin{tabular}{|c|c|} \hline & \begin{tabular}{l} public class Teacher \\ \{ \\ public String teacherName; \\ public String teacherID;; \\ public String InternationalPolitics = "n \\ politics"; \\ public void setTeacherDetails (String \\ teacherName, String teacherID) \\ \{ this.teacherName = teacherName; \\ this.teacherName = teacherID; \\ \} \\ \} \end{tabular} \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!