
Which of the following is FALSE about duplicate code?
- Duplicate code is a good
programming practice - Duplicate code is a source of faults
- Duplicate code has a negative impact on changeability
- Duplicate code has a negative impact on maintainability
- Fixning a fault in the program is a widely used refactoring technique
True
False
- Which of the following statements is true?
You need to test the code after refactoring to verify that the behavior is not changed |
||||||||||||||
You do NOT need to test the code after refactoring because the behavior is not changed |
||||||||||||||
After refactoring, no need to test, you need to inspect the code |
||||||||||||||
After refactoring, depending on the programming language. In case of Java, no need to test as Java provided an automatic Garbage collection
6. What can go wrong if you refactor an interface?
|
- Which of the following classes suffers from the Middle Man bad smell?
A class that contains more methods than it should |
||||||||||||||||||||||||||||||||||||||
A class that delegates many of its requests to another class |
||||||||||||||||||||||||||||||||||||||
A class that only contains data |
||||||||||||||||||||||||||||||||||||||
A class that contains less method than it should
8. Which of the following is a symptom of Shotgun Surgery bad smell?
|

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- An error message popped up when I tried to run the code. "deposit" is not defined "withdraw" is not defined *it was run on visual codearrow_forwardAccording to a well-known programming cliché, it is advised to refrain from succumbing to the temptation of immediately writing code. However, what is the precise definition or interpretation of that concept?arrow_forwardIn this lab, you use the flowchart and pseudocode found in the figure below to add code to a partially created Java program. When completed, college admissions officers should be able to use the Java program to determine whether to accept or reject a student, based on his or her test score and class rank. start input testScore, classRank if testScore >= 90 then if classRank >= 25 then output "Accept" else output "Reject" end if else if testScore >= 80 then if classRank >= 50 then output "Accept" else output "Reject " endif else if testScore >= 70 then if classRank >= 75 then output "Accept" else output "Reject" end if else out put "Reject" end if end if end if stop Instructions Study the pseudocode in picture above. Declare the variables testScoreString and classRankString. Write the interactive input statements to retrieve: A student’s test score (testScoreString) A student's class rank (classRankString) Write the statements to convert the string representation…arrow_forward
- Two bugs are positioned a given distance apart. The first bug moves halfway towards the other. The second bug moves halfway to the first. The first bug again moves halfway to the second. Compute and print the positions of the bugs. The initial position will change with each program run. // Declare position 2... /* Your code goes here */ double distance = initial_distance; 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27} // Update distance and position1 distance distance * 0.5; position1= distance; cout << position1 << " " << position2 << endl; // Update distance and position2 /* Your code goes here */ cout << position1 << " " << position2 << endl; // Update distance and position1 /* Your code goes here */ cout << position1 << return 0; "1 << position2 << endl;arrow_forwardProblem #1: How much should I study outside of class? Issue: Your fellow students liked the previous version of study hour’s application and want to expand it again by adding the features listed below. Minimum Study Hours per Week per Class Grade15 A12 B9 C6 D0 F Project Specifications: The program asks the user their name, employee id, and department. The program also asks the user who they are creating the report for, their employee id, and the department they work in. (hint #1 & 2 are instances of a class – A class must be created and used within the program)The menu driven program has the following options:Determine Hours to StudyDetermine Grade Display Averages and TotalsQuit The user can select any menu option in any order they want. For example:The user can start the program run option A, then option C, then option B, then option D. They restart the program, run option C, then D. They restart the program, run option A, then D. They restart…arrow_forwardfailed 12 out of 15 tests including time limit tests, if you have to use a different language or change the whole code to attain the 2 second time limit I dont mind, I gave examples of a failed belowarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





