Likes

BSC-IT 5TH SEM ASSIGNMENT BSIT-54 (TA)




subject:-Software Quality and Testing 
Assignment: TA (Compulsory)

1.What is software testing? Software testing is tougher than hardware testing, justify your answer.
Ans:-Software testing is the process of executing a program with the intent of finding errors. It is used to ensure the correctness of a software product. Software testing is also done to add value to software so that its quality and reliability is raised.
Software testing is a critical element of software quality assurance and represents the ultimate process to ensure the correctness of the product. The quality of product always enhances the customer confidence in using the product thereby increasing the business economics. In other words, a good quality product means zero defects, which is derived from a better quality process in testing.Testing the product means adding value to it which means raising the quality or reliability of the program. Raising the reliability of the product means finding and removing errors. Hence one should not test a product to show that it works; rather, one should start with the assumption that the program contains errors and then test the program to find as many errors as possible.

2. Explain the test information flow in a typical software test life cycle. 
Ans:- Testing is a complex process and requires effort similar to software development .  

Predicted Reliability
Software Configuration includes a Software Requirements Specification, a Design Specification, and source code.  A test configuration includes a Test Plan and Procedures, test cases, and testing tools.  It is difficult to predict the time to debug the code, hence it is difficult to schedule.
Once the right software is available for testing, proper test plan and test cases are developed. Then the software is subjected to test with simulated test data. After the test execution, the test results are examined. It may have defects or the software is passed with out any defect. The software with defect is subjected to debugging and again tested for its correctness. This process will continue till the testing reports zero defects or run out of time for testing.

3.What is risk in software testing? How risk management improves the quality of the software?
Ans:- The risk associated with a software application being developed are called software risks. These risks can lead to errors in the code affecting the functioning  of the application.
Following are the factors that lead to  software risks:
  1. Skills of software
ii. Disgruntled
iii. Poorly defined project objectives
iv. Project risks
v. Technical risks

5. Explain the black and white box testing? Explain with an example. Which method better? List out drawbacks of each one.
Ans:- Black box testing treats the system as a “black-box”, so it doesn’t explicitly use Knowledge of the internal structure or code. Or in other words the Test engineer need not know the internal working of the “Black box” or application.
Main focus in black box testing is on functionality of the system as a whole. The term‘behavioral testing’ is also used for black box testing and white box testing is also sometimes called ‘structural testing’. Behavioral test design is slightly different from black-box test design because the use of internal knowledge isn’t strictly forbidden, but it’s still discouraged.
Disadvantages of Black Box Testing
– The test inputs needs to be from large sample space.
– It is difficult to identify all possible inputs in limited testing time. So writing test cases is slow and difficult
– Chances of having unidentified paths during this testing
White box testing involves looking at the structure of the code. When you know the internal structure of a product, tests can be conducted to ensure that the internal operations performed according to the specification. And all internal components have been adequately exercised. Drawbacks of WBT:
Not possible for testing each and every path of the loops in program. This means exhaustive testing is impossible for large systems.
This does not mean that WBT is not effective. By selecting important logical paths and data structure for testing is practically possible and effective.

6. What is cyclomatic complexity? Explain with an illustration. Discuss its role in software testing and generating test cases.
Ans:- 
The cyclomatic complexity gives a quantitative measure of the logical complexity. This value gives the number of independent paths in the basis set, and an upper bound for the number of tests to ensure that each statement is executed at least once. An independent path is any path through a program that introduces at least one new set of processing statements or a new condition
Cyclomatic Complexity of 4 can be calculated as:
1. Number of regions of flow graph, which is 4.
2. #Edges – #Nodes + 2, which is 11-9+2=4.
3. #Predicate Nodes + 1, which is 3+1=4.
The above complexity provides the upper bound on the number of tests cases to be generated or independent execution paths in the program. The independent paths (4 paths) for the program shown in
Independent Paths:
1. 1, 8
2. 1, 2, 3, 7b, 1, 8
3. 1, 2, 4, 5, 7a, 7b, 1, 8
4. 1, 2, 4, 6, 7a, 7b, 1, 8
Cyclomatic complexity provides upper bound for number of tests required to guarantee the coverage of all program statements.

7. What is coupling and cohesion? Mention different types of coupling and cohesion. Explain their role in testing.
Ans:- cohesion is a measure of how strongly-related each piece of functionality expressed by the source code of a software module is. Methods of measuring cohesion vary from qualitative measures classifying the source text being analyzed using a rubric with a hermeneutics approach to quantitative measures which examine textual characteristics of the source code to arrive at a numerical cohesion score.
Types of cohesion
Coincidental cohesion (worst)
Coincidental cohesion is when parts of a module are grouped arbitrarily; the only relationship between the parts is that they have been grouped together (e.g. a “Utilities” class).
Logical cohesion
Logical cohesion is when parts of a module are grouped because they logically are categorized to do the same thing, even if they are different by nature (e.g. grouping all mouse and keyboard input handling routines).
Temporal cohesion
Temporal cohesion is when parts of a module are grouped by when they are processed – the parts are processed at a particular time in program execution (e.g. a function which is called after catching an exception which closes open files, creates an error log, and notifies the user).
Procedural cohesion
Procedural cohesion is when parts of a module are grouped because they always follow a certain sequence of execution (e.g. a function which checks file permissions and then opens the file).
Communicational cohesion
Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g. a module which operates on the same record of information).
Sequential cohesion
Sequential cohesion is when parts of a module are grouped because the output from one part is the input to another part like an assembly line (e.g. a function which reads data from a file and processes the data).
coupling or dependency is the degree to which each program module relies on each one of the other modules. Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa.
Types of coupling
Content coupling (high)
Content coupling (also known as Pathological coupling) is when one module modifies or relies on the internal workings of another module (e.g., accessing local data of another module).
Therefore changing the way the second module produces data (location, type, timing) will lead to changing the dependent module.
Common coupling
Common coupling (also known as Global coupling) is when two modules share the same global data (e.g., a global variable).
Changing the shared resource implies changing all the modules using it.
External coupling
External coupling occurs when two modules share an externally imposed data format, communication protocol, or device interface.This is basically related to the communication to external tools and devices.
Control coupling
Control coupling is one module controlling the flow of another, by passing it information on what to do (e.g., passing a what-to-do flag).
Stamp coupling (Data-structured coupling)
Stamp coupling is when modules share a composite data structure and use only a part of it, possibly a different part (e.g., passing a whole record to a function that only needs one field of it).
This may lead to changing the way a module reads a record because a field that the module doesn’t need has been modified.
Data coupling
Data coupling is when modules share data through, for example, parameters. Each datum is an elementary piece, and these are the only data shared (e.g., passing an integer to a function that computes a square root).

8. Compare and contrast between Verification and Validation with examples.
Ans:- Verification testing ensures that the expressed user requirements, gathered in the Project Initiation phase, have been met in the Project Execution phase. One way to do this is to produce auser requirements matrix or checklist and indicate how you would test for each requirement.  For example, if the product is required to weigh no more than 15 kg. (about 33 lbs.), the test could be, ”Weigh the object – does it weigh 15 kg. or less?”, and note “yes” or “no” on the matrix or checklist.
Validation testing ensures that any implied requirement has been met.  It usually occurs in theProject Monitoring and Control phase of project management. Using the above product as an example, you ask the customer, “Why must it be ‘no more than 15 kg.’?” One answer is, “It must be easy to lift by hand.”  You could validate that requirement by having twenty different people lift the object and asking each one, “Was the object easily to lift?” If 90% of them said it was easy, you could conclude that the object meets the requirement.

9.What is stress testing? Where do you need this testing? Explain.
Ans:- Stress testing is a form of testing that is used to determine the stability of a given system or entity. It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results
The Need of stress Testing:-
  • A web server may be stress tested using scripts, bots, and various denial of service tools to observe the performance of a web site during peak loads.
Stress testing may be contrasted with load testing:
  • Load testing examines the entire environment and database, while measuring the response time, whereas stress testing focuses on identified transactions, pushing to a level so as to break transactions or systems.
  • During stress testing, if transactions are selectively stressed, the database may not experience much load, but the transactions are heavily stressed. On the other hand, during load testing the database experiences a heavy load, while some transactions may not be stressed.
System stress testing, also known as stress testing, is loading the concurrent users over and beyond the level that the system can handle, so it breaks at the weakest link within the entire system

10. Software testing is difficult than implementation. Yes or no, justify your answer.
Ans:- Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results. Although crucial to software quality and widely deployed by programmers and testers, software testing still remains an art, due to limited understanding of the principles of software. The difficulty in software testing stems from the complexity of software: we cannot completely test a program with moderate complexity. Testing is more than just debugging. The purpose of testing can be quality assurance, verification and validation, or reliability estimation. Testing can be used as a generic metric as well. Correctness testing and reliability testing are two major areas of testing. Software testing is a trade-off between budget, time and quality.

11. What are test cases? Explain the importance of Domain knowledge in test case generation. Mention the difficulties in preparing test cases.
Ans:- A test case is a detailed procedure that fully tests  a feature or an aspect of a feature in a test process. These cases  describe how to perform a particular test . a test case should be developed for each type of test listed in the test process. Domain  knowledge helps to preparing test design easily that’s why it is important.
Difficulties in preparing test data :-
Test data set examples:

1) No data: Run your test cases on blank or default data. See if proper error messages are generated.

2) Valid data set: Create it to check if application is functioning as per requirements and valid input data is properly saved in database or files.

3) Invalid data set: Prepare invalid data set to check application behavior for negative values, alphanumeric string inputs.

4) Illegal data format: Make one data set of illegal data format. System should not accept data in invalid or illegal format. Also check proper error messages are generated.

5) Boundary Condition data set: Data set containing out of range data. Identify application boundary cases and prepare data set that will cover lower as well as upper boundary conditions.

6) Data set for performance, load and stress testing: This data set should be large in volume.
This way creating separate data sets for each test condition will ensure complete test coverage.


No comments: