Introduction to Software Engineering
- 65Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What primarily distinguishes software engineering from hobbyist programming?
What primarily distinguishes software engineering from hobbyist programming?
65 questions
- 1
What primarily distinguishes software engineering from hobbyist programming?
- A
Software engineering eliminates the need to understand programming fundamentals
- B
Software engineering uses a standardized, structured, and thorough development approach
- C
Software engineering requires programmers to use only one programming language
- D
Software engineering focuses exclusively on writing code as quickly as possible
Correct answer
BSoftware engineering uses a standardized, structured, and thorough development approach
Explanation
Software engineering treats the entire development process, from start to finish, in a standardized, structured, and thorough manner.
- A
- 2
Why is software engineering especially important in professional development?
- A
Professional developers must avoid planning so they can remain flexible
- B
Professional projects must satisfy customers, follow standards, and maintain quality
- C
Professional projects are always smaller than hobbyist programming projects
- D
Professional developers are not expected to understand how their programs work
Correct answer
BProfessional projects must satisfy customers, follow standards, and maintain quality
Explanation
Software engineering helps developers build the correct product, follow coding standards, and produce code that is correct, efficient, and secure.
- A
- 3
Which set of qualities best describes the rigor expected of professionally engineered software?
- A
Popularity, portability, and minimal documentation
- B
Shortness, informality, and experimentation
- C
Originality, speed, and visual complexity
- D
Correctness, efficiency, and security
Correct answer
DCorrectness, efficiency, and security
Explanation
The content identifies correctness, efficiency, and security as important aspects of software rigor.
- A
- 4
Why do coding conventions and styles become particularly important in professional projects?
- A
Coding styles automatically guarantee that software is secure
- B
Coding conventions allow developers to avoid gathering requirements
- C
Professional code is never tested by its original programmer
- D
Professional code may be maintained for years and modified by teams
Correct answer
DProfessional code may be maintained for years and modified by teams
Explanation
Consistent conventions help teams work together and make code easier to maintain over months or years.
- A
- 5
What is the main risk of beginning development without understanding customer requirements?
- A
The project will require fewer revisions than originally planned
- B
The team will always produce code that is too efficient
- C
The team may spend substantial effort building a product that is not useful
- D
The customer will automatically understand the implementation details
Correct answer
CThe team may spend substantial effort building a product that is not useful
Explanation
Developing the wrong product wastes time and may leave the customer dissatisfied.
- A
- 6
How do the phases of software engineering typically relate to one another?
- A
They are independent activities that never affect one another
- B
They may overlap or occur concurrently rather than remaining completely separate
- C
They must always occur once in a strict sequence without interaction
- D
They occur only after the software has been deployed
Correct answer
BThey may overlap or occur concurrently rather than remaining completely separate
Explanation
Although the phases can be described sequentially, requirements, planning, development, and testing may overlap or run concurrently.
- A
- 7
Why does software development often continue after the first product release?
- A
Deployment automatically deletes the original requirements
- B
Testing is legally prohibited before the first release
- C
Customers may request enhancements, improvements, or bug fixes
- D
Software engineering ends only when the original developers retire
Correct answer
CCustomers may request enhancements, improvements, or bug fixes
Explanation
After deployment, customers commonly request changes, so the requirements, planning, prototyping, development, and testing cycle begins again.
- A
- 8
Which activity most directly represents requirements gathering?
- A
Determining what the customer and users need before development begins
- B
Measuring how much source code automated tests execute
- C
Running a program repeatedly with random security inputs
- D
Replacing a module without changing its interface
Correct answer
ADetermining what the customer and users need before development begins
Explanation
Requirements gathering is the process of understanding what the customer wants before serious development starts.
- A
- 9
Why may simply asking a customer to provide a requirements list be insufficient?
- A
Developers are not permitted to record information from customers
- B
The list may be long, poorly structured, or difficult for developers to use
- C
A customer list automatically excludes all non-functional requirements
- D
Customers are always able to specify every technical implementation detail
Correct answer
BThe list may be long, poorly structured, or difficult for developers to use
Explanation
Customers may not know exactly what they want, and a list written by non-programmers may not be sufficiently useful or precise.
- A
- 10
Which set contains structured techniques for gathering requirements?
- A
Charts, tables, and database indexes
- B
Loops, conditionals, and variables
- C
Surveys, interviews, and focus groups
- D
Compilers, linkers, and debuggers
Correct answer
CSurveys, interviews, and focus groups
Explanation
Surveys, interviews, and focus groups are examples of structured, often conversational, requirements-gathering methods.
- A
- 11
What can developers learn by observing users interact with an existing software system?
- A
The exact source code that the existing system used
- B
Users' established habits and the pain points that a new system should address
- C
The complete set of future features that users will request
- D
The internal coupling between every component of the system
Correct answer
BUsers' established habits and the pain points that a new system should address
Explanation
Observation reveals what users are accustomed to doing and where they experience difficulties.
- A
- 12
What is the defining perspective used in use case analysis?
- A
The perspective of the project manager assigning tasks
- B
The perspective of the database storing the application data
- C
The perspective of the programmer choosing an algorithm
- D
The perspective of the user performing a real usage scenario
Correct answer
DThe perspective of the user performing a real usage scenario
Explanation
Use case analysis describes how a user interacts with the system in a realistic scenario.
- A
- 13
What is a main success scenario in a use case?
- A
A list of internal variables used by the implementation
- B
A description of the project budget and development schedule
- C
A set of unexpected failures that the system must ignore
- D
A jargon-free sequence of steps describing the normal successful interaction
Correct answer
DA jargon-free sequence of steps describing the normal successful interaction
Explanation
The main success scenario expresses the successful interaction as intuitive, descriptive steps from the user's point of view.
- A
- 14
In the sales-system example, what should happen when a user enters a quantity less than 1?
- A
The system should store the invalid quantity as a valid sale
- B
The system should close the application without explanation
- C
The system should automatically change the quantity to its maximum value
- D
The system should show an error and return to the input step
Correct answer
DThe system should show an error and return to the input step
Explanation
The error condition displays an error and returns the user to the earlier step so the mistake can be corrected.
- A
- 15
What does a precondition specify in a use case?
- A
A visual layout that must appear during the scenario
- B
A result that must occur after the scenario succeeds
- C
A condition that must be true before the scenario begins
- D
A coding convention required for implementing the scenario
Correct answer
CA condition that must be true before the scenario begins
Explanation
Preconditions describe circumstances that must already hold before the use case can start.
- A
- 16
What does a postcondition specify in a use case?
- A
What requirements the customer has not yet communicated
- B
What programming language the developer must select
- C
What must be true before the user begins interacting
- D
What is true or happens after a scenario ends
Correct answer
DWhat is true or happens after a scenario ends
Explanation
Postconditions describe the outcome at the end of a scenario, including different possible outcomes such as closing a dialog.
- A
- 17
Which three elements are essential to a user story?
- A
Who the user is, what the user wants, and why the user wants it
- B
Which language is used, how fast it runs, and where it is hosted
- C
Which database is used, which algorithm runs, and who tests it
- D
What failed, when it failed, and how many lines were executed
Correct answer
AWho the user is, what the user wants, and why the user wants it
Explanation
A user story identifies the user, the desired action or capability, and the reason or benefit behind it.
- A
- 18
How do user stories generally compare with use cases?
- A
User stories are usually less detailed but emphasize the user's perspective and purpose
- B
User stories exclude the user's goal while use cases include only business benefits
- C
User stories are usually more technical and describe internal implementation steps
- D
User stories describe only error conditions while use cases describe only success
Correct answer
AUser stories are usually less detailed but emphasize the user's perspective and purpose
Explanation
User stories are less detailed than use cases and place the reader in the user's position, including why the capability is wanted.
- A
- 19
What does a functional requirement describe?
- A
What the system needs to do
- B
How many developers should join the project
- C
How long the source code should be
- D
How attractive the user interface should be
Correct answer
AWhat the system needs to do
Explanation
A functional requirement specifies a function or behavior that the system must provide.
- A
- 20
What does a non-functional requirement typically describe?
- A
A sequence of programming statements used to implement a feature
- B
A characteristic or quality of how the system performs its functions
- C
A specific button that must appear in every user interface
- D
A complete list of database records entered by a user
Correct answer
BA characteristic or quality of how the system performs its functions
Explanation
Non-functional requirements describe characteristics such as performance rather than specifying a particular system function.
- A
- 21
What is the primary purpose of a prototype?
- A
To measure code coverage before any requirements are established
- B
To give customers a concrete feel for the proposed layout and interactions
- C
To provide the final optimized implementation for deployment
- D
To replace all requirements gathering with executable code
Correct answer
BTo give customers a concrete feel for the proposed layout and interactions
Explanation
A prototype can show how the system looks, how its parts connect, and how users may interact with it, even when it is non-functional.
- A
- 22
Why are prototypes often revised through repeated discussions with users?
- A
Revisions are required because prototypes must contain production-ready algorithms
- B
Revisions ensure that all modules become highly coupled
- C
Revisions make it unnecessary to define functional requirements
- D
Revisions help confirm that the proposed system meets user needs before development
Correct answer
DRevisions help confirm that the proposed system meets user needs before development
Explanation
Teams refine prototypes with customer feedback until the requirements are sufficiently certain to begin serious development.
- A
- 23
What is the main purpose of planning in software engineering?
- A
To replace testing with predictions about program behavior
- B
To create a roadmap for developing and coordinating a large project
- C
To begin coding before understanding the customer's needs
- D
To avoid deciding how the program's parts will interact
Correct answer
BTo create a roadmap for developing and coordinating a large project
Explanation
Planning addresses how the project will be developed over the coming weeks and months and how its parts will interact.
- A
- 24
What is modularization?
- A
Combining every program feature into one shared state object
- B
Testing only the visual appearance of a program
- C
Breaking a large program into smaller, organized components
- D
Replacing all user requirements with technical specifications
Correct answer
CBreaking a large program into smaller, organized components
Explanation
Modularization compartmentalizes a large program into smaller parts so that development and organization are more manageable.
- A
- 25
What two design goals are emphasized during modularization?
- A
High duplication and low readability
- B
High cohesion and low coupling
- C
Low cohesion and high coupling
- D
High complexity and low testability
Correct answer
BHigh cohesion and low coupling
Explanation
Good modularization aims to keep related responsibilities together and minimize dependencies between modules.
- A
- 26
What does cohesion measure?
- A
How many programmers are assigned to a module
- B
How quickly a module responds to user input
- C
How closely related the elements within a module are
- D
How many times a module has been tested
Correct answer
CHow closely related the elements within a module are
Explanation
Cohesion concerns the relatedness of the functions or data handled within a single module.
- A
- 27
Which example demonstrates high cohesion?
- A
A records module whose functions retrieve and manipulate records
- B
A game module that directly shares every state variable with all others
- C
A user interface module that stores unrelated business rules and data
- D
A utilities module containing unrelated tasks with no common purpose
Correct answer
AA records module whose functions retrieve and manipulate records
Explanation
The records module has functions that are all strongly related to working with records, so it has high cohesion.
- A
- 28
Why is a general-purpose utilities module often considered to have low cohesion?
- A
It contains only functions that operate on one clearly defined data type
- B
It prevents every other module from communicating through messages
- C
It guarantees that all responsibilities are handled in one location
- D
It may group unrelated tasks together simply because they fit nowhere else
Correct answer
DIt may group unrelated tasks together simply because they fit nowhere else
Explanation
A utilities or tools module often collects unrelated functions, meaning its internal elements lack a strong common relationship.
- A
- 29
What does coupling describe?
- A
The number of requirements gathered from a customer
- B
The amount of source code covered by automated tests
- C
The degree to which modules depend on and interact with one another
- D
The degree to which functions within one module share a purpose
Correct answer
CThe degree to which modules depend on and interact with one another
Explanation
Coupling concerns relationships and dependencies between separate modules.
- A
- 30
Which situation indicates high coupling between modules?
- A
A module performs several closely related operations on its own data
- B
Changing one module requires substantial changes to another module
- C
One module can be replaced without changing the rest of the program
- D
Two modules communicate only through a stable message interface
Correct answer
BChanging one module requires substantial changes to another module
Explanation
High coupling means modules are highly dependent, so modifications to one often force modifications to others.
- A
- 31
Why is communication through messages generally associated with low coupling?
- A
Modules become responsible for all tasks performed by neighboring modules
- B
Modules depend on what another module provides rather than its internal implementation
- C
Modules must be rewritten whenever any internal detail changes
- D
Modules directly modify every shared variable in the other modules
Correct answer
BModules depend on what another module provides rather than its internal implementation
Explanation
With low coupling, modules communicate through defined messages and do not need to know one another's internal workings.
- A
- 32
What is a major problem with having many modules share one common game-state object?
- A
It creates widespread dependencies so changes can affect many parts of the program
- B
It prevents modules from accessing any information needed for their tasks
- C
It guarantees that modules can be replaced without affecting other modules
- D
It increases cohesion by ensuring every module has an unrelated responsibility
Correct answer
AIt creates widespread dependencies so changes can affect many parts of the program
Explanation
A shared state object makes many modules dependent on the same data, increasing coupling and making modifications difficult to manage.
- A
- 33
What is separation of concerns intended to achieve?
- A
Every user interface change requires changes to data and business logic
- B
All program behavior is controlled through one global state variable
- C
Each module duplicates the responsibilities of all other modules
- D
Each module handles its own responsibility with minimal concern for other modules
Correct answer
DEach module handles its own responsibility with minimal concern for other modules
Explanation
High cohesion and low coupling produce separation of concerns, making each module responsible for a distinct area of functionality.
- A
- 34
How does separation of concerns improve maintainability?
- A
A change can usually be made in one focused location with less risk of breaking other code
- B
A change eliminates the need to understand the module being edited
- C
A change requires developers to inspect every module before modifying any code
- D
A change automatically duplicates the same implementation across the program
Correct answer
AA change can usually be made in one focused location with less risk of breaking other code
Explanation
When responsibilities are separated, developers know where to make a change and can reduce unintended effects elsewhere.
- A
- 35
What is a software pattern?
- A
A testing result that measures the number of executed statements
- B
A random technique created specifically for one unusual defect
- C
A list of customer requests that has not yet been analyzed
- D
A standardized approach to solving a recurring type of problem
Correct answer
DA standardized approach to solving a recurring type of problem
Explanation
Patterns provide reusable, more or less standardized solutions to problems that occur repeatedly.
- A
- 36
Why are established software patterns encouraged?
- A
They guarantee that no requirements changes will ever be necessary
- B
They tend to produce code that is more intuitive, readable, and trusted through prior use
- C
They eliminate the need for testing because patterns cannot contain errors
- D
They require every program to use the same data structures and interface
Correct answer
BThey tend to produce code that is more intuitive, readable, and trusted through prior use
Explanation
Patterns make common solutions easier to understand and provide confidence because they are tried and tested approaches.
- A
- 37
Which type of application is especially suited to the Model-View-Controller pattern?
- A
An application whose only operation is compiling source code
- B
An application that contains no stored data and no user interaction
- C
An application that intentionally combines all responsibilities in one module
- D
An application with data or logic that interacts with a user interface
Correct answer
DAn application with data or logic that interacts with a user interface
Explanation
MVC is useful for programs in which a storage or logic component interacts with a user interface.
- A
- 38
What is the responsibility of the model in MVC?
- A
To provide buttons and controls for user interaction
- B
To execute automated tests against unrelated modules
- C
To determine how data is visually displayed to the user
- D
To contain the application's data and the logic for manipulating or retrieving it
Correct answer
DTo contain the application's data and the logic for manipulating or retrieving it
Explanation
The model is the abstract, low-level representation of the data and the functions that retrieve or modify it.
- A
- 39
What is the responsibility of the view in MVC?
- A
To store all application data in a shared global object
- B
To present model data to the user in an appropriate form
- C
To decide which internal algorithm the model must use
- D
To define the business requirements before development begins
Correct answer
BTo present model data to the user in an appropriate form
Explanation
The view takes data from the model and presents it to the user, such as in a table or chart.
- A
- 40
What is the responsibility of the controller in MVC?
- A
To store the application's records independently of the model
- B
To measure the percentage of code covered by tests
- C
To provide controls through which users interact with the system
- D
To display all data without receiving user actions
Correct answer
CTo provide controls through which users interact with the system
Explanation
The controller handles user interaction through controls such as buttons and can trigger changes to the model or view.
- A
- 41
In the sales-system MVC example, which mapping is correct?
- A
Sales records are the model, a table is the view, and sidebar buttons are the controller
- B
Sales records are the view, a table is the controller, and sidebar buttons are the model
- C
Sales records are the view, a table is the model, and sidebar buttons are the database
- D
Sales records are the controller, a table is the model, and sidebar buttons are the view
Correct answer
ASales records are the model, a table is the view, and sidebar buttons are the controller
Explanation
The sales records represent the data and logic in the model, the table displays them as the view, and the buttons provide controls as the controller.
- A
- 42
What does substitutability in MVC allow developers to do?
- A
Replace the model while requiring every view and controller to be rewritten
- B
Remove the need for a user interface whenever data is stored
- C
Modify all three MVC components whenever the presentation changes
- D
Replace one component, such as a table view, without modifying the model or controller
Correct answer
DReplace one component, such as a table view, without modifying the model or controller
Explanation
Because MVC separates responsibilities, a table can be replaced with a chart while the underlying model and controller remain unchanged.
- A
- 43
What change would add administrator controls while preserving the existing data and presentation?
- A
Replace the view while leaving the model and controller unchanged
- B
Replace the model while leaving the controller and view unchanged
- C
Combine the model, view, and controller into one shared state object
- D
Replace or modify the controller while leaving the model and view unchanged
Correct answer
DReplace or modify the controller while leaving the model and view unchanged
Explanation
Adding user controls is a controller change; the model and view can remain unaffected.
- A
- 44
Why is readable code especially valuable in professional software projects?
- A
It ensures that the program will never need maintenance after deployment
- B
It makes testing unnecessary because the code explains itself
- C
It makes future modification easier for developers working over time or in teams
- D
It allows developers to avoid documenting requirements and design decisions
Correct answer
CIt makes future modification easier for developers working over time or in teams
Explanation
Readable code reduces the time needed to understand and safely modify a large or long-lived project.
- A
- 45
Why are magic numbers harmful to code readability?
- A
They prevent a program from using variables or constants
- B
Their meanings are unclear when they appear without descriptive names
- C
They can be used only in programs written for embedded devices
- D
They always cause arithmetic operations to produce incorrect results
Correct answer
BTheir meanings are unclear when they appear without descriptive names
Explanation
An unexplained numeric value may be difficult to interpret later, especially when it represents a meaningful code or setting.
- A
- 46
What is a recommended way to replace a magic number?
- A
Assign it to a meaningful variable, constant, or macro name
- B
Remove all comments and rely on the number's position in the code
- C
Repeat the number in more locations so its meaning becomes familiar
- D
Replace it with a different arbitrary number selected during testing
Correct answer
AAssign it to a meaningful variable, constant, or macro name
Explanation
Giving the value a meaningful name communicates what it represents and makes the code easier to understand.
- A
- 47
Which function name best follows the recommended naming practice?
- A
queryDatabase - B
thing - C
value - D
database
Correct answer
AqueryDatabaseExplanation
Function names are preferably verbs or action phrases.
queryDatabaseclearly indicates that the function performs a database query. - A
- 48
Why is
isOna clearer Boolean variable name thanpower?- A
It prevents the variable from being changed during program execution
- B
It guarantees that the variable can store more than two possible values
- C
It indicates that the variable contains a database query result
- D
It explicitly describes a state and reads naturally in a conditional
Correct answer
DIt explicitly describes a state and reads naturally in a conditional
Explanation
A name such as
isOnclearly communicates a Boolean state and makes an expression such asif (isOn)easy to read. - A
- 49
What is the main purpose of a revision control system?
- A
To prevent multiple programmers from contributing to one project
- B
To automatically convert requirements into finished source code
- C
To track changes and allow developers to move between versions of code
- D
To replace all manual and automated testing procedures
Correct answer
CTo track changes and allow developers to move between versions of code
Explanation
Revision control records code changes, supports version history, and allows developers to move backward or forward between versions.
- A
- 50
How do revision control systems support collaboration?
- A
They automatically decide which customer requirements are most important
- B
They prevent developers from seeing any changes made by teammates
- C
They allow multiple developers to commit changes that can be merged into a product
- D
They require each developer to work permanently on an isolated copy
Correct answer
CThey allow multiple developers to commit changes that can be merged into a product
Explanation
Collaborators can contribute code through commits, after which changes can be merged into the final product.
- A
- 51
What is the central purpose of software testing as described in the content?
- A
To prove that a program contains no possible defects
- B
To replace requirements analysis with random experimentation
- C
To determine whether the source code uses enough comments
- D
To compare actual program behavior with expected behavior
Correct answer
DTo compare actual program behavior with expected behavior
Explanation
Testing checks whether what happens in the real program matches what developers expect to happen.
- A
- 52
What distinguishes automated unit testing from casually clicking through a program?
- A
Automated unit testing systematically runs defined test cases against individual functions or modules
- B
Automated unit testing tests only the color and layout of the user interface
- C
Automated unit testing relies entirely on a user's intuition about whether the interface feels correct
- D
Automated unit testing avoids specifying expected results before execution
Correct answer
AAutomated unit testing systematically runs defined test cases against individual functions or modules
Explanation
Unit testing uses tools to run planned test cases, often function by function, and compares actual results with expected results.
- A
- 53
What can a failed unit test reveal beyond the fact that something is wrong?
- A
The specific operation where actual behavior violates the expectation
- B
The total amount of code that has never been written
- C
The complete list of all defects that exist in the entire program
- D
The exact customer requirement that caused the defect
Correct answer
AThe specific operation where actual behavior violates the expectation
Explanation
A failed test identifies a particular operation whose result does not match the expected result, helping pinpoint the problem.
- A
- 54
What does integration testing evaluate?
- A
Whether multiple modules work correctly together
- B
Whether one isolated function has the correct output
- C
Whether a prototype accurately displays the proposed layout
- D
Whether a variable has a descriptive name
Correct answer
AWhether multiple modules work correctly together
Explanation
Integration testing checks interactions among modules because individually correct modules may still fail when connected.
- A
- 55
Why is integration testing necessary even when individual unit tests pass?
- A
Integration tests are the only tests that can detect syntax errors
- B
Correct modules can still interact incorrectly when linked together
- C
Unit tests cannot execute any functions in isolation
- D
A passing unit test automatically proves that all interfaces are correct
Correct answer
BCorrect modules can still interact incorrectly when linked together
Explanation
Modules may work independently but fail because their connections or assumptions about one another are incorrect.
- A
- 56
In the sales-system example, what would be an integration test?
- A
Checking whether one arithmetic function subtracts two numbers correctly
- B
Checking whether a prototype slide uses the correct color scheme
- C
Editing a record through the controller and checking whether the model changes
- D
Checking whether a button is named clearly in the source code
Correct answer
CEditing a record through the controller and checking whether the model changes
Explanation
This test evaluates the linkage between the controller and model rather than testing either component in isolation.
- A
- 57
What characterizes black-box testing?
- A
Testing inputs and outputs without relying on knowledge of internal implementation
- B
Replacing the module's implementation with a different one during testing
- C
Designing tests specifically to execute every internal branch
- D
Testing only private helper functions inside a module
Correct answer
ATesting inputs and outputs without relying on knowledge of internal implementation
Explanation
Black-box testing treats the module as a black box and evaluates its externally observable behavior against its specifications.
- A
- 58
What characterizes white-box or glass-box testing?
- A
Ignoring the module's implementation and checking only its public output
- B
Testing only whether users understand the interface labels
- C
Testing whether separate modules can be merged into one module
- D
Designing tests with awareness of the module's internal implementation
Correct answer
DDesigning tests with awareness of the module's internal implementation
Explanation
White-box testing considers internal implementation and may target internal paths or features that black-box testing cannot observe.
- A
- 59
What is the purpose of GUI testing?
- A
To measure how many internal branches a database query executes
- B
To identify which customers should participate in focus groups
- C
To verify that visible user-interface actions produce the expected outcomes
- D
To determine whether modules have high cohesion
Correct answer
CTo verify that visible user-interface actions produce the expected outcomes
Explanation
GUI testing applies expected-versus-actual testing to visual interactions, actions, and outcomes presented to users.
- A
- 60
Which tools could support automated GUI testing?
- A
Focus groups, surveys, and customer interviews
- B
Compilers, source-code formatters, and revision-history viewers
- C
Screen capture, screen reading, and automated keystroke-generation tools
- D
Database schemas, state variables, and module diagrams
Correct answer
CScreen capture, screen reading, and automated keystroke-generation tools
Explanation
The content identifies screen capture, screen reading, and automated keystrokes as possible tools for GUI testing.
- A
- 61
Why can randomized inputs be useful in security testing?
- A
They ensure that users will never enter invalid information
- B
They help test how the system handles unexpected values and possible flaws
- C
They replace the need to define expected behavior for ordinary inputs
- D
They guarantee that every possible security vulnerability will be discovered
Correct answer
BThey help test how the system handles unexpected values and possible flaws
Explanation
Security testing benefits from unexpected and random inputs because vulnerabilities may appear outside the values developers consciously choose.
- A
- 62
What does code coverage measure?
- A
How many requirements were gathered from the customer
- B
How many developers have committed to the repository
- C
How many visual elements appear in the graphical interface
- D
How much of the program's code is exercised by tests
Correct answer
DHow much of the program's code is exercised by tests
Explanation
Code coverage measures the portion of code reached or exercised by the test suite.
- A
- 63
Why is achieving complete code coverage difficult?
- A
Code coverage measures only comments rather than executable statements
- B
Testing tools are unable to compare actual results with expected results
- C
Loops, conditional paths, and numerous program states create many possibilities to test
- D
Automated tests cannot execute functions more than once
Correct answer
CLoops, conditional paths, and numerous program states create many possibilities to test
Explanation
Thorough testing may require different loop counts, conditional paths, and program states, making complete coverage difficult as complexity grows.
- A
- 64
What is the basic cycle of test-driven development?
- A
Write all production code, deploy it, and then define tests from user complaints
- B
Write a test, observe its failure, write enough code to pass it, and repeat
- C
Build the interface first, avoid tests, and add modules after deployment
- D
Run random inputs, remove failed tests, and rewrite the requirements
Correct answer
BWrite a test, observe its failure, write enough code to pass it, and repeat
Explanation
TDD begins with tests, uses failing tests to guide implementation, and adds only enough code to make each test pass before repeating the process.
- A
- 65
How can test-driven development contribute to strong code coverage?
- A
It avoids testing edge cases because only successful behavior is implemented
- B
It tests only the most visually important parts of the interface
- C
It measures coverage without executing any program code
- D
Each new behavior is introduced through a test before the corresponding code is written
Correct answer
DEach new behavior is introduced through a test before the corresponding code is written
Explanation
Because tests are written first and added continuously as functionality is developed, TDD can systematically exercise much of the program.
- A

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