Subscribe by Email


Showing posts with label Testing Framework. Show all posts
Showing posts with label Testing Framework. Show all posts

Monday, July 9, 2012

What is the role of testing frameworks and automated scripts in refactoring?


Re-factoring is one of the most disciplined techniques which very well save use from the drudgery of rewriting the program code for software systems and applications. 

About Re-factoring


- Re-factoring is a technique that facilitates the restructuring of the existing body of the program code by carrying out alteration in the internal structure of the software system or application.
The best thing about re-factoring is that even if it does make changes to the internal structure of the software system or application, the external behavior of the system under question is not at all affected.
- Re-factoring is quite in demand during the testing phases since it helps a lot in improving the non functional attributes of the software system or application. 
- Typically, a part of the software system or application is changed by the application of a number of re-factorings which constitute a little change in the program’s source code which does not needs any modification in its functional requirements. 

There are so many advantages of refactoring like some of them mentioned below:
  1. It improves code readability
  2. It reduces complexity
  3. It improves maintainability
  4. It improves extensibility.
When the design of a program’s code is continuously improved, it gradually becomes easy to work with. Usually what we do is pay a lot of attention to the addition of the new features and functionalities and we do only a little refactoring. As a consequence of the software system or applications becomes quite clumsy in its working. 

"The good habit is to refactor a lot in ratio with the expedient addition of new features and functionalities. Refactoring your system now will help you maintain and extend it in the later stages of the software development whenever you want. If the testers fail to refactor the program code they will have increased technical debts."

Role of Testing Frameworks and Automated test scripts in Re-factoring


- Test frame works and automated test scripts have got a lot to do with the refactoring process. 
- Some solid sets of automatic unit tests are a priority before you start refactoring the program code. 
- These tests are in turn are generated using a test automation frame work and testing scripts. - These automated tests are so quick that it only takes a few seconds for them to execute and tell whether or not the respective program module is working properly. 
- This process is like going through the following steps:
  1. Make a small program transformation.
  2. Test it to ensure its correctness.
  3. Make another small transformation.
- It seems like an iterative cycle, isn’t it? 
- Suppose at some point the test fails, then the last change that was made is undone and redone in some different ways and again subjected to testing. 
- It is like moving the program from where it is to where you want to be in small small steps. 
- This process forms an integral part of the software development life cycle. 
- A number of general frameworks have been designed to make the process of refactoring effective and efficient. 
- A refactoring tool must be able to refactor the code that is written under a particular testing frame work. 
However there are certain aspects without addressing which refactoring cannot be achieved:
  1. Naming conventions
  2. Meta programming aspects
  3. Call back functions and so on.


Thursday, April 26, 2012

What is a testing framework? What are different unit testing frameworks?



What is a testing framework?

- Testing framework is considered to be an object oriented approach to testing since it helps in providing suitable environment and language for testing the software system or application. 
- A testing framework can be defined as a set of concepts, assumptions and tools that are the means for providing support for testing the software systems or application. 
- The testing frameworks are generally used in the automated testing and such testing frameworks are called the test automation frameworks. 
- The main advantage here for which the testing frame works are used is that they reduce the overall testing and development cost by a large amount. 
- If any change or modification is made to the test cases, then all the tester needs to do is to update the test case file since the start-up script and the driver script will remain the same.
- This reduces the hectic task of updating the scripts when the changes have to be made to the software system or application. 
- The testing framework if chosen properly can help in reducing the development costs by a big margin and the lower cost can be maintained throughout the development process. 
- These costs are basically due to the maintenance efforts, test scripting and development processes.
- Using any approach with testing frame work has a great impact on the costs. 

Types of Testing Frameworks

  1. Linear testing framework: This is commonly used for the code that is procedure oriented and is generated by the tools using techniques such as recording and playback.
  2. Structured testing framework: This testing frame work is composed of the control structures and hence got the name. It is constituted by control structures such as switch, while, for, if-else condition statement etc.
  3. Data driven testing framework: This testing frame work involves persisting of the data outside a test in either a spreadsheet or a database.
  4. Key word driven testing framework
  5. Hybrid testing framework: This type of frame work is the resultant of the combination of two or more types of above mentioned testing frame works.

What does testing framework account for?

- A testing frame work is said to account for the following things:
  1. Definition of the format so that the expectations can be expressed.
  2. Creation of a mechanism for driving or hooking an application that is under test.
  3. Execution of the tests.
  4. Reporting of the results.
- The execution of the powerful and complex tests eats up a lot of time and it also requires quite large budget when only capture tool is used. 
- Since the tests are created ad hoc, it becomes very difficult to track these functionalities and reproduce them.
- A test automation framework serves as a better support option when it comes to the automated testing. 
The testing frameworks and other tools are incorporated in to a test automation interface for carrying out the integration as well as system testing. 
- The test automation interface is employed for the mapping of the tests without putting them in to the way of the development process.
- Test automation frameworks are known for improving flexibility and efficiency of the test scripts. 
- There are 3 main core modules of any test automation interface:

1. Interface engine: The engine lies on the top of the environment and consists of a test runner and parser.
2. Interface environment: It consists of project library and frame work library.
3. Object repository: It consists of object application data recorded by the testing tool.


Facebook activity