Introduction
The tests are an integral part of enterprise software development. It is so important, if not more important, as any other stage of the life cycle of software development (SDLC). But evidence of a business application is easier said than done. There are several limitations that make exercise tests in a project with a major challenge. These limitations fall into two categories: limitations related to the framework and methodology of projects relating to limitations.
An example of a framework of constraints related to architecture is that the J2EE model does not take into account the aspect of unit testing as part of software development. Since the container (application server) is the main component of J2EE run-time architecture, it is difficult to build applications based on J2EE API testing outside the container. Unit testing (outside the container) is essential to achieve high test coverage. It is also easy to reproduce failure scenarios many without the overhead of installing the application server and code deployment. It is vital to ensure that tests can be run quickly what is important in the development or phases of production support the project. The verification of code using unit testing minimizes downtime waiting for the application to be deployed every time we make a code change.
Because the code in a traditional J2EE application depends largely on the application server, its functionality can be fully tested only when deployed within a J2EE container. But in the evidence of containers is too slow and too much of a hindrance to the productivity of developers, especially if the project is relatively large and the number of code artifacts (Java source files) is high.
There are some J2EE frameworks are built from earth to provide excellent support for the integration of software testing in the development process. Spring is a business development framework like Java applications.
Recently, I made some queries about a Java Enterprise my wife worked at a local level "One of the supplier firms. The project was to create a client profile management system used to track the profiles of their clients. The architecture of this application includes Hibernate 3.0, Spring 2.0, 4.0 and J Boss technologies. The project team followed an approach of agile software development to meet the requirements in iterations week. They used the trial of integrating the features offered by spring framework, to test the application code to access data and services layers. We liked the test support provided by spring framework. Proof is simplified greatly, and made aggressive week development iterations possible and manageable.
This article provides an overview of support provided by spring framework in the areas of the unit and integration testing. I will use a sample loan processing application site to assist readers in implementing an agile framework to test a typical Java EE application and how to use spring test classes to test the application functionality.
Agile Software Testing
A software development project should include a good design and practice of architecture and good testing practices. An application can have a very good architecture, design and code, but if it is not proven, there can be a successful product. Some companies (software service providers) live and die by the quality of their products and testing is crucial to the success of these companies.
Agile software development requires a comprehensive testing strategy to achieve the agility and quality in software development project. Agile testing includes unit testing and integration testing. This means we must be able to run the tests as soon as possible (one way to achieve agility is to run the tests outside the application server). Test Driven Development (TDD) is one of the key elements of agile development process. Spring and other light-weight containers like Hive Mind Pico Container and provide strong support for test driven software development.
Unit Testing
Unit testing is used to test a specific unit (class) in the application. Unit tests must be written to test all class methods including all routes except in the methods. The purpose of unit tests will be able to quickly test any new code or changes in existing code, without the burden and the additional time involved in tasks such as server configuration, installation services and application deployment . Development Unit Testing is vital because it is easier and cheaper to find and correct errors before the life cycle of software development (in the coding and unit testing phases) rather than in later stages.
JU nit is a popular testing framework used to write unit tests. In JU nit tests just an instance of the objects with new operator, without having to worry about resources and services JNDI J2EE container as the combination of resources, the sets of JDBC connections and JMS queues. We may also use testing techniques Mock objects to test your code in isolation. With unit testing, no need for any configuration of the infrastructure for an application server or even a database server.
There are some limitations to unit testing. Unit tests do not relate to verification of the functional requirements of the application. These tests apply only to the evaluation of each module in the application. Furthermore, we cannot test scenarios as services that require asynchronous JMS message queues configured in the application server. But still should be able to test the unit as the application functionality as possible and use the container in testing only the functions that cannot be tested outside the container.
Integration Test
Unit tests are useful to test a module or class in isolation. But it is also important to integration testing of the application to see how the various modules that work together when they met in the integrated environment. Some functions that work well at module level cannot function properly when integrated with other application modules. This scenario is very realistic in an agile development environment in different developers working in different parts of the application at the same time and have to merge code changes periodically (in some development teams daily). The integration includes testing of return calls between clients and service layers of the application. Most integration testing usually run in the container. But to be truly agile, we need to run at least some integration testing
without code deployment in the container.
It should be noted that integration testing is the test of courtesy and not a substitute for unit testing. Developers must first write enough unit tests for each Java class in the application for good code coverage. At the same time, there must be enough integration tests written to cover different scenarios used in the application that cannot be tested with unit tests. There are several other types of evidence, in addition to unit and integration testing.
0 comments:
Post a Comment