Tests in Extreme Programming
Extreme Programming is becoming increasingly popular among modern software developers day after day. Many programmers want to know more about Extreme Programming tests. Such interest is explained with the great significance of tests for XP. In this article we will describe it. But before doing that, we will give the general definition for Extreme Programming.
Extreme programming (or XP) is one of the Agile methodologies of software development. Like other Agile methods, it is based on the principles of strong customer involvement and iterative cycles. However, XP has lots of features that distinguish it from other software development methodologies.
The first thing we should know about Extreme programming is that it was designed to create the largest amounts of software within the shortest amounts of time. That is why XP has the highest range of customer involvement into the process of project realization. Unlike other Agile methodologies, in Extreme programming the customer takes part at all team meetings personally.
XP also has the shortest iterative cycles. Usually they last no more than one week. That is why Extreme Programming developers have invented a large amount of useful practices that allow them to deliver software products within the shortest time.
Extreme Programming testing process is a great example for that. As we know, testing is an important part of any software development methodology. It is required to detect bugs and defects before the final product is delivered to the customer. But in XP the testing procedure looks quite unusually. This is the only methodology where tests are written before the work on the product code begins.
If you know the process of XP project realization, you probably know the reason for that. The issue is that each iterative cycle in Extreme Programming begins with the planning game. This is a meeting where the customer shares all his requirements with the team. It means that the developers know the acceptance criteria of the future product from the very beginning of each iterative cycle.
Acceptance tests in Extreme Programming
As we have already mentioned, in XP the tests are written before the code creation begins. It allows the developers to write the code in accordance with the test requirements. As a result – the process of bug detection and elimination in Extreme Programming projects is very effective.
Extreme Programming and test-driven development
A particular type of testing typical for Extreme Programming was a source for a completely new software development practice that is called test-driven development. Its principles are simple: the software product is developed through tests.
In practice the process looks as following.
At first the developers learn the customer demands during the planning game. These demands formulate the acceptance criteria of the future product.
After that they write a new test that is focused on these criteria. The test is run, because the team should make sure that it works correctly and does not contain bugs.
At the next stage of the development procedure the team tries to use the new test with other tests to make sure that it is suitable for a certain project.
Then the team begins to write the code in accordance with the customer’s acceptance criteria. After it is finished, the team runs it through old and new tests. If the fragment of code passes them successfully, it can be refactored. Refactoring is the procedure of code improvement that is typical for Extreme Programming. The refactored code is ready to delivery.
If the project is not finished, the team begins to work on other chunks of code.