Engineering

Software Design methodologies and Testing BE Computer (2012 Course) Endsem May 2016

BE Computer (2012 Course)

Semester-2, May 2016

Software Design methodologies and Testing

Time: 2:30 hour                                                                                  Marks: 70

Q1) a) What is class diagram important in static modeling? How is it difficult from an object diagram? (5 marks)

Ans:

  • First the requirements are analyzed and required use cases are identified by system architect then objects are identified in respective problem domain.
  • Class shows the abstraction of real world. Objects of same type belong to one class and collection of objects of same type forms class.
  • Objects are statically represented as classes. For example Employee is class and payment is object. Objects are an instance of class.
  • Attributes and Operations are constituent of class.
  1. Attributes: Represents the property of object.
  2. Operations: Represents the function which objects perform.

Fig. Representation of classes and objects in UML

  • Classes are represented by using boxes in UML. Representing one or more than one class with relationship among them is called class diagram.
  • Class diagram construct static model of system. Three types of relationship included which are:
  1. Association relationship
  2. Composition and aggregation relationship
  3. Generalization and specialization relationship

Q1) b) Draw a sequence diagram for ATM system.  (5 marks)

Ans:

Fig. Sequence diagram for ATM system

Q2) a) Explain synchronous communication pattern in client-server architecture with help of a diagram.

Ans:

  • This pattern is mostly used in client-server architecture. In this pattern, client send request to server for service then wait for reply. Once server send back the reply, then client proceeds further.
  • There is no any message queue is maintained in between client and server.

Fig. Synchronous message communication with reply pattern (one client and one server example)

  • There may be more than one client request for service. Both the client implements reply pattern of synchronous communication. A queue may be used at server side in such application to handle several requests.

Q2) b) Explain intent, motivation, structure and consequence of observer pattern. (5 marks)

Ans:

  • Observer pattern is used in software application development. It uses object state and interaction.
  • Observer get notify when there any state change occurs. It is also called as Publish-subscribe pattern.
  • Intent: One to many dependency is implemented in between objects hence when there is change in state of one object then all the dependents are notified and updated automatically.
  • Motivation: Mobile and web based application make use of observer pattern where mobile application considers as observer which gets notified for state change on subject. To design such system by simply partitioning the classes in not enough. Consistency need to be maintained between objects.
  • Structure:

Fig. Class diagram for Observer Pattern

 

Subject: It is observed by any no. of observers for any state change.

Observer: An updating interface is declared by observer for objects who wants to be notified.

ConcreteSubject: It stores the state which needs to be observed by observers.

ConcreteObserver: It maintains a reference to concrete subject object.

  • Consequences:
  • Notifications are broadcasted to all objects who subscribed for state change event.
  • If subject state change depends on other object states then, in that case, subject play the role of observer and other object becomes subject. In this manner, the updates and notifications can be cascaded to different levels of observers and subject.
  • A subject does not have the knowledge of the concrete class of observer which can cause loose coupling between observer and subject.

Q3) a) Explain different software testing strategies. (6 marks)

Ans:

Software Design Strategies:

  • It is a set of procedures that describe software testing approach in software development life cycle.
  • Testing strategies include:
  1. Test Objective
  2. Test Levels
  3. Roles and Responsibilities
  4. Environment Requirements
  5. Testing Tools
  6. Risk and Mitigation
  7. Test schedule
  8. Method of Regression Test

 

Let discuss one by one:

  1. Test Objective:

The main aim is to find the defect in system. The objectives can be priorities by organizations but the main objective is remain same. Some objectives are gaining confidence while providing information about level of quality, to earn the confidence of client by giving quality product.

 

  1. Test Levels: There are four test levels which are:
  • Unit Testing- It is carried out mostly by developers.
  • Integration testing- It is carried out by testing team.
  • System Testing- It is carried out by testing team.
  • Acceptance Testing- It is carried out by customer and business analysts.
  1. Roles and Responsibilities: It needs to define clearly while carrying out testing. Roles of developers, quality analysts and test engineers in different cycle of testing need to be defined clearly.

 

  1. Environment Requirements: It describes environment where the testing is going to be performed which also include hardware testing.

 

  1. Testing Tools: Organization standardizes the automation testing cycle by training the test engineers and developers on automated tools.

 

  1. Risk and Mitigation: Risk anticipation gives scope for action to be taken in advance.

 

  1. Test Schedule: It describes how much time it will take to finish each phase of testing.

 

  1. Method of regression test: A Regression test ensures the smooth working of system after enhancement been applied.

 

Q3) b) Is complete testing possible? When to stop testing? What are the test resumption criteria? (6 marks)

Ans:

  • Practically complete testing is not possible in software application development.
  • Condition where to stop testing:
  1. When no any dependent system is available to test existing system.
  2. When occurred defect does not allow further testing.
  3. When testing resources are not available.

All the above cases describe the condition to stop testing.

  • Test resumption criteria:
  1. When time is remaining in software delivery and there is commitment of best quality product.
  2. When failure occurs in similar parallel product which make influence on current software system.
  3. When development system is available which causes earlier suspension.

Q3) c) Explain the difference between software verification and validation with an example. (6 marks)

Ans:

Sr. No. Verification Validation
    1. It is a process of evaluating software to determine whether products satisfy the condition imposed at the start of that phase. It is a process of evaluating software during or at end of development process to find out whether it satisfies specified requirements.
2. It does not involve any code execution. It involves code execution.
3. It is human based checking. It is computer based execution of program.
4. It checks whether the software meets the specified specifications or not. It checks whether software meets the customer expectations and requirements.
5. It catches error which validation phase cannot able to catch. It catches error which verification phase cannot able to catch.
6. It uses inspections, reviews and desk-checking methods. It uses black box, gray box, white box testing.
7. It is performed by QA team. It is performed by testing team.

Example:

Let take example of a Submit button, verification will check the design document and correct the spelling mistakes while in validation testing, developer will make submit button clickable.

Q4) a) What is defect severity? How is it different from defect priority? Explain with an example. (6 marks)

Ans:

Defect Severity:

  • It is a degree of impact of defect at hand on software development system.
  • For ex., If customer not able to book his match ticket because of defect then it may categories into highest priority. Here severity is comparatively less.

 

Test Defect Metrics:

  • It helps in understanding how the identified defects can be used to improve quality of product and quality of testing.
  • Organizations classify the bugs in different priority and severity. Suppose D1, D2, D3 are defects and defect priority defines the order in which the defect should fixed. D1 should fix before D2 and D2 should fix before D3.
  • Organization may give more priority to defect severity because it is decided by testing team.
  • For ex., If customer not able to book his match ticket because of defect then it may categories into highest priority. Here the defect is hard to reproduce therefore severity is comparatively less.

Q4) b) Explain different stages of V test model with neat diagram. (6 marks)

Ans:

  • It is software development model and extension of waterfall model. It forms a V shape to bend upwards after coding phase and define testing, verification, validation against each development phase.
  • First it defines high level of business requirements from client point of view. System design starts when system requirements are specified. High level software design illustrates system in the form of subsystem with interconnection and interfaces.
  • In Low level system design, high level system design is refined to include smaller details. Design patterns are applied and properties as well as operations of each module are identified.

Fig. V model with its different phases of testing

  • In coding phase, algorithms are written in programming languages. Coding results in small units of programs that tested individually. Programs logic is checked.
  • With low level design phase, integration testing is performed. Interoperating and integrated sub-system are tested by integration testing.
  • At last in acceptance testing, the software is tested to ensure that it meets the customer requirements. It makes sure that the product is acceptable by user and meets the user environments.
  • At every development stage at left side of V model, test design activities are included and their execution lies on right side in upward direction.

 

Q4) c) State and explain different software testing principles. (6 marks)

Ans:

Principles of software testing:

  • Objectives of testing should be clearly defined before starting the test.
  • Defects may contain a fix pattern and may occur in clusters so that testing should be aimed to find out such pattern and should focus on clusters.
  • Defect prevention and detection is addressed by testing.
  • Understanding of test methodologies and process should be clear and verified before starting the test.
  • The main aim is to find the defect in software before customer finds them.
  • Testing is not the end of development cycle but it is applied at all stages of development life cycle of software.

Q5) a) Why system testing is required? Explain its type and significance of each. (8 marks)

Ans:

  • System testing is performed on complete integrated system capable of performing all specified operations.
  • System testing is performed after unit and integration testing. It tests working of all specified features including software and hardware.
  • It also checks functional and non-functional requirements of system.
  • It identifies client perspective in system for the first time.
  • It develops the confidence for stakeholders in product.
  • It makes sure that product is ready for acceptable testing.
  • Types of system testing:
  1. Stress testing: It test the system by overloading it beyond its specified limits.
  2. Scalability testing: It checks the maximum capacity of testing.
  3. Reliability testing: It checks the ability of system to perform its functionality repeatedly.
  4. Performance testing: It tests the system on the basis of the response time or time taken by the system.
  5. Localization testing: It checks the language compatibility of system.
  6. Inter-operability testing: It makes sure that system is communicating and co-operating with other system which supposed to work together.

 

Q5) b) State and explain different phases of testing. (8 marks)

Ans:

Phases of system are:

  1. Unit testing
  2. Integration testing
  3. System testing
  4. Acceptance testing

Fig. Phases of testing

  1. Unit Testing:

 

  • In this individual units or components of software are tested.
  • A unit is a smallest testable part of any software system.
  • It generally contains some inputs and one output.
  • In object-oriented programming, the smallest unit is a method, which may belong to a super class, abstract class or child class.
  • White box testing method is used in unit testing.
  • It is first level of software testing and performed before integration testing.
  • Debugging is easy and cost of defect fixing is less in unit testing.

 

  1. Integration Testing
  • In this, individual units are combined and tested as a group.
  • The aim of integration testing is to find out faults in interaction between integrated units.
  • Any of black box, gray box, white box testing methods are used in integration testing.
  • It is performed after unit testing and before system testing.
  • Developers themselves or testers perform integration testing.

 

  1. System Testing:

 

  • In this, complete and integrated software is tested to verify that it is as per the specified requirements.
  • Black box testing method is used in system testing.
  • It is performed after integration testing and before acceptance testing.
  • It is carried out by testers.

 

  1. Acceptance Testing:

 

  • In acceptance testing, system is tested for acceptability.
  • It is carried out to determine whether system satisfies the acceptance criteria or not and enables customer to determine whether the system is acceptable or not.
  • Black box testing method is used in acceptance testing.
  • It is performed after system testing and last level of software testing.

 

Q6) a) Consider the following program segment. (10 marks)

Main()

{

Int number,index;

Printf(“Enter a number”);

Scanf(“%d”,&number);

Index=2;

While(Index<=number-1)

{

If(number%index==0)

{

Printf(“Not a prime number”);

Break;

}

Index++;

}

If(index==number)

Printf(“prime number”);

}

 

  • Draw the control flow graph for the program.
  • Calculate the cyclomatic complexity of the program.
  • List all the independent paths.
  • Design the test cases for the independent path.

Ans:

  • Control flow graph:

  • Cyclomatic complexity:

V(G) = E-N+2=10-8+2=4

 

  • Independent paths:

Path 1 : 1-2-4-2-3-5-6-8

Path 2 : 1-2-4-2-3-5-6-7-8

Path 3 : 1-2-4-2-5-6-8

Path 4 : 1-2-4-2-5-6-7-8

Path 5 : 1-2-5-6-8

Path 6 : 1-2-5-6-7-8

Path 7 : 1-2-3-5-6-8

Path 8 : 1-2-3-5-6-7-8

 

  • Test cases:

Case 1:

Number entered = 0

Path 5 verified

 

Case 2

Number entered = 2

Path 6 verified

 

Case 3

Number entered = 3

Path 4 verified

 

Case 4

Number entered = 4

Path 7 verified

 

Case 2

Number entered = 5

Path 4 verified

And so on.

 

 

Q6) b) Explain the Equivalence class method of testing with one suitable example. (6 marks)

Ans:

  • It is a black box testing technique which divides input into partition of equivalent data then test cases can be derived for the partitions.
  • Each partition is included in test cases.
  • It reduces the time in conducting test because it contains less number of tests.
  • One test case is designed for entire partition.
  • It identify all partitions for complete set of input and output values and select one member value from each partition for testing.
  • Let take example of system which take values between 1 to 100. Valid equivalence class partition is from 1 to 100 and invalid is more than 100, decimal numbers, alphabet.

Q7) a) Differentiate between manual testing and Automated testing.

Ans:

Manual Testing Automated testing
1. It takes lot of time. It takes less time.
2. Test cases are limited. Test cases more than manual testing.
3. Limited data is used to carry out testing. Large amount of test data is used.
4. It is carried out manually by tester. It is carried out using automated testing tools.
5. It is slow. It is fast.
6. No programming is done. Testers can program sophisticated tests to expose hidden information.
7. It is less reliable. It is more reliable.

 

Q7) b) Explain the features of selenium and Junit. (8 marks)

Ans:

Selenium:

  • It is licensed under Apache.
  • It is open source test automation tool.
  • It is a tool to automate the browser.
  • It used in testing web application and gives automation of web administration.
  • It provides testing framework for web application.
  • In this, knowledge of test scripting language is not required. Selenium provides test domain specific language which used to design and write test cases.
  • Most of the web browser running projects to make selenium native part of their browser.
  • It available in IDE, API driver and framework.

 

Junit:

  • It is open source framework which supports unit testing and compatible with java language.
  • Junit supports annotations for identifying test methods.
  • It provides methods for creating and running test cases.
  • It is simple.
  • Junit is easy to understand.
  • Programmer who knows java can perform testing with Junit framework.
  • Effort and resources of testing are minimizes at product development stages.

Q8) a) Explain GUI and web based application testing. (8 marks)

Ans:

GUI Testing:

  • It is a set of techniques to perform testing for product graphical user interface.
  • It make sure that the product GUI meets the all the specified requirements and does not contain any defect in its operation.
  • It evaluates elements like font, text, caption layout, labels, buttons, links etc.
  • GUI testing can be manual or automation testing.
  • It is time consuming testing process.
  • It also checks for program functionality and its behavior which triggers any GUI event.
  • It can be performed by internal team or third party experts.
  • User is also take part is GUI testing. Check the different GUI elements are properly aligned and clarity of image and readability of font.

Web based application testing:

  • It is used for verifying and validating the application hosted on web.
  • Components of web based testing are:
  1. Usability Testing: It involves testing from user point of view.
  2. Compatibility Testing: It tests the compatibility of software with different devices, operating systems.
  3. Interface Testing: It test interfacing of web application with other systems.
  4. Functionality Testing: It validates all fields of application and its functionality.

Q 8) b) Write a short note on Monkey Talk and highlight its features. (8 marks)

Ans:

Monkey Talk:

  • It is functional testing platform for mobile applications.
  • It is easy to use and fast to test.
  • It can be conducted on real devices or simulator.
  • It supports HTML 5, hybrid and flex apps.
  • Monkey talks IDE, Monkey talk agent Monkey talk script are three components of monkey talk.
  • It is interactive test platform to conduct automated testing for application developed for android and iOS.
  • Tool is available in beta version for non-commercial use and limited free version for commercial use.
  • Monkey talk agent command can be executed, recorded as required.
  • Native monkey talk script or java script is used to write test.
  • Complete automation testing can be implemented using monkey talk.
  • Monkey talk allows integrating eclipse based development environment.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.