CSC/ECE 517 Fall 2009/wiki1b 4 xy: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 119: Line 119:
** The testing is not according to the architecture of the system, in the sense that until all the modules are integrated, the tests do not follow the flow of the design.
** The testing is not according to the architecture of the system, in the sense that until all the modules are integrated, the tests do not follow the flow of the design.


== '''Other Type of Testing''' ==
== '''Other Types of Testing''' ==


=== '''System Testing''' ===
=== '''System Testing''' ===
System testing is testing the working of the system or program with respect to the orginal objectives of the system. This is slightly different from Functional testing. In Functional testing we basically test the use-case of the system while in system testing we are looking for discrepancies between the working of the system and the objectives.  
Every software system has well defined objectives and a comprehensive functionality.The intention here is to test the working of the system with respect to its original objectives. This is slightly different from functional testing. In functional testing we basically test all possible use-cases of the system while in system testing we are looking for discrepancies between the actual behavior as compared to its objectives.  
There are various categories of system tests some of the main ones are listed below
There are various categories of system tests some of the main ones are listed below


* Compatibility Tests: They check the compatibility of the system which other system.
* Compatibility Tests: It involves checking the compatibility when interacted or used in cohesion with other systems.
  For Example: Testing a routing protocol in one router with the one running on a system from another vendor
  For Example: A routing protocol has a set of standards. The implementation can be vendor specific. When the two different
implementations of the protocols run on different routers, compatibility tests are conducted to ensure the communication between
them.


* '''Security Tests''': They test the security feature of the system.
* '''Security Tests''': They test the security feature of the system.
<br/>
For Example: Security alarms are equipped with a secret code and the people having access have the information about them. They
*  '''Stress Tests''': These type of tests stress the system to the maximum to find out how robust they are.   
are tested for all possible incorrect codes to prevent an unauthorized person from entering the protected area.
  For Example: A good stress test for a web server would be sending HTTP requests at rate for the peak rate for short  
 
*  '''Stress Tests''': These type of tests stress the system to the maximum to find out the robustness.   
  For Example: A good stress test for a web server would be sending HTTP requests at the peak rate for short  
  period of time
  period of time


* '''Volume Tests''': These test subject the system to heavy loads of data.  
* '''Volume Tests''': These tests subject the system to heavy loads of data.  
  For Example: Sending HTTP Requests at a high rate ( less than the peak rate) to a web server for a significant amount of  
  For Example: Sending HTTP Requests at a high rate ( less than the peak rate) to a web server for a significant amount of  
  time is volume testing
  time


* '''Usability Test''': They are used to test if the system is easy to use of the end-user
* '''Usability Test''': They are used to test if the system is user friendly
  For Example: Tests that test UI of any product fall under this category
  For Example: In a banking software, the employee is unaware of the implementation details and he / she should be able to perform
the transactions with considerable ease.




=== '''Acceptance Testing''' ===
=== '''Acceptance Testing''' ===
The testing done by user or customer after before accepting the system. The main focus of the testing to establish confidence in the user regarding the system.  
The testing done by user or customer before accepting the software. The main focus of this testing is to establish confidence in the user regarding the system.  
  For Example: In the case of a program product, such as a computer manufacturer’s operating system or compiler, or a software  
  For Example: In the case of a program product such as a computer manufacturer’s operating system or compiler or a software  
  company’s database management system, the sensible customer first performs an acceptance test to determine whether the product   
  company’s database management system, the customer first performs an acceptance test to determine whether the product   
  satisfies its needs
  satisfies his needs


== '''References''' ==
== '''References''' ==
# [http://books.google.com/books?id=86rz6UExDEEC&dq=Art+of+software+testing&printsec=frontcover&source=bl&ots=yPUqKjndyO& sig=g3u5nwc_zyQcJI6UDzJzuah1_zs&hl=en&ei=nSe4SoHjLJXSlAe99_HODg&sa=X&oi=book_result&ct=result&resnum=3#v=onepage&q=&f=false Art
# [http://books.google.com/books?id=86rz6UExDEEC&dq=Art+of+software+testing&printsec=frontcover&source=bl&ots=yPUqKjndyO&sig=g3u5nwc_zyQcJI6UDzJzuah1_zs&hl=en&ei=nSe4SoHjLJXSlAe99_HODg&sa=X&oi=book_result&ct=result&resnum=3#v=onepage&q=&f=false Art of Software Testing by Glenford J. Myers]
of Software Testing]
# [http://books.google.com/books?id=Ss62LSqCa1MC&pg=PA197&lpg=PA197&dq=FOUNDATIONS+OF+SOFTWARE+TESTING&ots=YIbCfRQrR3&sig=itF1c7wwPFwdfIb2RYoOIcVz2VM&hl=en&ei=xim4St-nKY7klAfDyM3KDg&sa=X&oi=book_result&ct=result&resnum=1#v=onepage&q=&f=false FOUNDATIONS OF SOFTWARE TESTING ISTQB CERTIFICATION Dorothy Graham Erik van Veenendaal Isabel Evans Rex Black]
# [http://books.google.com/books?id=Ss62LSqCa1MC&pg=PA197&lpg=PA197&dq=FOUNDATIONS+OF+SOFTWARE+TESTING&ots=YIbCfRPw_2&sig=VVPi7ZMQRYu_HZSyuUmtjngr5Do&hl=en&ei=Kii4SuyyNZCOlQeU2PjaDg&sa=X&oi=book_result&ct=result&resnum=1#v=onepage&q=&f=false  
# [http://www.softwaretestinghelp.com/types-of-software-testing/ www.softwaretestinghelp.com/types-of-software-testing/]
FOUNDATIONS OF SOFTWARE TESTING ISTQB CERTIFICATION Dorothy Graham Erik van Veenendaal Isabel Evans Rex Black]
# [http://www.softwaretestinghelp.com/types-of-software-testing/ ww.softwaretestinghelp.com/types-of-software-testing/]
# [http://www.cs.pitt.edu/~mock/cs1530/lectnotes.html
# [http://www.cs.pitt.edu/~mock/cs1530/lectnotes.html
# [http://portal.acm.org/citation.cfm?id=1253532.1254712&coll=&dl=&type=series&idx=1253532&part=Proceedings&WantType=Proceedings&title=International%20Conference%20on%20Software%20Engineering Software Testing Research: Achievements, Challenges, Dreams. Antonia Bertolino. In Future of Software Engineering, 29th International Conference on Software Engineering, May 2007]
# [http://publib.boulder.ibm.com/infocenter/rfthelp/v7r0m0/index.jsp?topic=/com.ibm.rational.test.ft.doc/topics/FTJava_Tutorials.html publib.boulder.ibm.com/infocenter]
# [http://cs.allegheny.edu/~gkapfham/research/publish/software_testing_chapter.pdf Software Testing. Gregory M. Kapfhammer. The Computer Science and Engineering Handbook]

Latest revision as of 02:32, 22 September 2009

Functional and Integration testing and beyond

Recognition of software test engineering as a specialty area has increased during the last twenty years. Testing is one of the key focus areas in software engineering. It is an essential activity that observes the functionality of a software system validates its intended behavior and identifies the potential malfunctions. Testing is also the primary way to improve software reliability.

The test cases should be carefully designed to cover many aspects in the SDLC such as possible aberrations from user’s requirements, system behavior upon malicious inputs, and robustness to extensive load conditions and so on. As more and more software is used in critical applications, the time and cost involved in testing is also increasing owing to the higher quality required. Although test automation saves a lot of time and can be used for regression load tests, manual testing is still widely used in the industry.

Terms

  1. Driver: Supporting code or data used for testing the software system
  2. SDLC: Software Development Life Cycle
  3. Stub: Dummy procedure that can be used to simulate or substitute an actual portion of a system
  4. Sub-system: Component or Module of a software system
  5. System Under Test: The software system which has to be tested
  6. Test: Sequence of steps to validate the system design and implementation
  7. Usecase :Scenario that describes the interaction between an user and a system

Functional testing

Functional testing is designed to ensure whether the system requirements and specifications are achieved. It can start with testing of the requirements and whether the application complies with the organizational policies and procedures. During the design phase, after knowing the functionality of the module/modules and the system, some errors can be predicted in advance. A functional test should incorporate such type of scenarios too. In this case the erroneous transactions/ applications are deliberately introduced and the system should be able to correctly find them. In general, all the use cases in the user’s requirements become the functional test cases.

For example, suppose we are to develop the software for an elevator. For designing the test cases for this software, 
all the scenarios and operations that can take place in the elevator need to be analyzed. To begin from the basic operations, the
elevator should be bidirectional and it should stop at each floor (unless we have two elevators in the requirement for even and 
odd floors separately).The elevator should stop at the desired floor.The behavior of the elevator when the eight inside exceeds 
the maximum allowable limit ( i.e to test the buffer conditions). There can be many other scenarios.

Generally Functional testing is Black Box testing. In this method the SUT (System under Test) is considered as a Black box. In this phase of testing the internals of the SUT like the design or algorithm are not considered by the tester. Inputs are provided to the black box and the outputs are validated to the expected results specified in the design document.

2 approaches can be taken for writing the functional tests

  • Requirement based approach: In this approach the specification for the system or software design is used as the base to write functional test.
  • Business process based approach: Business process refer to the day-to-day use of the system. This knowledge is used to do functional testing of the system.

Regression testing is another form of functional testing where you test the earlier features and functionality of the module. They had worked on the desired lines in the previous tests but have to be tested currently after some changes have been made in the system. The changes might not be in the particular module but it can be affected due to the inter dependencies.

Integration Testing

Integration testing is a systematic approach to build the complete software structure specified in the design from unit-tested modules.It is the next phase of unit testing. Generally in software development, complete software is divided into various sub-systems mostly developed by different teams. More often than not each sub-system works very well individually but when they are integrated then lot of problems arise. So the intention of integration tests is not to test the functionality of individual modules but the interaction and inter-dependencies between the modules.

For instance in Object oriented model, the classes in a particular module could have been inherited from some other module. 
The interface can be in a different module and the implementation can be elsewhere. In such scenarios, the faults can be 
best found in the integration tests.


Another instance is to test the communication and compatibility between the client and server. Stand alone client and server 
functionality is tested in the unit tests. 

There are many approaches that can be followed for Integration Testing

Big Bang Testing Approach

As the name suggests all the components are integrated at once. After all the integration is completed a set of tests are run which not only validate a single component of sub-system but also test and validate the interaction between different components. This approach is more useful in smaller systems because integration of smaller systems is easier.

  • Advantages:
    • Since all the modules are combined and tested at the same time, this approach of integration is less time consuming
  • Disadvantages:
    • Debugging and solving a fault is not trivial. The reason being many modules are integrated and not all the bugs are determined in the unit tests.Therefore it is ambiguous for the tester whether the fault is due to the sub-system or due to the integration.
    • Testing process cannot be started until all the sub-systems have finished their unit tests.
    • Designing the test cases is an arduous task.



Incremental Testing Approach

Testing is done after integration of each module. After the successful completion of the unit tests, sub-systems are integrated and tested. Stubs are used for modules in the system which are not integrated till now.

  • Advantages:
    • Problems detection is early compared to the Big Bang approach
    • No need to wait till the unit testing of all the modules have finished
    • Debugging is much simpler
  • Disadvantages:
    • This approach is a time taking process because the integration tests have to run multiple times
    • Stubs have to be developed to substitute the missing modules



Various Approach can be taken for Incremental Testing

  • Top-Down Approach: In this approach the system is tested according to the work flow or code flow. The Top level module is tested first then each lower level module is integrated and tested.Top level modules call other modules and lower level modules are are called by Top level ones. Terminal modules do not call any other module.



In the above figure Module A is the top most module in the system then B,C,D are lower level modules. Generally module A is the user interface and stubs are created for the remaining modules which are used for the tests.As and when the sub-systems are ready after the unit tests, they are replaced by their respective stubs for the integration tests.

  • Advantages:
    • The test flow follows the architecture of the system so any bug at the top level design or implementation could be found in the early stages
    • If the top level module calls multiple lower modules then the testing can be done in various combinations
For example in the figure A calls B and C. The testing can be done as follows
A-B-C-D 
A-C-B-D
  • Disadvantages :
    • The main problem with this approach is the use of stubs. Mostly stubs are written to print out some trace statement based on the output of module.There can be frequent changes in the stubs as and when the bugs are found out and while testing multiple scenarios.This is an additional overhead.
  • Bottom-Up Approach: The bottom-up approach is the opposite of the top-down approach. In this approach the terminal modules are tested first, then the higher modules and finally the top-most one. Drivers are used in this approach.



In the above figure E,D are the terminal modules which are tested first. Then the higher level modules B,C are tested and finally the topmost module is tested

  • Advantages:
    • No need to write stubs
    • If the terminal modules does the main work in the system then they will be tested first
  • Disadvantages:
    • Need to write drivers
    • The testing is not according to the architecture of the system, in the sense that until all the modules are integrated, the tests do not follow the flow of the design.

Other Types of Testing

System Testing

Every software system has well defined objectives and a comprehensive functionality.The intention here is to test the working of the system with respect to its original objectives. This is slightly different from functional testing. In functional testing we basically test all possible use-cases of the system while in system testing we are looking for discrepancies between the actual behavior as compared to its objectives. There are various categories of system tests some of the main ones are listed below

  • Compatibility Tests: It involves checking the compatibility when interacted or used in cohesion with other systems.
For Example: A routing protocol has a set of standards. The implementation can be vendor specific. When the two different 
implementations of the protocols run on different routers, compatibility tests are conducted to ensure the communication between 
them.
  • Security Tests: They test the security feature of the system.
For Example: Security alarms are equipped with a secret code and the people having access have the information about them. They
are tested for all possible incorrect codes to prevent an unauthorized person from entering the protected area.
  • Stress Tests: These type of tests stress the system to the maximum to find out the robustness.
For Example: A good stress test for a web server would be sending HTTP requests at the peak rate for short 
period of time
  • Volume Tests: These tests subject the system to heavy loads of data.
For Example: Sending HTTP Requests at a high rate ( less than the peak rate) to a web server for a significant amount of 
time
  • Usability Test: They are used to test if the system is user friendly
For Example: In a banking software, the employee is unaware of the implementation details and he / she should be able to perform 
the transactions with considerable ease.


Acceptance Testing

The testing done by user or customer before accepting the software. The main focus of this testing is to establish confidence in the user regarding the system.

For Example: In the case of a program product such as a computer manufacturer’s operating system or compiler or a software 
company’s database management system, the customer first performs an acceptance test to determine whether the product  
satisfies his needs

References

  1. Art of Software Testing by Glenford J. Myers
  2. FOUNDATIONS OF SOFTWARE TESTING ISTQB CERTIFICATION Dorothy Graham Erik van Veenendaal Isabel Evans Rex Black
  3. www.softwaretestinghelp.com/types-of-software-testing/
  4. [http://www.cs.pitt.edu/~mock/cs1530/lectnotes.html
  5. Software Testing Research: Achievements, Challenges, Dreams. Antonia Bertolino. In Future of Software Engineering, 29th International Conference on Software Engineering, May 2007
  6. publib.boulder.ibm.com/infocenter
  7. Software Testing. Gregory M. Kapfhammer. The Computer Science and Engineering Handbook