BE Computer (2012 Course)
Semester-2, May 2017
Software Design methodologies and Testing
Time: 2:30 hour Marks: 70
Q1) a) Explain Aggregation, Composition and Generalization with reference to class diagram. (5 marks)
Ans:
Composition and aggregation:
- The object attributes and relationships are identified. In some cases identified class is made up of other classes. Such relationship is called as composition and aggregation relationship.
- Let take an example of a college class which composed of classes like department, office. So we can say that department is a part of college.
- In another example mobile phone contains processor, battery. So we can say that battery is part of mobile phone.
- Example 2 is an example of composite relationship. Both examples show the weaker relationship between classes.
- One college may contain multiple departments and closing one department will not close the entire college. So here we use aggregation relationship. Aggregation hierarchy is weaker version of whole relationship.
- Figure shows the composition relationship and uses smartphone as composite class and its part to depict entire relationship.
Eg. Example of composition hierarchy
- Following figure represent aggregation hierarchy where college is aggregate class. Aggregation specifies “has a relationship”. So college has a T&P department.
Fig. Example of aggregation hierarchy
- Generalization is type of parent and child relationship between the classes where child inherits attributes of the parent. Generalization and specialization represents inheritance relationship. A class get generalized when we go upward from child to parent.
- In the following figure most abstract class is college employee and it has attributes like teaching staff etc.
Fig. Generalization/Specialization hierarchy
Q1) b) Explain briefly web service protocols. (5 marks)
Ans:
- It provides a standard for communication between client and service.
- It provides foundation for communication for service oriented architecture.
- It is used in distributed environments.
- SOAP message contain an envelope which describe the message, an encoding rules for sender and receiver with data type description, also convention for representing response message and remote procedure calls.
Q2) a) Draw use case diagram for online digital library information system with all advanced notations. (5 marks)
Ans:
Fig. Use case diagram for online digital library system.
Q2) b) What are the major classification of design pattern? Explain in brief with few example patterns under each class. (5 marks)
Ans:
Classification of design pattern:
- Creational design pattern:
- The main aim is to abstract the instantiation process.
- It is applied when system is in dependent complexities of object creation and representation.
- Abstract factory is type of creational design pattern which provide an interface for creating an object that are independent.
- Structural design pattern:
- When primary concern of design is to compose large structures from classes and objects, then structural design pattern is used.
- It uses inheritance to compose interfaces.
- Proxy is a type of design pattern which is used as place holder for another object that controls the access to main object.
- Behavioural design pattern:
- The main aim is to assign algorithms and responsibilities to objects.
- It used to describe class, objects and their communication.
- It describes the control flow at runtime between objects and make easy to understand the interconnection of objects.
Q3) a) What do you mean by software design? Explain its importance. (5 marks)
Ans:
- It is a process of implementing the software.
- Design process is important in software development which results in better design and lead to a successful product.
- It is an initial step towards the solution with available capabilities.
- Software design refers both the process of designing and the design product.
- Design process is one which involves creativity. A skilled and experienced architect needs to be creative while developing software strategies.
- A design process describes the sequence of steps through which the architect of software is proceeded to design solution.
Q3) b) What is singleton pattern? Explain one example scenario where you will singleton pattern to get applied. (5 marks)
Ans:
- In singleton pattern, only one instance of class must be created and which can be used as global point of access. In this, class is responsible for instantiating itself.
- In this, a class ensures that only one instance of class is exists by keep tracking itself. Thus, a special operation allows user to access the unique instance.
- There is no any collaboration of classes for accessing the singleton instance. User access the instance from well-defined access point.
- If any other instance is present and class get request to instantiate itself again then it reject the request.
- It makes the system free from global variables.
- Singleton class is supposed to encapsulate its sole instance.
- For example, there should be only one instance of antivirus scan is running in system.
Fig. UML class diagram
Example:
- Singleton patterns are used to implement log manager class which gives global logging access to several components of application.
- There should be single instance of log manager which allows only one components of system to print its log at a time.
Q4) a) What is 4+1 architecture view model? Explain with suitable diagram. (5 marks)
Ans:
- Software architecture views cover different aspects of system that implemented and also look it from different way.
Fig. 4+1 Architecture view
- Logical view: It is related to functionalities offered to end user of system. Module can be represent by sequence, class and communication diagram.
- Development view: It is also called as component design view. This is the developer’s view who contributes in project development. Module can be represent by component and package diagram.
- Process view: It is related to runtime aspects of the system which describe program structure at runtime. It also deals with concurrency, performance and scalability.
Module can be represented by activity diagram.
- Physical view: It is system engineer point of view and related to deployment, administration and environment of system. This view represents tools and its interaction, supporting software. Module can be represented by deployment diagram.
- Scenarios: Scenario at the centre represents fifth view which refers as use case view.
It has four views which are:
- Conceptual view: Primary design elements are described in this view.
- Module view: It describes module and its interaction.
- Execution view: It describes run time, concurrent execution perspective.
- Code view: It describes structure of source code and their classification into objects.
Q4) b) Describe real time software architecture on brief. (5 marks)
Ans:
Real Time Software Architecture:
- Real time software system has to handle multiple streams of inputs and need to respond quickly during its operation.
- They are concurrent architecture where system is structured into concurrent tasks and are state independent.
- It describes interfaces between concurrent tasks and interconnection between the concurrent tasks.
- The system need to be designed carefully. It is a combination of real time operating system, application, input/output etc.
- The system has multiple inputs and output and need to handle concurrently.
Fig. Layout of real time system
Characteristic of real time software architecture are:
- They are concurrent systems and have time constraints for operations.
- Real time systems are complex system.
- They produce multiple independent results for multiple independent inputs.
- Real time system contains special purpose device drivers which can be connected to sensors and actuators.
- Real time system contains real time input and output system with real time operating system and real time applications.
- The time of data arrival is not known and load can be varying at different times, thus the system is unpredictable.
- Soft and hard real time system requires different design strategies.
Q5) a) Explain V test model with suitable block diagram. (8 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.
- Developers and system architects are actively involves in testing activities and for each design activity, they design tests or co-operate with test engineers for designing tests.
Q5) b) Differentiate between verification and validation. (8 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. |
8. | It is related to quality control. | It is related to quality assurance. |
Q6) a) Explain various principles of testing. (8 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 the 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.
- Testing includes measures for defect prevention and one cycle of testing result in improved version of software.
- Test engineer should not always with fixed framework of testing. They need to think differently for designing test cases.
Q6) b) What is defect management? Discuss the generic steps in defect management process. (8 marks)
Ans:
- Defect is a bus or error in software system which causes the system to produce incorrect result.
- Sometime defect may not detect for long time during system operations.
- Thus, testing helps to detect the defects in the system which being developed or already developed.
Steps in defect management process:
- Defect Identification:
It is process of detecting the defect. A person detecting the defect belongs to testing team and in practical case that may be development team member, system analyst.
- Defect categorization:
When defect is identified and reported, it is given to team to ensure its existence and identify its nature.
- Defect Prioritization:
Defect is prioritized on the basis of relative effort to fix and severity of impact on end user.
- Defect Assignment:
Defect is assigned to developer to fix it. Developers make use of defect management tool for tracking the activities.
- Defect Resolution:
After resolving defect, responsive actions are taken by organization to propagate the fix to environment where defect occur.
- Defect verification: After fixing the defect, testing team verifies that fix has exactly cures the defect. After verification it is applied on the system.
- Defect Closure:
After fixing and verifying the defect, it is marked as closed.
- Management reporting and analysis:
Reports are generated for fixed bug and send to the stockholders as needed.
Q7) a) Explain equivalence partitioning and boundary value analysis in black box testing. (6 marks)
Ans:
Equivalence partitioning:
- 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.
Boundary Value analysis:
- It is used to identify errors at boundaries rather than existing in middle of input domain.
- Most of the errors occur at the boundaries of input domain.
- It is next step of Equivalence partitioning for designing test cases and these test cases are selected at the edge of equivalence classes.
- For values 1 to 1000, Test cases at input boundaries of domain is range from 1 to 1000
- Values that are below the edges of input are 0 to 999.
- Values above the edges of input are 2 to 1001.
Q7) b) Explain system testing. What is the significance of system testing ? (6 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:
- Stress testing: It test the system by overloading it beyond its specified limits.
- Scalability testing: It checks the maximum capacity of testing.
- Reliability testing: It checks the ability of system to perform its functionality repeatedly.
- Performance testing: It tests the system on the basis of the response time or time taken by the system.
- Localization testing: It checks the language compatibility of system.
- Inter-operability testing: It makes sure that system is communicating and co-operating with other system which supposed to work together.
Q7) c) For the given piece of code, draw flow graph and compute the cyclomatic complexity of the same.
Int f1(int x,int y) { While(x != y) { If(x>y)then x=x-y; else y=y-x; } return x; }
(6 marks)
Ans:
Control flow graph:
Cyclomatic complexity
V(6) = E – N + 2
Where, n is the number of nodes in 6
E is the number of edges in 6
Here, N=6, E=7
V(6) = E – N + 2
= 7 – 6 + 2
V(6) = 1 + 2
V(6) = 3
Q8) a) Differentiate between alpha and beta testing. (6 marks)
Ans:
Sr. No | Alpha Testing | Beta Testing |
1. | It is conducted within the organization. | It is conducted at the client’s place i.e. outside the organization. |
2. | Developer is present while testing. | developer is not present while testing |
3. | Alpha Testing is not open to the market and public. | Beta Testing is always open to the market and public. |
4. | This testing is conducted in virtual and controlled environment. | This testing is conducted in real time or live environment. |
5. | When the development of software is near to completion stage, Alpha testing is conducted. | After passing Alpha testing and before the final release of the software, Beta testing is conducted. |
6. | It involves both White Box Testing and Black Box Testing. | It involves only Black Box Testing |
7. | Developer is present while testing so he records all the problems and errors occur during testing. | Customer records all the errors and other issues occur during this testing and reports to the developer. |
Q8) b) Explain Integration testing? Explain Big-bang approach of integration testing? (6 marks)
Ans:
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, grey 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.
- It defined by 4 methods:
- Top Down Integration:
- It describes the testing of top most interfaces first and other component interfaces are tested in top to bottom order.
- For example, component 1 and 2 are available, so interfaces between those are tested.
Fig. Example of Top down integration
- Bottom-Up Testing:
- Testing starts from bottom and takes the bottom-up approach.
- Arrows pointing up describes integration path. Testing starts from component 1 and goes up covering all components till 8th
Fig. Example of Bottom-up integration
- Bi-directional Integration testing:
- In this testing, top-down and bottom-up approaches are combined.
- Components 1, 2, 3, 4, 5 are tested individually by using drivers and stub.
Fig. Bidirectional Integration
- System Integration:
- When all the components are integrated and tested together as single unit, then it is called as system integration testing.
- It further classified into components and system integration testing.
Big-bang approach of integration testing:
- The testing which tests the entire system as an integrated component, instead of testing each unit one after another, such testing is called as big bang testing.
- Such type of integration is called as big bang integration.
- It is perfect for system development where there are less number of interfaces detected with defects.
- When most of the interfaces and components are already available for testing then this testing is suitable to perform.
Q8) c) What is unit testing? List the benefits of unit testing. (6 marks)
Ans:
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.
Benefits of unit tests:
- Valuable documentation:
Proper documentation is made while performing unit testing. The program behaviour is observed. Documentation helps in later stages of testing.
- Provide scope for change:
Programmers are allowed to change library and code to make their code work properly.
- Contribution in good designing:
Test cases of unit testing helps in good designing.
- Early detection of software defects:
Unit testing is performed as soon as programs are developed. Normally, test cases in unit testing are designed before the programming starts, but the code is considered as complete only when it passes the unit testing.
- Simples integration testing:
All the programs units are tested before integration testing.
Q9) a) Difference between functional and non-functional testing. (8 marks)
Ans:
Sr. No | Functional Testing | Nonfunctional Testing |
1. | It is performed before non-functional testing. | It is performed after the functional testing. |
2. | It is easy to define functional requirements. | It is difficult to define the requirements for non-functional testing. |
3. | It is based on customer’s requirements. | It is based on customer’s expectation. |
4. | It helps to validate the behavior of the application. | It helps to validate the performance of the application. |
5. | It describes what the product does. | It describes how the product works. |
6. | Functional testing is carried out using the functional specification. | Nonfunctional Testing is carried out by performance specifications |
7. | It is carried out to validate software actions. | It is done to validate the performance of the software. |
Q9) b) Differentiate between manual testing and Automated testing. (8 marks)
Ans:
Sr. No. | 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. |
8. | Manual testing requires less cost than automation. | Initial cost of automation testing is more than manual testing but useful always. |
Q10) a) What is mobile testing? Mention challenges in mobile testing. (8 marks)
Ans:
- Application developed for mobile platform is tested for its performance, security, functionality.
- Testing can be performed manually by tester or developer and by using automation testing tools.
- Comparing with desktop application, mobile applications testing contain many challenges and most of them not been addressed properly because of increase in growth of mobile applications.
Challenges in mobile testing:
- Diversity in mobile devices:
There are wide range of mobile devices with different platform are available so the testing on any one device does not guarantee that application will run smoothly on other device.
- Diversity in mobile OS and platform:
Diversity in OS and platform such as iOS, Symbian, Blackberry, Android etc. forces organization to develop their application for all platforms. Therefore different test cases and strategies need to be designed according to the platform.
- Large number of mobile operators around the world:
No of mobile operators is large which influence the development of mobile application and testing.
- Execution of test script by different devices:
Support for script and its elements differ from one platform to another. Devices may contain different configuration which results in different test script.
Q10) b) Write short note on: (8 marks)
1) Junit
2) Selenium
Ans:
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 minimized at product development stages.
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.