Structure & Design Flashcards
6 cards from real CAD practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Structure & Design flashcards as text
Which design principle ensures that an application is easy to maintain and scale?
Answer: Modular design
Modular design ensures an application is easy to maintain and scale by breaking it down into smaller, independent, and interchangeable components. This approach simplifies understanding, testing, and debugging, as changes in one module are less likely to impact others. Furthermore, modularity enhances scalability by allowing individual components to be developed, deployed, or scaled independently, efficiently adapting to increased load or new features.
What is the primary advantage of using an MVC (Model-View-Controller) architecture in application development?
Answer: Separates concerns for better maintainability
The primary advantage of MVC (Model-View-Controller) architecture is that it separates concerns, dividing an application into distinct components for data/logic (Model), user interface (View), and input handling (Controller). This separation makes the codebase more organized, easier to understand, and significantly improves maintainability. It also allows multiple developers to work on different parts of the application concurrently, enhancing development efficiency and flexibility.
Which tool is commonly used for version control in application development?
Answer: Git
Git is a distributed version control system widely used in application development to track changes in source code. It allows multiple developers to collaborate efficiently on a project, manage different versions of the code, and revert to previous states if necessary. Git's robust branching and merging capabilities are essential for maintaining code integrity and facilitating teamwork.
What is the purpose of continuous integration (CI) in application development?
Answer: Automate merging and testing of code changes
The purpose of continuous integration (CI) is to automate the merging and testing of code changes frequently throughout the development cycle. Developers regularly integrate their work into a shared repository, triggering automated builds and tests. This practice quickly identifies and addresses integration issues and bugs, ensuring the codebase remains stable and functional, and reducing the time and effort needed for debugging later.
Which testing method is used to verify individual units of code?
Answer: Unit testing
Unit testing is the testing method used to verify individual units or components of code in isolation. A 'unit' typically refers to the smallest testable part of an application, such as a function or method. This granular testing helps identify bugs early in the development cycle, ensuring that each part of the code works as expected before being integrated with other components, thus improving overall code quality.
Which principle promotes code reusability and maintainability in software design?
Answer: DRY (Don't Repeat Yourself)
The DRY (Don't Repeat Yourself) principle promotes code reusability and maintainability by advocating that every piece of knowledge or logic should have a single, unambiguous representation within a system. By avoiding redundant code, developers reduce the overall size of the codebase, make it easier to maintain, and minimize inconsistencies when changes are needed. This approach enhances efficiency and improves software quality.