Software Testing and Testability

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Listen to an AI-generated conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What primary aspect does software testability address?

  • The cost of executing test cases.
  • The speed at which tests can be written.
  • The ease of revealing faults through testing. (correct)
  • The complexity of the test harness setup.

Why is calculating the probability of a software failure during testing not straightforward?

  • Because the number of possible test executions is infinite.
  • Because test case design is inherently subjective.
  • Because response measures for testability introduce complexity. (correct)
  • Because accurately simulating real-world conditions in a test environment is challenging.

In the context of software testing, what is the role of an oracle?

  • To simulate user interactions with the software.
  • To manage and organize test cases for efficient testing.
  • To determine if the output is correct by comparing it against the program's specification. (correct)
  • To execute the software and record the output.

What is the main purpose of a test harness?

<p>To control components inputs and observe the outputs during testing. (C)</p>
Signup and view all the answers

What is a key consideration when using specialized testing interfaces and methods?

<p>To ensure they do not interfere with required functionality. (A)</p>
Signup and view all the answers

What does the record/playback tactic primarily aim to achieve in software testing?

<p>To re-create specific states that caused faults. (A)</p>
Signup and view all the answers

Why can high coupling among classes negatively impact testability?

<p>It makes it more difficult to control the class under test independently. (C)</p>
Signup and view all the answers

What does the 'Sandbox' testing tactic involve?

<p>Isolating an instance of the system for experimentation. (C)</p>
Signup and view all the answers

What is the primary benefit of using executable assertions in code?

<p>They increase observability by indicating faulty states. (A)</p>
Signup and view all the answers

What does limiting nondeterminism aim to achieve in the context of testability?

<p>To make it easier to reproduce test results. (A)</p>
Signup and view all the answers

What is a significant benefit of designing software to be easily modifiable?

<p>It often improves the system's usability. (D)</p>
Signup and view all the answers

In the context of user interface design, what is meant by 'user initiative'?

<p>The user takes the lead in performing certain actions. (B)</p>
Signup and view all the answers

What is the primary reason behind carefully allocating system responsibilities to achieve high cohesion and low coupling?

<p>To enhance modularity, making testing safer and less complex. (B)</p>
Signup and view all the answers

What aspect of coordination among system elements most directly impacts usability?

<p>The timeliness, currency, completeness, and correctness. (A)</p>
Signup and view all the answers

What is the role of the 'Simian Army' at Netflix?

<p>To randomly induce failures to test the systems resilience. (A)</p>
Signup and view all the answers

What does the term 'testability' refer to in software engineering?

<p>The degree to which a software artifact supports testing in a given context. (C)</p>
Signup and view all the answers

Which of the following is a key element of the general scenario for testability?

<p>The environment in which the test is executed. (C)</p>
Signup and view all the answers

What does the testability tactic 'Abstract data sources' enable?

<p>Easily substituting test data without changing functional code. (A)</p>
Signup and view all the answers

What does the tactic 'Localize state storage' primarily facilitate?

<p>Starting a system in an arbitrary state for testing. (C)</p>
Signup and view all the answers

What is a typical goal of tactics for testability?

<p>To allow for easier testing as software development increments are completed. (B)</p>
Signup and view all the answers

What is the intention when more emphasis is placed on some faults than other faults?

<p>To find faults that have more impact. (A)</p>
Signup and view all the answers

To what does software testability refer?

<p>Ease with which software can be made (D)</p>
Signup and view all the answers

What does the success of the Netflix Streaming service depend on?

<p>High Availability (B)</p>
Signup and view all the answers

According to Robert Binder, what is important to making testing tractable?

<p>Controllability (D)</p>
Signup and view all the answers

What is the definition of the response of class C?

<p>The number of methods of C plus the methods of other classes that are invoked by the methods of C. (A)</p>
Signup and view all the answers

What is the main focus of the testability?

<p>Of a running system and its source code (B)</p>
Signup and view all the answers

What can the source of stimulus be in conducting the testing?

<p>Human or automated tester (B)</p>
Signup and view all the answers

Which of the following falls into a way that the system can respond?

<p>All of the above (D)</p>
Signup and view all the answers

What is meant by response measure?

<p>all of the above (D)</p>
Signup and view all the answers

Regarding having specialized interfaces and methods, how should they be handled?

<p>Be clearly identified or kept separate from the access methods and interfaces for required functionality (C)</p>
Signup and view all the answers

What is the purpose of tests?

<p>Finding the fault that caused the failure so that it can be removed (B)</p>
Signup and view all the answers

Which quality attributes benefit from high cohesion, loose coupling, and separation of concerns?

<p>Modifiability (D)</p>
Signup and view all the answers

What does the architecture need to do to make it amenable to testing?

<p>Overcome two more specific and daunting challenges (C)</p>
Signup and view all the answers

What are the recommended ways of generating your test data?

<p>You either write a system to generate your test data, or you capture a representative data set from the production environment (C)</p>
Signup and view all the answers

What are the advantages of creating your own test data?

<p>all of the above (D)</p>
Signup and view all the answers

Within the layers, which layers should be tested first?

<p>Lower layers (D)</p>
Signup and view all the answers

When the system needs to take the initiative, what must it rely on?

<p>A model of the user, the task being undertaken by the user, or the system state itself (D)</p>
Signup and view all the answers

When supporting user interface, what is helpful to giving the user feedback?

<p>give the user feedback as to what the system is doing and by allowing the user to make appropriate responses (C)</p>
Signup and view all the answers

Regarding the cancel command, what must the system be ready to do?

<p>listen for it (D)</p>
Signup and view all the answers

To support the ability to undo, what must the system maintain?

<p>A sufficient amount of information about system state so that an earlier state may be restored, at the user's request. (C)</p>
Signup and view all the answers

How does the use of specialized testing interfaces and methods impact performance-critical and safety-critical systems?

<p>It can be problematic, because removing test code might alter timing behavior after testing. (D)</p>
Signup and view all the answers

What is the primary goal of employing tactics that 'Limit Structural Complexity' in software design?

<p>To simplify the inheritance hierarchy and reduce dependencies between components. (D)</p>
Signup and view all the answers

How does incorporating variability into software architecture impact the software product line?

<p>It enhances the ability of core assets to adapt to usages within the product line's scope. (D)</p>
Signup and view all the answers

What architectural approach effectively supports portability?

<p>Isolating dependencies to well-identified locations and minimizing platform-specific code. (D)</p>
Signup and view all the answers

How can incorporating an 'eventual consistency' model affect system testability?

<p>It simplifies system design and makes testing easier. (A)</p>
Signup and view all the answers

When a user issues a 'cancel' command, what responsibilities should the system have?

<p>Inform collaborating components, terminate the command, and free up resources. (A)</p>
Signup and view all the answers

How do architectural improvements contribute to green computing?

<p>By optimizing software to reduce resource consumption. (C)</p>
Signup and view all the answers

In the context of software safety, what is the focus?

<p>Preventing hazardous failures and limiting damage when they occur. (D)</p>
Signup and view all the answers

What is a key function of 'actuators' in the context of software-related failures in physical systems?

<p>To translate software commands into physical actions. (C)</p>
Signup and view all the answers

How can employing 'Iowability' as an architectural goal benefit an organization?

<p>By attracting and retaining talented staff through state-of-the-art technology and creative freedom. (D)</p>
Signup and view all the answers

Flashcards

Software Testability

The ease with which software can be made to demonstrate its faults through testing.

Oracle (in testing)

An agent (human or mechanical) that decides whether the output of a test is correct by comparing it to the program's specification.

Test Harness

Specialized software or hardware designed to exercise the software under test, providing control and observation capabilities.

Simian Army

A suite of tools used to randomly inject failures into a system to test its resilience.

Signup and view all the flashcards

Latency Monkey

Induces artificial delays in communication to simulate service degradation.

Signup and view all the flashcards

Conformity Monkey

Finds instances that don't adhere to best practices and shuts them down.

Signup and view all the flashcards

Doctor Monkey

Taps into health checks to detect unhealthy instances.

Signup and view all the flashcards

Janitor Monkey

Ensures the Netflix cloud environment is free of clutter and waste.

Signup and view all the flashcards

Security Monkey

Finds security violations or vulnerabilities. Terminates offending instances.

Signup and view all the flashcards

10-18 Monkey

Detects configuration and runtime problems in instances serving customers in multiple geographic regions.

Signup and view all the flashcards

Source of Stimulus (Testability)

The actor that performs the testing.

Signup and view all the flashcards

Stimulus (Testability)

The specific set of tests that are executed.

Signup and view all the flashcards

Artifact (Testability)

Unit of code, subsystem, or the whole system being tested.

Signup and view all the flashcards

Environment (Testability)

Where the test is conducted (development, compile, deployment, or runtime).

Signup and view all the flashcards

Response (Testability)

The system behavior that is observed as a result of the test.

Signup and view all the flashcards

Response Measure (Testability)

Metrics that indicate how easily a system reveals its faults.

Signup and view all the flashcards

Specialized interfaces

Interfaces allowing control or capture of variable values for a component, used through a test harness

Signup and view all the flashcards

Record/Playback

Capturing the state when an interface crosses a fault, enabling recreation of the state.

Signup and view all the flashcards

Localize State Storage

Storing the state in a single place for easy manipulation during testing, making arbitrary states simpler to enter.

Signup and view all the flashcards

Abstract Data Sources

Easily controlling a program's input data to facilitate testing.

Signup and view all the flashcards

Sandbox

Isolating an instance of the system from the real world to enable experimentation without consequences.

Signup and view all the flashcards

Executable Assertions

Hand-coded checks placed at locations to indicate when a program is in a faulty state.

Signup and view all the flashcards

Component Replacement

Swapping the implementation of a component with a different implementation that facilitates testing.

Signup and view all the flashcards

Limit Structural Complexity

Avoiding or resolving cyclic dependencies between components.

Signup and view all the flashcards

Limit Nondeterminism

Limiting behavioral complexity by reducing sources of unpredictability.

Signup and view all the flashcards

Usability

How easy it is for a user to accomplish a desired task and the kind of user support provided.

Signup and view all the flashcards

Using a system efficiently

Making the system efficient to use.

Signup and view all the flashcards

Minimizing the impact of errors

Allowing a user to minimize the impact of their errors

Signup and view all the flashcards

Adapting the system to user needs

Adapting to the users needs

Signup and view all the flashcards

Increasing confidence and satisfaction

Increasing confidence and satisfaction

Signup and view all the flashcards

Support User Initiative

Giving users feedback as to what the system is doing.

Signup and view all the flashcards

Support System Initiative

Reliance on a model of the user, the task being undertaken by the user, or the system state itself.

Signup and view all the flashcards

Portability

Allowing existing software to run on different platforms.

Signup and view all the flashcards

Development Distributability

The design of software for distributed teams.

Signup and view all the flashcards

Scalability

Adding resources to handle load.

Signup and view all the flashcards

Elasticity

Achieves and removes virtual machines quickly.

Signup and view all the flashcards

Deployability

How effectively an executable arrives at and is invoked.

Signup and view all the flashcards

Monitorability

How well and easily a system is monitored.

Signup and view all the flashcards

Software Safety

Avoid entering damaged states.

Signup and view all the flashcards

Conceptual Integrity

Consistency throughout the architecture design.

Signup and view all the flashcards

Effectiveness

The ability that is building right.

Signup and view all the flashcards

Efficiency

The time and effort of development.

Signup and view all the flashcards

Freedom From Risk

The number of affected economic or environment cases.

Signup and view all the flashcards

Study Notes

Testability

  • Industry estimates state that 30-50% or more of system development costs go to testing
  • Software testability relates to how easily software demonstrates its faults through testing via execution
  • Testability is the likelihood that software fails on its next execution, assuming it has at least one fault
  • If a fault is present, the goal is for it to fail during testing as quickly as possible
  • Determining probability isn't easy and other measures will be used

Testing Model

  • Testing involves a program, input, and output
  • An oracle, whether human or mechanical, ascertains if the output aligns with the program's specification
  • Output involves the produced value along with derived quality attribute measures like production time
  • The program's internal state can be revealed to the oracle
  • The oracle can determine if the program has entered an erroneous state

System Testability

  • A system must control each component's inputs and observe their outputs
  • This control/observation uses a test harness meaning specialized software or hardware to check the software being tested
  • Test harnesses enable recording/playback of data over interfaces, and they can simulate external environments or aid in production
  • Test harnesses help execute procedures and record output and may be substantial software, complete with architecture and stakeholders
  • Testing is done by various developers, users, or QA personnel
  • Portions of a system or the entire system may undergo testing
  • The effectiveness in discovering faults and the rate at which tests achieve a desired coverage level is called response measures for testability
  • Test cases stem from developers plus testing groups or customers, and may drive development via Agile

Netflix's Simian Army

  • Netflix streams video and maintains a Simian Army made of tools for testing in its Amazon EC2 cloud service
  • The Simian Army began with Chaos Monkey
  • Chaos Monkey randomly terminates processes in the running system to test for failures and serious degradation
  • The Latency Monkey induces artificial delays in client-server communication to simulate service degradation and measures upstream services response
  • The Conformity Monkey detects and shuts down instances not adhering to best practices, or those instances not belonging to an autoscaling group
  • The Doctor Monkey identifies unhealthy instances by using external health checks i.e CPU load
  • The Janitor Monkey eliminates clutter and waste from Netflix cloud resources
  • The Security Monkey finds and terminates security violations and ensures DRM and SSL certificates are valid
  • The 10-18 Monkey finds configuration and runtime problems for customers in multiple regions, using different languages and character sets
  • Netflix determines what faults to examine based on their impact and severity
  • The Simian Army embodies the logging of operational data to reproduce faults and discover/log behavior in complex systems

Testability Scenario

  • Code testing serves as validation to ensure an engineered artifact meets the stakeholder's needs and intended use
  • Software architecture only involves running systems and source code, Architectural design reviews are another way of validation for architecture

Testability Scenario Portions

  • Source of stimulus is from unit testers, integration testers, developers, and even end users on the customer side that may be automated
  • Stimulus refers to tests executed upon completing a unit of coding or delivery to the customer
  • Artifact refers to a unit of code, a subsystem, or the whole system being tested
  • Environment includes the testing time (development, compile, deployment, runtime), or inside a test harness
  • Response states the system can be controlled, tests can be done, and results found

Response Measures

  • Response measures show how easily the system under test "gives up" its faults
  • These include efforts to find faults and particular fault classes
  • Finding a certain percentage of statements requires effort
  • Longest test chain signifies test difficulty
  • More include measures for effort, probability of more discovery, time frame, and time to prep the test environment
  • Additional ones are measured by bringing the system brought into its intended state
  • Error risk assessment and measuring risk reduction, in addition to rate the severity of the existing or found faults can also be used

Tactics for Testability

  • Easing testing is the goal during software development

Categories of Tactics

  • Enhance system traceability by adding system controllability and observability
  • Lessen complexity within the system's design

Control and Observe System State

  • Essential for control and observation that leads to defining testability
  • Best way to control and observe is giving a software component inputs, and then observing its outputs

Tactics Specifics

  • Software should keep state data
  • Testers can assign values to data
  • Accessible info to testers on request
  • State data includes the running state, variable values, performance load, intermediate steps to help remake component behavior

Specialized Interfaces

  • Interfaces that allow control or capture of a component's variable values, done either through a test harness or regular operation

Specialized Test Routines Examples

  • A set/get method to set important attributes
  • A report method to report the full state of the object
  • A reset method to sets the internal state A method for verbose output, and event logging for performance

Test Interfaces/Methods

  • Test interfaces/Methods separated so they can be removed when needed
  • Performance/Safety critical systems may have issues fielding test code
  • Code must behave the same way it was tested regardless of removals

Other Tactics

  • Record/playback: used to re-create a fault when the state that caused it is often difficult to remake, and capturing is done at an interface
  • Localize state storage: Convenient if a system, subsytem, or module to start in arbitrary test state if saved in one place
  • Abstract Data Sources: Testing control by controlling the input data to test, interfaces more abstracted to insert test data easily
  • Sandbox: Isolate the instance of system so its is unconstrained for testing, testing helped if operated with no permanent impact or has rollbacks

More Tactics

  • Implementations have ability to no have consequences to an experiment, it's is used for scenario analysis, training, and simulation
  • Virtualize resources: Build a controlled version of the resource, system clock and components can be tested at critical time boundaries (shift change)
  • Executable Assertions: Design assertions to check values satisfy constraints and is placed at desired locations to indicate faulty state
  • Assertions increase traceability when fail
  • Type can be annotated with checking code
  • Test cases have assertions to embed the test oracle in code, if correct and coded

Replacement

  • Replacing barebones code for more for more elaborate software for testing
  • Component Replacement swaps component and has more for testing
  • Preprocessor Macros state reporting, activate probe statements, or return testing console
  • Aspects report state

Limit Complexity

  • Difficult to test complex software because of large operating state space
  • Concerned about repeatable behavior to find the exact fault, not to just be able to make software fail
  • Limit Complexity category has three tactics

Limit Structural Complexity

  • Avoid/solve cyclic dependencies between components
  • Isolate or encapuslate environment deps
  • Reduce deps between components
  • Limit inheritance hierarchy
  • Limit polymorphism/dynamic calls
  • Structural Metric, response of the class (count of methods of C plus methods of others by C), increasing traceability
  • Increase cohesion/reduce coupling, all for improving traceability
  • Controllability critical to making testing tractable

Less Complex

  • Systems needing full data consistency all times more complex
  • Build system under "eventual consistency" model for a simple to system design
  • Architectures can help by lending traceability, layered style lets lower layers can be tested then higher layers
  • Limit Non Determinism (the counterpart to limiting structural complexity)- harding to test system
  • Tactic helps with finding all non determinism (parallelism) and weeding out what can be helped

Testability Summary

  • System being testable makes it reliable
  • Test Harness often used to execute tests
  • System state helps control
  • Ability to inject faults to system
  • Different tactics helps support components
  • Systems difficult cause too many connection and computations

Checklist

  • Tasks that to execute test capture logging, state being controlled must be made
  • Support must be added by systems of injection models
  • Main abstractions tests if the code will perform correct of system operations
  • Ensure data injection and setup are possible for test to be correct
  • Testing should be performed on each possible structure

Additional Checklist

  • Insure resources is available to have suites run and results happen the testing, limit access, capture fail data, inject limits (virtual tested should happen before to test correct

Testable Code

  • Late bound code should be tested, with bindings and full support of the ability
  • The goal should be reachable if is code tested
  • Tech support is should be chosen to support all test goals

Test Automation

  • Create useful test data set
  • Capture sample from production and remove sensitive information
  • Automation used more in more situations for less room of human error

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Use Quizgecko on...
Browser
Browser