1. Home
  2. Explore
  3. Computer Science
  4. Introduction to Software Engineering

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to Software Engineering

  • 65Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Engineering Foundations

What primarily distinguishes software engineering from hobbyist programming?

65 questions

  1. 1

    What primarily distinguishes software engineering from hobbyist programming?

    1. A

      Software engineering eliminates the need to understand programming fundamentals

    2. B

      Software engineering uses a standardized, structured, and thorough development approach

    3. C

      Software engineering requires programmers to use only one programming language

    4. D

      Software engineering focuses exclusively on writing code as quickly as possible

    Correct answer
    B

    Software 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.

  2. 2

    Why is software engineering especially important in professional development?

    1. A

      Professional developers must avoid planning so they can remain flexible

    2. B

      Professional projects must satisfy customers, follow standards, and maintain quality

    3. C

      Professional projects are always smaller than hobbyist programming projects

    4. D

      Professional developers are not expected to understand how their programs work

    Correct answer
    B

    Professional 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.

  3. 3

    Which set of qualities best describes the rigor expected of professionally engineered software?

    1. A

      Popularity, portability, and minimal documentation

    2. B

      Shortness, informality, and experimentation

    3. C

      Originality, speed, and visual complexity

    4. D

      Correctness, efficiency, and security

    Correct answer
    D

    Correctness, efficiency, and security

    Explanation

    The content identifies correctness, efficiency, and security as important aspects of software rigor.

  4. 4

    Why do coding conventions and styles become particularly important in professional projects?

    1. A

      Coding styles automatically guarantee that software is secure

    2. B

      Coding conventions allow developers to avoid gathering requirements

    3. C

      Professional code is never tested by its original programmer

    4. D

      Professional code may be maintained for years and modified by teams

    Correct answer
    D

    Professional 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.

  5. 5

    What is the main risk of beginning development without understanding customer requirements?

    1. A

      The project will require fewer revisions than originally planned

    2. B

      The team will always produce code that is too efficient

    3. C

      The team may spend substantial effort building a product that is not useful

    4. D

      The customer will automatically understand the implementation details

    Correct answer
    C

    The 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.

  6. 6

    How do the phases of software engineering typically relate to one another?

    1. A

      They are independent activities that never affect one another

    2. B

      They may overlap or occur concurrently rather than remaining completely separate

    3. C

      They must always occur once in a strict sequence without interaction

    4. D

      They occur only after the software has been deployed

    Correct answer
    B

    They 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.

  7. 7

    Why does software development often continue after the first product release?

    1. A

      Deployment automatically deletes the original requirements

    2. B

      Testing is legally prohibited before the first release

    3. C

      Customers may request enhancements, improvements, or bug fixes

    4. D

      Software engineering ends only when the original developers retire

    Correct answer
    C

    Customers 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.

  8. 8

    Which activity most directly represents requirements gathering?

    1. A

      Determining what the customer and users need before development begins

    2. B

      Measuring how much source code automated tests execute

    3. C

      Running a program repeatedly with random security inputs

    4. D

      Replacing a module without changing its interface

    Correct answer
    A

    Determining 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.

  9. 9

    Why may simply asking a customer to provide a requirements list be insufficient?

    1. A

      Developers are not permitted to record information from customers

    2. B

      The list may be long, poorly structured, or difficult for developers to use

    3. C

      A customer list automatically excludes all non-functional requirements

    4. D

      Customers are always able to specify every technical implementation detail

    Correct answer
    B

    The 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.

  10. 10

    Which set contains structured techniques for gathering requirements?

    1. A

      Charts, tables, and database indexes

    2. B

      Loops, conditionals, and variables

    3. C

      Surveys, interviews, and focus groups

    4. D

      Compilers, linkers, and debuggers

    Correct answer
    C

    Surveys, interviews, and focus groups

    Explanation

    Surveys, interviews, and focus groups are examples of structured, often conversational, requirements-gathering methods.

  11. 11

    What can developers learn by observing users interact with an existing software system?

    1. A

      The exact source code that the existing system used

    2. B

      Users' established habits and the pain points that a new system should address

    3. C

      The complete set of future features that users will request

    4. D

      The internal coupling between every component of the system

    Correct answer
    B

    Users' 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.

  12. 12

    What is the defining perspective used in use case analysis?

    1. A

      The perspective of the project manager assigning tasks

    2. B

      The perspective of the database storing the application data

    3. C

      The perspective of the programmer choosing an algorithm

    4. D

      The perspective of the user performing a real usage scenario

    Correct answer
    D

    The 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.

  13. 13

    What is a main success scenario in a use case?

    1. A

      A list of internal variables used by the implementation

    2. B

      A description of the project budget and development schedule

    3. C

      A set of unexpected failures that the system must ignore

    4. D

      A jargon-free sequence of steps describing the normal successful interaction

    Correct answer
    D

    A 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.

  14. 14

    In the sales-system example, what should happen when a user enters a quantity less than 111?

    1. A

      The system should store the invalid quantity as a valid sale

    2. B

      The system should close the application without explanation

    3. C

      The system should automatically change the quantity to its maximum value

    4. D

      The system should show an error and return to the input step

    Correct answer
    D

    The 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.

  15. 15

    What does a precondition specify in a use case?

    1. A

      A visual layout that must appear during the scenario

    2. B

      A result that must occur after the scenario succeeds

    3. C

      A condition that must be true before the scenario begins

    4. D

      A coding convention required for implementing the scenario

    Correct answer
    C

    A condition that must be true before the scenario begins

    Explanation

    Preconditions describe circumstances that must already hold before the use case can start.

  16. 16

    What does a postcondition specify in a use case?

    1. A

      What requirements the customer has not yet communicated

    2. B

      What programming language the developer must select

    3. C

      What must be true before the user begins interacting

    4. D

      What is true or happens after a scenario ends

    Correct answer
    D

    What 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.

  17. 17

    Which three elements are essential to a user story?

    1. A

      Who the user is, what the user wants, and why the user wants it

    2. B

      Which language is used, how fast it runs, and where it is hosted

    3. C

      Which database is used, which algorithm runs, and who tests it

    4. D

      What failed, when it failed, and how many lines were executed

    Correct answer
    A

    Who 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.

  18. 18

    How do user stories generally compare with use cases?

    1. A

      User stories are usually less detailed but emphasize the user's perspective and purpose

    2. B

      User stories exclude the user's goal while use cases include only business benefits

    3. C

      User stories are usually more technical and describe internal implementation steps

    4. D

      User stories describe only error conditions while use cases describe only success

    Correct answer
    A

    User 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.

  19. 19

    What does a functional requirement describe?

    1. A

      What the system needs to do

    2. B

      How many developers should join the project

    3. C

      How long the source code should be

    4. D

      How attractive the user interface should be

    Correct answer
    A

    What the system needs to do

    Explanation

    A functional requirement specifies a function or behavior that the system must provide.

  20. 20

    What does a non-functional requirement typically describe?

    1. A

      A sequence of programming statements used to implement a feature

    2. B

      A characteristic or quality of how the system performs its functions

    3. C

      A specific button that must appear in every user interface

    4. D

      A complete list of database records entered by a user

    Correct answer
    B

    A 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.

  21. 21

    What is the primary purpose of a prototype?

    1. A

      To measure code coverage before any requirements are established

    2. B

      To give customers a concrete feel for the proposed layout and interactions

    3. C

      To provide the final optimized implementation for deployment

    4. D

      To replace all requirements gathering with executable code

    Correct answer
    B

    To 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.

  22. 22

    Why are prototypes often revised through repeated discussions with users?

    1. A

      Revisions are required because prototypes must contain production-ready algorithms

    2. B

      Revisions ensure that all modules become highly coupled

    3. C

      Revisions make it unnecessary to define functional requirements

    4. D

      Revisions help confirm that the proposed system meets user needs before development

    Correct answer
    D

    Revisions 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.

  23. 23

    What is the main purpose of planning in software engineering?

    1. A

      To replace testing with predictions about program behavior

    2. B

      To create a roadmap for developing and coordinating a large project

    3. C

      To begin coding before understanding the customer's needs

    4. D

      To avoid deciding how the program's parts will interact

    Correct answer
    B

    To 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.

  24. 24

    What is modularization?

    1. A

      Combining every program feature into one shared state object

    2. B

      Testing only the visual appearance of a program

    3. C

      Breaking a large program into smaller, organized components

    4. D

      Replacing all user requirements with technical specifications

    Correct answer
    C

    Breaking a large program into smaller, organized components

    Explanation

    Modularization compartmentalizes a large program into smaller parts so that development and organization are more manageable.

  25. 25

    What two design goals are emphasized during modularization?

    1. A

      High duplication and low readability

    2. B

      High cohesion and low coupling

    3. C

      Low cohesion and high coupling

    4. D

      High complexity and low testability

    Correct answer
    B

    High cohesion and low coupling

    Explanation

    Good modularization aims to keep related responsibilities together and minimize dependencies between modules.

  26. 26

    What does cohesion measure?

    1. A

      How many programmers are assigned to a module

    2. B

      How quickly a module responds to user input

    3. C

      How closely related the elements within a module are

    4. D

      How many times a module has been tested

    Correct answer
    C

    How closely related the elements within a module are

    Explanation

    Cohesion concerns the relatedness of the functions or data handled within a single module.

  27. 27

    Which example demonstrates high cohesion?

    1. A

      A records module whose functions retrieve and manipulate records

    2. B

      A game module that directly shares every state variable with all others

    3. C

      A user interface module that stores unrelated business rules and data

    4. D

      A utilities module containing unrelated tasks with no common purpose

    Correct answer
    A

    A 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.

  28. 28

    Why is a general-purpose utilities module often considered to have low cohesion?

    1. A

      It contains only functions that operate on one clearly defined data type

    2. B

      It prevents every other module from communicating through messages

    3. C

      It guarantees that all responsibilities are handled in one location

    4. D

      It may group unrelated tasks together simply because they fit nowhere else

    Correct answer
    D

    It 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.

  29. 29

    What does coupling describe?

    1. A

      The number of requirements gathered from a customer

    2. B

      The amount of source code covered by automated tests

    3. C

      The degree to which modules depend on and interact with one another

    4. D

      The degree to which functions within one module share a purpose

    Correct answer
    C

    The degree to which modules depend on and interact with one another

    Explanation

    Coupling concerns relationships and dependencies between separate modules.

  30. 30

    Which situation indicates high coupling between modules?

    1. A

      A module performs several closely related operations on its own data

    2. B

      Changing one module requires substantial changes to another module

    3. C

      One module can be replaced without changing the rest of the program

    4. D

      Two modules communicate only through a stable message interface

    Correct answer
    B

    Changing 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.

  31. 31

    Why is communication through messages generally associated with low coupling?

    1. A

      Modules become responsible for all tasks performed by neighboring modules

    2. B

      Modules depend on what another module provides rather than its internal implementation

    3. C

      Modules must be rewritten whenever any internal detail changes

    4. D

      Modules directly modify every shared variable in the other modules

    Correct answer
    B

    Modules 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.

  32. 32

    What is a major problem with having many modules share one common game-state object?

    1. A

      It creates widespread dependencies so changes can affect many parts of the program

    2. B

      It prevents modules from accessing any information needed for their tasks

    3. C

      It guarantees that modules can be replaced without affecting other modules

    4. D

      It increases cohesion by ensuring every module has an unrelated responsibility

    Correct answer
    A

    It 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.

  33. 33

    What is separation of concerns intended to achieve?

    1. A

      Every user interface change requires changes to data and business logic

    2. B

      All program behavior is controlled through one global state variable

    3. C

      Each module duplicates the responsibilities of all other modules

    4. D

      Each module handles its own responsibility with minimal concern for other modules

    Correct answer
    D

    Each 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.

  34. 34

    How does separation of concerns improve maintainability?

    1. A

      A change can usually be made in one focused location with less risk of breaking other code

    2. B

      A change eliminates the need to understand the module being edited

    3. C

      A change requires developers to inspect every module before modifying any code

    4. D

      A change automatically duplicates the same implementation across the program

    Correct answer
    A

    A 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.

  35. 35

    What is a software pattern?

    1. A

      A testing result that measures the number of executed statements

    2. B

      A random technique created specifically for one unusual defect

    3. C

      A list of customer requests that has not yet been analyzed

    4. D

      A standardized approach to solving a recurring type of problem

    Correct answer
    D

    A standardized approach to solving a recurring type of problem

    Explanation

    Patterns provide reusable, more or less standardized solutions to problems that occur repeatedly.

  36. 36

    Why are established software patterns encouraged?

    1. A

      They guarantee that no requirements changes will ever be necessary

    2. B

      They tend to produce code that is more intuitive, readable, and trusted through prior use

    3. C

      They eliminate the need for testing because patterns cannot contain errors

    4. D

      They require every program to use the same data structures and interface

    Correct answer
    B

    They 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.

  37. 37

    Which type of application is especially suited to the Model-View-Controller pattern?

    1. A

      An application whose only operation is compiling source code

    2. B

      An application that contains no stored data and no user interaction

    3. C

      An application that intentionally combines all responsibilities in one module

    4. D

      An application with data or logic that interacts with a user interface

    Correct answer
    D

    An 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.

  38. 38

    What is the responsibility of the model in MVC?

    1. A

      To provide buttons and controls for user interaction

    2. B

      To execute automated tests against unrelated modules

    3. C

      To determine how data is visually displayed to the user

    4. D

      To contain the application's data and the logic for manipulating or retrieving it

    Correct answer
    D

    To 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.

  39. 39

    What is the responsibility of the view in MVC?

    1. A

      To store all application data in a shared global object

    2. B

      To present model data to the user in an appropriate form

    3. C

      To decide which internal algorithm the model must use

    4. D

      To define the business requirements before development begins

    Correct answer
    B

    To 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.

  40. 40

    What is the responsibility of the controller in MVC?

    1. A

      To store the application's records independently of the model

    2. B

      To measure the percentage of code covered by tests

    3. C

      To provide controls through which users interact with the system

    4. D

      To display all data without receiving user actions

    Correct answer
    C

    To 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.

  41. 41

    In the sales-system MVC example, which mapping is correct?

    1. A

      Sales records are the model, a table is the view, and sidebar buttons are the controller

    2. B

      Sales records are the view, a table is the controller, and sidebar buttons are the model

    3. C

      Sales records are the view, a table is the model, and sidebar buttons are the database

    4. D

      Sales records are the controller, a table is the model, and sidebar buttons are the view

    Correct answer
    A

    Sales 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.

  42. 42

    What does substitutability in MVC allow developers to do?

    1. A

      Replace the model while requiring every view and controller to be rewritten

    2. B

      Remove the need for a user interface whenever data is stored

    3. C

      Modify all three MVC components whenever the presentation changes

    4. D

      Replace one component, such as a table view, without modifying the model or controller

    Correct answer
    D

    Replace 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.

  43. 43

    What change would add administrator controls while preserving the existing data and presentation?

    1. A

      Replace the view while leaving the model and controller unchanged

    2. B

      Replace the model while leaving the controller and view unchanged

    3. C

      Combine the model, view, and controller into one shared state object

    4. D

      Replace or modify the controller while leaving the model and view unchanged

    Correct answer
    D

    Replace 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.

  44. 44

    Why is readable code especially valuable in professional software projects?

    1. A

      It ensures that the program will never need maintenance after deployment

    2. B

      It makes testing unnecessary because the code explains itself

    3. C

      It makes future modification easier for developers working over time or in teams

    4. D

      It allows developers to avoid documenting requirements and design decisions

    Correct answer
    C

    It 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.

  45. 45

    Why are magic numbers harmful to code readability?

    1. A

      They prevent a program from using variables or constants

    2. B

      Their meanings are unclear when they appear without descriptive names

    3. C

      They can be used only in programs written for embedded devices

    4. D

      They always cause arithmetic operations to produce incorrect results

    Correct answer
    B

    Their 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.

  46. 46

    What is a recommended way to replace a magic number?

    1. A

      Assign it to a meaningful variable, constant, or macro name

    2. B

      Remove all comments and rely on the number's position in the code

    3. C

      Repeat the number in more locations so its meaning becomes familiar

    4. D

      Replace it with a different arbitrary number selected during testing

    Correct answer
    A

    Assign 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.

  47. 47

    Which function name best follows the recommended naming practice?

    1. A

      queryDatabase

    2. B

      thing

    3. C

      value

    4. D

      database

    Correct answer
    A

    queryDatabase

    Explanation

    Function names are preferably verbs or action phrases. queryDatabase clearly indicates that the function performs a database query.

  48. 48

    Why is isOn a clearer Boolean variable name than power?

    1. A

      It prevents the variable from being changed during program execution

    2. B

      It guarantees that the variable can store more than two possible values

    3. C

      It indicates that the variable contains a database query result

    4. D

      It explicitly describes a state and reads naturally in a conditional

    Correct answer
    D

    It explicitly describes a state and reads naturally in a conditional

    Explanation

    A name such as isOn clearly communicates a Boolean state and makes an expression such as if (isOn) easy to read.

  49. 49

    What is the main purpose of a revision control system?

    1. A

      To prevent multiple programmers from contributing to one project

    2. B

      To automatically convert requirements into finished source code

    3. C

      To track changes and allow developers to move between versions of code

    4. D

      To replace all manual and automated testing procedures

    Correct answer
    C

    To 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.

  50. 50

    How do revision control systems support collaboration?

    1. A

      They automatically decide which customer requirements are most important

    2. B

      They prevent developers from seeing any changes made by teammates

    3. C

      They allow multiple developers to commit changes that can be merged into a product

    4. D

      They require each developer to work permanently on an isolated copy

    Correct answer
    C

    They 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.

  51. 51

    What is the central purpose of software testing as described in the content?

    1. A

      To prove that a program contains no possible defects

    2. B

      To replace requirements analysis with random experimentation

    3. C

      To determine whether the source code uses enough comments

    4. D

      To compare actual program behavior with expected behavior

    Correct answer
    D

    To compare actual program behavior with expected behavior

    Explanation

    Testing checks whether what happens in the real program matches what developers expect to happen.

  52. 52

    What distinguishes automated unit testing from casually clicking through a program?

    1. A

      Automated unit testing systematically runs defined test cases against individual functions or modules

    2. B

      Automated unit testing tests only the color and layout of the user interface

    3. C

      Automated unit testing relies entirely on a user's intuition about whether the interface feels correct

    4. D

      Automated unit testing avoids specifying expected results before execution

    Correct answer
    A

    Automated 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.

  53. 53

    What can a failed unit test reveal beyond the fact that something is wrong?

    1. A

      The specific operation where actual behavior violates the expectation

    2. B

      The total amount of code that has never been written

    3. C

      The complete list of all defects that exist in the entire program

    4. D

      The exact customer requirement that caused the defect

    Correct answer
    A

    The 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.

  54. 54

    What does integration testing evaluate?

    1. A

      Whether multiple modules work correctly together

    2. B

      Whether one isolated function has the correct output

    3. C

      Whether a prototype accurately displays the proposed layout

    4. D

      Whether a variable has a descriptive name

    Correct answer
    A

    Whether multiple modules work correctly together

    Explanation

    Integration testing checks interactions among modules because individually correct modules may still fail when connected.

  55. 55

    Why is integration testing necessary even when individual unit tests pass?

    1. A

      Integration tests are the only tests that can detect syntax errors

    2. B

      Correct modules can still interact incorrectly when linked together

    3. C

      Unit tests cannot execute any functions in isolation

    4. D

      A passing unit test automatically proves that all interfaces are correct

    Correct answer
    B

    Correct 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.

  56. 56

    In the sales-system example, what would be an integration test?

    1. A

      Checking whether one arithmetic function subtracts two numbers correctly

    2. B

      Checking whether a prototype slide uses the correct color scheme

    3. C

      Editing a record through the controller and checking whether the model changes

    4. D

      Checking whether a button is named clearly in the source code

    Correct answer
    C

    Editing 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.

  57. 57

    What characterizes black-box testing?

    1. A

      Testing inputs and outputs without relying on knowledge of internal implementation

    2. B

      Replacing the module's implementation with a different one during testing

    3. C

      Designing tests specifically to execute every internal branch

    4. D

      Testing only private helper functions inside a module

    Correct answer
    A

    Testing 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.

  58. 58

    What characterizes white-box or glass-box testing?

    1. A

      Ignoring the module's implementation and checking only its public output

    2. B

      Testing only whether users understand the interface labels

    3. C

      Testing whether separate modules can be merged into one module

    4. D

      Designing tests with awareness of the module's internal implementation

    Correct answer
    D

    Designing 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.

  59. 59

    What is the purpose of GUI testing?

    1. A

      To measure how many internal branches a database query executes

    2. B

      To identify which customers should participate in focus groups

    3. C

      To verify that visible user-interface actions produce the expected outcomes

    4. D

      To determine whether modules have high cohesion

    Correct answer
    C

    To 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.

  60. 60

    Which tools could support automated GUI testing?

    1. A

      Focus groups, surveys, and customer interviews

    2. B

      Compilers, source-code formatters, and revision-history viewers

    3. C

      Screen capture, screen reading, and automated keystroke-generation tools

    4. D

      Database schemas, state variables, and module diagrams

    Correct answer
    C

    Screen 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.

  61. 61

    Why can randomized inputs be useful in security testing?

    1. A

      They ensure that users will never enter invalid information

    2. B

      They help test how the system handles unexpected values and possible flaws

    3. C

      They replace the need to define expected behavior for ordinary inputs

    4. D

      They guarantee that every possible security vulnerability will be discovered

    Correct answer
    B

    They 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.

  62. 62

    What does code coverage measure?

    1. A

      How many requirements were gathered from the customer

    2. B

      How many developers have committed to the repository

    3. C

      How many visual elements appear in the graphical interface

    4. D

      How much of the program's code is exercised by tests

    Correct answer
    D

    How 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.

  63. 63

    Why is achieving complete code coverage difficult?

    1. A

      Code coverage measures only comments rather than executable statements

    2. B

      Testing tools are unable to compare actual results with expected results

    3. C

      Loops, conditional paths, and numerous program states create many possibilities to test

    4. D

      Automated tests cannot execute functions more than once

    Correct answer
    C

    Loops, 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.

  64. 64

    What is the basic cycle of test-driven development?

    1. A

      Write all production code, deploy it, and then define tests from user complaints

    2. B

      Write a test, observe its failure, write enough code to pass it, and repeat

    3. C

      Build the interface first, avoid tests, and add modules after deployment

    4. D

      Run random inputs, remove failed tests, and rewrite the requirements

    Correct answer
    B

    Write 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.

  65. 65

    How can test-driven development contribute to strong code coverage?

    1. A

      It avoids testing edge cases because only successful behavior is implemented

    2. B

      It tests only the most visually important parts of the interface

    3. C

      It measures coverage without executing any program code

    4. D

      Each new behavior is introduced through a test before the corresponding code is written

    Correct answer
    D

    Each 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.

Question 1 of 65
Question 1 of 65

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent