29.10.2012 Views

UNIFACE TEST DRIVEN DEVELOPMENT - Compuware Corporation

UNIFACE TEST DRIVEN DEVELOPMENT - Compuware Corporation

UNIFACE TEST DRIVEN DEVELOPMENT - Compuware Corporation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FACTSHEET: COMPUWARE <strong>UNIFACE</strong><br />

<strong>UNIFACE</strong> <strong>TEST</strong> <strong>DRIVEN</strong> <strong>DEVELOPMENT</strong><br />

Improve Software Quality, Reduce Overall Costs<br />

Test Driven Development is the key<br />

Developing quality software to tight budgets and timescales<br />

is challenging enough already, so why make matters worse<br />

by fixing bugs late in the lifecycle? It’s more expensive to<br />

fix a bug in testing than during development, and more<br />

expensive still to fix it once the software has been released.<br />

Test Driven Development (TDD) helps developers find and<br />

fix bugs early in the development process, and improves the<br />

design and support process.<br />

THE PROBLEM<br />

With traditional approaches, when the same code is re-used in several<br />

places, it can be hard to identify whether a change to that code is<br />

going to cause problems, and if so where. It’s even more difficult when<br />

the code is being maintained by someone other than the author – by<br />

support staff, for example. It’s also easy for bugs to be re-introduced<br />

by subsequent changes without being spotted. Regression-testing the<br />

complete application can be prohibitively expensive.<br />

WHAT IS <strong>TEST</strong> <strong>DRIVEN</strong> <strong>DEVELOPMENT</strong> (TDD)<br />

AND HOW CAN IT HELP?<br />

TDD is an approach that improves software quality and reduces the<br />

lifecycle cost of software.<br />

In TDD, developers write automated test scripts for low-level functions<br />

before coding the functions. The test scripts ‘assert’ the results that<br />

should be returned when the code is called with specified test data.<br />

These tests are used to verify that the required functionality is correctly<br />

implemented initially, and can then be re-used as regression tests<br />

when subsequent changes are made, to ensure that nothing has been<br />

broken.<br />

TDD is typically associated with ‘agile’ software development, but<br />

can be used with any methodology, and can be introduced in an<br />

evolutionary manner. It is, for example, possible to write a test of this<br />

type when changing existing code. TDD complements other types of<br />

testing rather than replacing them.<br />

Figure 1: The <strong>Compuware</strong> TDD process in the application life cycle


WHAT IS <strong>TEST</strong> <strong>DRIVEN</strong> <strong>DEVELOPMENT</strong> (TDD)<br />

AND HOW CAN IT HELP? (Continued)<br />

The TDD approach has a number of benefits:<br />

• It results in better design, as the process of creating tests helps<br />

the developer to decide how best to implement the code<br />

• The tests document the code behavior, as they are an up-to-date<br />

record of expected results when calling the code with given test<br />

data<br />

• Breaking changes are identified early, and are more likely to be<br />

fixed prior to acceptance testing<br />

• The developer thinks about failure scenarios in advance, and, by<br />

documenting them in the form of tests, ensures that they are not<br />

forgotten<br />

• The underlying cause of runtime problems can be identified more<br />

easily.<br />

The screenshot below shows the interactive test runner with some<br />

errors that the developer is working on. When the code is fixed, the<br />

developer will re-run tests and should see green ticks indicating that<br />

the code is working correctly.<br />

Figure 1: Interactive test runner.<br />

<strong>Compuware</strong> <strong>Corporation</strong>, the technology performance company, provides software, experts and best practices to ensure<br />

technology works well and delivers value. <strong>Compuware</strong> solutions make the world’s most important technologies perform<br />

at their best for leading organizations worldwide, including 46 of the top 50 Fortune 500 companies and 12 of the top 20<br />

most visited U.S. web sites. Learn more at: compuware.com.<br />

<strong>Compuware</strong> <strong>Corporation</strong> World Headquarters • One Campus Martius • Detroit, MI 48226-5099<br />

REFACTORING AND TDD<br />

© 2011 <strong>Compuware</strong> <strong>Corporation</strong><br />

<strong>Compuware</strong> products and services listed within are trademarks or registered trademarks of <strong>Compuware</strong> <strong>Corporation</strong>.<br />

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their<br />

respective owners.<br />

12.10<br />

During both development and maintenance, it makes sense to re-use<br />

existing code wherever possible. ‘Refactoring’ is the term used for the<br />

process of re-organizing code so that it performs well when re-used.<br />

The process also creates an elegant interface to facilitate re-use.<br />

COMPUWARE CAN HELP YOU IMPLEMENT TDD<br />

If you’re thinking of adopting TDD, it makes sense to talk to <strong>Compuware</strong><br />

Uniface. We can provide a service that includes the following:<br />

• Test runner software, as shown above<br />

• A framework for writing and running tests with assertions<br />

• Experienced consultants who can share knowledge of best<br />

practices<br />

• Test framework documentation<br />

• Low-cost implementation (typically only a 2-day engagement is<br />

required).<br />

In addition, you get to keep the source code for the test framework and<br />

test runner, so you can customize the solution if required.<br />

COMPLEMENTARY OFFERINGS<br />

When our TDD approach is combined with Continuous Integration<br />

(see separate fact sheet), all your tests can be re-run automatically<br />

whenever someone makes a change. That gives you extra confidence<br />

that changes aren’t breaking other parts of the system, and makes it<br />

easy to build releases on demand.<br />

If you’d like to know more about TDD, or about our products and<br />

services in this area, <strong>Compuware</strong> Uniface Services can help.<br />

E-mail: askuniface@compuware.com<br />

Tel: +44 (0)1628 611000<br />

To learn more, visit: www.uniface.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!