Introduction to Software Engineering
- 68Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What distinguishes software engineering from ordinary programming?
68 questions
- 1
What distinguishes software engineering from ordinary programming?
Model answer
Software engineering is a standardized, structured, and thorough approach to developing software from beginning to end, whereas programming may simply involve writing code to solve a problem.
Explanation
Software engineering formalizes the entire development process rather than focusing only on coding.
- 2
Why must professional developers ensure that they are building the correct product?
Model answer
They must deliver software that satisfies the customer's needs; otherwise, time and resources may be wasted developing an unusable product.
Explanation
Professional development is centered on delivering useful software to a customer.
- 3
Why are coding standards and conventions especially important in professional software development?
Model answer
They make code easier to maintain over months or years and easier for team members to understand and modify.
Explanation
Shared styles are particularly valuable in long-term and collaborative projects.
- 4
What aspects of rigor should software engineering help ensure in software?
Model answer
Software should be correct, efficient, and secure.
Explanation
Software engineering provides techniques that increase confidence in these qualities.
- 5
How does professional software development differ from hobbyist development at the start of a project?
Model answer
Professional development begins by understanding and gathering customer requirements, while hobbyists may begin coding immediately and discover the direction during development.
Explanation
Requirements gathering reduces the risk of developing the wrong product.
- 6
What is requirements gathering?
Model answer
Requirements gathering is the process of determining what customers and users need a software system to provide.
Explanation
It occurs before serious development and establishes what the product should accomplish.
- 7
Why can simply asking a customer to provide a requirements list be inadequate?
Model answer
The list may be very long, poorly structured, or unsuitable for development because customers may not know exactly what they need or may not be programmers.
Explanation
Developers often need to investigate and analyze requirements themselves.
- 8
Name three structured methods for gathering requirements.
Model answer
Three methods are surveys, interviews, and focus groups.
Explanation
These methods provide organized ways for developers to collect information directly from users or customers.
- 9
How can observing users interact with existing software help requirements gathering?
Model answer
Observation reveals users' established habits and pain points, which can guide the design of a better system.
Explanation
Direct observation can reveal needs that users may not state explicitly.
- 10
What is use case analysis?
Model answer
Use case analysis describes a realistic usage scenario from the user's point of view, including how the user interacts with the system.
Explanation
Use cases focus on user-visible behavior rather than the developer's implementation details.
- 11
What is a main success scenario in a use case?
Model answer
It is a series of intuitive, jargon-free steps describing the normal path by which a user successfully achieves a goal.
Explanation
For example, adding a sale may involve initiating the action, entering a name and quantity, and storing the information.
- 12
How are error conditions represented in an expanded use case?
Model answer
An error condition describes how the system responds when something goes wrong, such as displaying an error and returning the user to an earlier step to correct the input.
Explanation
Use cases can include alternative paths in addition to the main success path.
- 13
What are preconditions and postconditions in a use case?
Model answer
Preconditions are circumstances that must be true before the scenario begins, while postconditions describe what is true or happens after the scenario ends.
Explanation
Different outcomes, such as successfully completing an action or closing a dialog, may have different postconditions.
- 14
What three pieces of information should a user story contain?
Model answer
A user story should state who the user is, what the user wants to do, and why the user wants to do it.
Explanation
The purpose or reason is emphasized in user stories and may not be explicit in a use case.
- 15
What is the difference between a functional requirement and a non-functional requirement?
Model answer
A functional requirement states what the system must do, whereas a non-functional requirement describes a characteristic or quality of the system, such as performance.
Explanation
Functional requirements describe system functions; non-functional requirements describe properties of how those functions are performed.
- 16
What is the purpose of building a prototype after requirements have been analyzed?
Model answer
A prototype gives the customer a concrete feel for the interface, layout, and connections between parts of the system before serious development begins.
Explanation
Prototypes help stakeholders evaluate whether the proposed system meets user needs.
- 17
Why are prototypes often non-functional?
Model answer
Their main purpose is to demonstrate appearance, layout, and interaction flow rather than to provide a working implementation.
Explanation
A prototype can consist of simple materials such as presentation slides.
- 18
Why should a prototype be revised through repeated feedback?
Model answer
Repeated revisions help ensure that the customer's and users' needs are satisfied before development becomes expensive and difficult to change.
Explanation
Serious development should begin only after the requirements and proposed design are sufficiently certain.
- 19
What is the main purpose of planning in software engineering?
Model answer
Planning establishes how development will proceed over the coming weeks and months, including how different parts of the project will interact.
Explanation
A roadmap is especially valuable for large systems containing many interacting components.
- 20
How does planning relate temporally to requirements gathering and analysis?
Model answer
Planning may occur concurrently with requirements gathering and analysis rather than only after they are finished.
Explanation
Software engineering phases can overlap as the project develops.
- 21
What is modularization?
Model answer
Modularization is the process of breaking a large program into smaller, organized, and compartmentalized parts called modules.
Explanation
It helps developers reason about and construct complex systems.
- 22
Why is modularization important for large software projects?
Model answer
It provides an organized structure, clarifies how components interact, and makes the development of a large codebase more manageable.
Explanation
Large projects may contain tens of thousands of interacting lines of code.
- 23
What two design goals are commonly pursued during modularization?
Model answer
The goals are high cohesion within modules and low coupling between modules.
Explanation
Together, these goals support separation of concerns and maintainable software.
- 24
What is cohesion in software design?
Model answer
Cohesion measures how closely related the elements within a module are, based on what the module does or the data it handles.
Explanation
A cohesive module focuses on a unified responsibility.
- 25
Compare high cohesion with low cohesion using examples.
Model answer
High cohesion occurs when a module's functions are strongly related, such as a records module that retrieves and modifies records. Low cohesion occurs when unrelated tasks are grouped together, such as miscellaneous utilities with no common responsibility.
Explanation
Modules should generally be organized around closely related responsibilities.
- 26
What is coupling in software design?
Model answer
Coupling measures how strongly modules depend on and interact with one another.
Explanation
One way to assess coupling is to examine how much changing one module forces changes in another.
- 27
Why is low coupling generally preferred?
Model answer
Low coupling means that modules depend less on one another, so one module can be changed or replaced with minimal impact on the rest of the system.
Explanation
Modules with low coupling can communicate through messages without needing to know each other's internal workings.
- 28
What is the ideal case for coupling between two modules?
Model answer
The ideal case is no coupling, where modifying or replacing one module requires no modification to the other modules.
Explanation
In practice, low coupling is often achieved by defining clear communication interfaces.
- 29
How does message passing support low coupling?
Model answer
Modules communicate by sending requests and responses through defined interfaces while remaining independent of each other's internal implementation.
Explanation
A replacement module can work as long as it follows the same communication conventions.
- 30
Why does sharing a single game-state variable across many modules create high coupling?
Model answer
Every module becomes dependent on the shared state object, so a change in one part can affect many other parts and create widespread confusion.
Explanation
Shared internal state creates extensive dependencies between modules.
- 31
How can a game engine check whether an enemy has hit a player in a low-coupling design?
Model answer
The engine requests the player's position and the enemy's position from their respective modules, compares them, and sends a message to the player module to reduce health if they collide.
Explanation
The modules exchange information through messages instead of directly sharing their internal data.
- 32
What is separation of concerns, and what benefits does it provide?
Model answer
Separation of concerns means that each module handles its own responsibility without duplicating or managing other modules' tasks. It improves readability, maintainability, and the safety of localized changes.
Explanation
When responsibilities are separated, developers know where to make a change and are less likely to break unrelated code.
- 33
What is a software design pattern?
Model answer
A design pattern is a standardized, reusable approach to solving a recurring software design problem.
Explanation
Patterns make common solutions more intuitive, readable, and trustworthy because they have been repeatedly used and tested.
- 34
Why are established design patterns preferred to highly creative solutions for common problems?
Model answer
Established patterns are easier for others to understand and provide greater confidence because they represent tried and tested approaches.
Explanation
Consistency improves communication and maintainability in professional development.
- 35
What are the three components of the Model-View-Controller pattern?
Model answer
The three components are the Model, which contains data and logic; the View, which presents data to the user; and the Controller, which handles user interactions and requests changes.
Explanation
MVC separates stored data, presentation, and user controls.
- 36
What does the Model contain in MVC, and why is it considered abstract?
Model answer
The Model contains the system's data and the logic for retrieving or modifying it. It is abstract because it represents the low-level data and operations rather than a user-facing presentation.
Explanation
Users generally cannot understand or interact directly with the Model.
- 37
What is the responsibility of the View in MVC?
Model answer
The View obtains data from the Model and presents it to the user in an understandable format.
Explanation
For example, sales records might be displayed as rows in a table.
- 38
What is the responsibility of the Controller in MVC?
Model answer
The Controller processes user interactions and allows users to change what they see or modify data in the Model.
Explanation
Buttons and other interface controls commonly form part of the Controller.
- 39
How does MVC provide substitutability for views?
Model answer
A View can be replaced without changing the Model or Controller, as long as the replacement presents the same underlying data appropriately.
Explanation
For example, a table displaying sales records can be replaced by a chart while the data and controls remain unchanged.
- 40
How can MVC support different types of users, such as administrators?
Model answer
The Controller can be replaced or expanded to provide additional controls while leaving the Model and View unaffected.
Explanation
Separating responsibilities allows user interaction features to vary independently.
- 41
Why is readable code particularly important in large, long-lived, team-based projects?
Model answer
Readable code allows developers to understand, maintain, modify, and extend the system without spending excessive time deciphering the original implementation.
Explanation
Professional software is often revisited and changed by people other than its original author.
- 42
What is a magic number, and why is it harmful?
Model answer
A magic number is an unexplained numeric value embedded in code. It harms readability because future developers may not know what the number represents.
Explanation
Codes for remote-control buttons, screen dimensions, and other preset values can become confusing when left unnamed.
- 43
How should a programmer replace a magic number?
Model answer
The programmer should assign the value to a meaningfully named variable, constant, or macro.
Explanation
A name communicates the purpose of the value more clearly than the number alone.
- 44
What makes a function name effective?
Model answer
An effective function name clearly describes the action it performs, often by using a verb such as
queryDatabase.Explanation
Meaningful names make the function's purpose apparent without requiring readers to inspect its implementation.
- 45
Why are descriptive names useful for Boolean variables?
Model answer
A descriptive Boolean name communicates a state clearly and makes conditional statements easier to read, such as
if (isOn).Explanation
Names that read naturally reduce ambiguity in control-flow statements.
- 46
What do revision control systems do?
Model answer
Revision control systems track changes to code, allow developers to move between versions, and support collaboration by merging contributors' work.
Explanation
Platforms such as GitHub commonly provide access to repositories managed with revision control systems.
- 47
What is automated unit testing?
Model answer
Automated unit testing uses a tool to run predefined test cases on individual functions or modules and compare actual results with expected results.
Explanation
It provides a more systematic assessment than manually clicking through an application.
- 48
What is the primary purpose of software testing according to the content?
Model answer
Testing compares what the program actually does in the real world with what it is expected to do.
Explanation
Testing is not limited to searching randomly for bugs; it verifies behavior against expectations.
- 49
How does a unit test determine whether a function works correctly?
Model answer
It supplies an input, records the function's actual result, and compares that result with the expected result.
Explanation
A matching result indicates that the function behaves as expected for that test case.
- 50
What information does a failed unit test provide?
Model answer
It identifies that a problem exists and indicates the specific operation or expectation that the module violated.
Explanation
For example, a test may reveal that a function adds two numbers when it should subtract them.
- 51
What is integration testing?
Model answer
Integration testing uses automated tests to determine whether multiple modules work correctly together.
Explanation
Individually correct modules can still fail when their interactions or connections are incorrect.
- 52
How could integration testing be applied to a sales system using MVC?
Model answer
A test could edit a sales record through the Controller and then verify that the corresponding data in the Model changed correctly.
Explanation
This tests whether the link between the user controls and stored data works as intended.
- 53
What is black-box testing?
Model answer
Black-box testing evaluates a module using its specifications by supplying inputs and checking outputs without examining its internal implementation.
Explanation
The tester treats the module as a black box and focuses only on observable behavior.
- 54
What is white-box or glass-box testing?
Model answer
White-box testing considers the module's internal implementation and may design inputs to exercise internal paths or test internal features directly.
Explanation
Unlike black-box testing, it does not ignore how the module works internally.
- 55
Why is it valuable to use both black-box and white-box testing?
Model answer
They assess different aspects of software: black-box testing checks externally visible behavior, while white-box testing examines internal paths and implementation details.
Explanation
Using both approaches provides broader testing coverage than relying on either one alone.
- 56
What is GUI testing?
Model answer
GUI testing verifies that visible interface elements respond to user actions and produce the expected outcomes.
Explanation
It applies the input-and-expected-output idea of testing to graphical interactions.
- 57
Name two tools or techniques that can support automated GUI testing.
Model answer
Screen capture or screen-reading tools and automated keystroke generation can support GUI testing.
Explanation
These tools help observe the interface and simulate user actions.
- 58
Why can randomized input be useful in security testing?
Model answer
Randomized input helps expose unexpected weaknesses by testing values that developers may not have deliberately anticipated.
Explanation
For example, random values can be repeatedly sent to a login form to see whether the system remains secure and stable.
- 59
What is code coverage?
Model answer
Code coverage measures how much of a program's code is exercised by tests.
Explanation
It can refer to code in functions, loops, conditional statements, and other execution paths.
- 60
Why is achieving 100% code coverage difficult?
Model answer
Programs may contain many loop iterations, conditional paths, and possible states, making it difficult to test every execution possibility.
Explanation
A thorough loop test may need to cover zero, one, two, and many iterations, while stateful programs add further combinations.
- 61
Why is higher code coverage generally desirable even though complete coverage is difficult?
Model answer
Higher coverage means that more of the program's behavior has been checked against expectations, increasing confidence that the software works correctly.
Explanation
Coverage does not guarantee correctness, but it reduces the amount of untested code.
- 62
What is test-driven development?
Model answer
Test-driven development, or TDD, is a methodology in which developers write tests before the corresponding code, make the tests fail, and then write only enough code to make them pass.
Explanation
The cycle is repeated by writing another test and incrementally implementing the required behavior.
- 63
Describe the basic cycle of test-driven development.
Model answer
The developer writes a test, runs it and observes failure, writes the minimum code needed to pass it, and then repeats the process with another test.
Explanation
This incremental process can help achieve strong test coverage.
- 64
What are the four broad stages of the software engineering process described in the content?
Model answer
The stages are requirements gathering and analysis, planning, development, and testing.
Explanation
These stages describe the major activities from understanding customer needs through validating the finished system.
- 65
Are the stages of software engineering always completely separate and sequential?
Model answer
No. The stages can overlap and sometimes occur concurrently.
Explanation
Planning may begin during requirements work, and development processes often require repeated feedback and adjustment.
- 66
What happens after a product is completed and accepted by the customer?
Model answer
The product is deployed, but later requests for improvements, enhancements, or bug fixes may begin another development cycle.
Explanation
Software development commonly continues after the initial release.
- 67
Why is software engineering an iterative process in larger projects?
Model answer
Customer needs change and new defects or enhancement requests arise, requiring developers to repeat requirements work, planning, prototyping, development, and testing.
Explanation
The development cycle may continue repeatedly over the lifetime of a system.
- 68
Why are high cohesion, low coupling, readable code, revision control, and automated testing especially valuable in team projects?
Model answer
Together, they make a large codebase easier to understand, modify, integrate, verify, and maintain while reducing the risk that one change will disrupt unrelated work.
Explanation
These practices address the complexity and collaboration demands of professional software development.

Ask anything
We've read this whole study set, so questions about it get the best answers.