Final answer:
The correct answer is option (1) p only. Refactoring is a process in software development aimed at improving the internal structure of the code without changing its external behavior.
Step-by-step explanation:
The correct answer is that statement p is true because refactoring is about improving the internal architecture of code without altering its behavior, whereas statement q is false as refactoring does not involve adding new features.
This practice is essential for maintaining code quality and preventing technical debt. An example of refactoring might include renaming variables for clarity, simplifying methods, or removing redundant code.
Statement q, on the other hand, refers to adding new features, which is not part of refactoring. Instead, adding new features is part of software development known as feature implementation or enhancement. In refactoring, there is no introduction of new functionality, as the goal is to structure the existing code more efficiently and cleanly. Therefore, statement q is false when discussing the principles of refactoring.
The statement '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' is true. Refactoring involves restructuring code to improve its readability, maintainability, and performance without changing its functionality or behavior.
The statement 'q: An example of refactoring is adding new features to satisfy a customer requirement discovered after a project is complete' is false. This is not an example of refactoring. Adding new features to meet customer requirements after a project is complete is considered a change in the software's external behavior, which goes against the definition of refactoring.