NPTEL Software Testing Week 4 Assignment Answers 2024

Sanket
By Sanket

NPTEL Software Testing Week 4 Assignment Answers 2024

1. If a particular method A in a class sends a message using an exclusive buffer to a method B in another class, which type of interface does this constitute?

  • Class interface.
  • Buffer interface.
  • Message passing interface.
  • Shared interface.
Answer :- For Answers Click Hera 

2. In a call graph that represents all the function or method calls, what does edge coverage achieve?

  • Edge coverage tests for executing every call at least once.
  • Edge coverage tests for executing all the paths that contain calls at least once.
  • Edge coverage tests for sending data on call interfaces.
  • Edge coverage tests for calling every function or method in any order.
Answer :- For Answers Click Hera 

3. Which of the following best defines a coupling du-path?

  • A coupling du-path is from a coupled definition of a variable to the corresponding use.
  • A coupling du-path is from the last definition of a variable to the first use of the same variable.
  • A coupling du-path is from a definition of a variable to its use such that there is no definition in between.
  • A coupling du-path is from a last definition of a variable to any use across a call interface.
Answer :- 

4. State true or false: While testing for data flow in call interfaces, we need not consider only the last definition and the first use of a particular variable.

  • True.
  • False.
Answer :- 

5. While testing for sequencing constraints on specifications using graphs, what kind of test paths are tyically used?

  • Test paths are defined to satisfy the sequencing constraints.
  • Test paths are defined to violate the sequencing constraints.
  • Test paths are dependent on the kind of sequencing constraints, might satisfy them are violate them.
  • Test paths are the sequencing constraints themselves.
Answer :- 

6. Consider a finite state machine that models the behaviour of a bounded queue data structure that is used in a piece of code. What do the states of the machine represent?

  • The states of the finite state machine represent the operations supported by the queue data structure.
  • The states of the finite state machine represent the contents of the queue, one state for every cell in the queue.
  • It is not possible to represent a bounded queue data structure using a finite state machine.
  • The states of the finite state machine represent the contents of the queue, one state when the queue is empty, one state when the queue has only one element, and so on, one state when the queue is full.
Answer :- For Answers Click Hera 

For the next four questions,consider the methods open(), close(), read(), write(), and suspend() which execute the operations of opening and closing a file, reading from a particular file, writing some data to a particular file and suspending an on-going operation, respectively. The sequencing constraints for the use of these methods are listed below.

  • An open() method should always be eventually be followed by an invocation of the closed() method unless there is an invocation of suspend() in between.
  • read() or write() methods cannot be invoked without opening a file, i.e., invoking an open() method.
  • Every open() should have at least one read() or write() following its invocation, before closing the file.

The following graph captures the sequence of method calls regarding the usage of the above methods for a particular piece of code. The nodes that do not have labels represent some part of the code that does not invoke the above methods.

W4G2 ST

Answer the following questions with reference to a set of test paths that might be written regarding the sequencing constraints for the considered piece of code.

7. State yes or no: Does the sequence of two consecutive invocations of the write() method violate any of the above sequencing constraints?

  • Yes.
  • No.
Answer :- 

8. State yes or no: Does the path that has two consecutive invocations of the read() method violate any of the above sequencing constraints?

  • Yes.
  • No.
Answer :- 

9. Identify a path that violates one of the above sequencing constraints from the paths given below.

  • Path: open(), read(), write(), write(), close().
  • Path: open(), suspend(), read(), close().
  • Path: open(), read(), read(), close().
  • Path: open(), read(), read(), write(), close().
Answer :- 

10. Does the edge from open() to suspend(), representing the suspension of an open operation violate any of the sequencing constraints given above?

  • Yes.
  • No.
Answer :- For Answers Click Hera 
Share This Article
Leave a comment