Next Generation Java Testing: TestNG and Advanced Concepts

Valutazione media 4
( su 32 valutazioni fornite da Goodreads )
 
9780321503107: Next Generation Java Testing: TestNG and Advanced Concepts

Enterprise Java developers must achieve broader, deeper test coverage, going beyond unit testing to implement functional and integration testing with systematic acceptance. Next Generation Java™ Testing introduces breakthrough Java testing techniques and TestNG, a powerful open source Java testing platform.

Cédric Beust, TestNG's creator, and leading Java developer Hani Suleiman, present powerful, flexible testing patterns that will work with virtually any testing tool, framework, or language. They show how to leverage key Java platform improvements designed to facilitate effective testing, such as dependency injection and mock objects. They also thoroughly introduce TestNG, demonstrating how it overcomes the limitations of older frameworks and enables new techniques, making it far easier to test today's complex software systems.

Pragmatic and results-focused, Next Generation Java™ Testing will help Java developers build more robust code for today's mission-critical environments.

This book

  • Illuminates the tradeoffs associated with testing, so you can make better decisions about what and how to test
  • Introduces TestNG, explains its goals and features, and shows how to apply them in real-world environments
  • Shows how to integrate TestNG with your existing code, development frameworks, and software libraries
  • Demonstrates how to test crucial code features, such as encapsulation, state sharing, scopes, and thread safety
  • Shows how to test application elements, including JavaEE APIs, databases, Web pages, and XML files
  • Presents advanced techniques: testing partial failures, factories, dependent testing, remote invocation, cluster-based test farms, and more
  • Walks through installing and using TestNG plug-ins for Eclipse, and IDEA
  • Contains extensive code examples

Whether you use TestNG, JUnit, or another testing framework, the testing design patterns presented in this book will show you how to improve your tests by giving you concrete advice on how to make your code and your design more testable.

Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.

About the Author:

Cédric Beust, a senior software engineer at Google, is an active member of the Java Community Process who has been extensively involved in the development of the latest Java release. He is the creator and main contributor to the TestNG project.

Hani Suleiman is CTO of Formicary, a consulting and portal company specializing in financial applications. He is one of two individual members who has been elected to the Executive Committee of the Java Community Process.

Excerpt. © Reprinted by permission. All rights reserved.:

We're all in the business of software development. Code is written and then deployed. Once we've deployed the code, our customers will express pleasure or, depressingly often, displeasure.

For the last few decades, much has been written about how to minimize this displeasure. We have countless languages, methodologies, tools, management techniques, and plain old-fashioned mythology to help address this issue.

Some of these approaches are more effective than others. There has certainly been a renewed emphasis and focus on testing lately, along with the pleasures said testing would bring to developers and users alike.

Much has been written extolling the virtues of testing. It can make your code better, faster, and lighter. It can add some sorely needed spice to the drudgery of coding. It's exciting and new (and therefore worth trying), not to mention the feeling of responsibility and accountability it imparts; there's something mysteriously satisfying about adding a feature and having a test to prove you did it right.

Unfortunately, religion has also crept into the science of testing. You won't have to look far to find holy commandments or Persons of Authority handing down instructions either applauding or scolding certain testing behavior.

This book attempts to distill some of the wisdom that has emerged over the last few years in the realm of Java testing. Neither of us has ever had a job where we're paid to sell testing, nor has testing been forced on us. Neither of us works at a place where one methodology has been proclaimed the "winner" and must be followed religiously.

Instead, we're pragmatic testers. Testing to us is simply another valuable tool that helps us as part of the software development cycle. We're not particularly "test infected," the term coined by JUnit early on that's gained so much adoption. We write tests when and where it makes sense; testing is a choice and not an infectious disease for us.

As a result of this approach, we've noticed a rather large hole in our testing arsenal: Very few tools seem to be practical and to lend themselves to the sort of tests we'd like to write. The dominant force in Java testing is JUnit, and in many cases, it's easy and intuitive to think of a test we'd like to run. The main obstacle, however, ends up being the tooling and its inability to capture concepts that are second nature to us in the code we'd like to test--concepts such as encapsulation, state sharing, scopes, and ordering.

JUnit, for all its flaws, really brought the concept of testing to the forefront. No longer was it an ad hoc approach. Instead, tests now had a framework and a measure of standardization applied. JUnit-based tests could be easily automated and replayed in a variety of environments using any number of visualization tools. This ease of use encouraged its massive adoption and the increased awareness of Java testing in general.

Its success has also spilled over to a number of other languages, with ports to other languages all based on the same underlying concepts. As with any successful tool, however, the success came at a price. A subtle shift took place where instead of testing being the concern, and JUnit a tool to help achieve that, JUnit became the main focus, with testing that didn't fit in its narrow confines resulting in doubts about the test, rather than the tool.

Many will proclaim that a test that cannot be easily expressed in a simple "unit" is a flawed test. It's not a unit test since it has requirements beyond the simplistic ones that JUnit provides for. It's a functional test that happens later, after having built the unit building blocks. We find this argument perplexing, to say the least. Ultimately there is no one right way to do testing. It would be equally ridiculous to proclaim that development must start from implementing small units to completion first, before thinking of higher-level concerns. There are cases where that makes the most sense, just as there are many where it doesn't. Testing is a means to an end, and the end is better software. It's crucial to keep this in mind at all times.

Why Another Book about Testing?

This is a book about Java testing. Every chapter and section you will read in the following pages will discuss testing in some way or another. Regardless of what testing framework you use or whether you use tools that we don't cover, our goal is to show you some practices that have worked for us in some way. We also tried to draw general conclusions from our own experiences and use these to make recommendations for future scenarios that might arise.

Even though we use TestNG in this book to illustrate our ideas, we firmly believe that you will find some of it useful, whether or not you use JUnit--even if you're not programming on the Java platform. There are plenty of TestNG/JUnit-like frameworks for other languages (C# and C++ come to mind), and the ideas used in a testing framework are usually universal enough to transcend the implementation details that you will encounter here and there.

This book is about pragmatic testing. You will not find absolute statements, unfounded religious proclamations, and golden rules that guarantee robust code in this book. Instead, we always try to present pros and cons for every situation because ultimately you, the developer, are the one with the experience and the knowledge of the system you are working with. We can't help you with the specifics, but we can definitely show you various options for solving common problems and let you decide which one fits you best.

With that in mind, let's address the question asked above: Why anotherbook about testing?

There are plenty of books (some very good) about Java testing, but when we tried to look more closely, we came to the conclusion that hardly any books covered a broad topic that we found very important to our day-today job: modern Java testing.

Yes, using the adjective modern in a book is dangerous because, by nature, books don't remain modern very long. We don't think this book will be the exception to this rule, but it is clear to us that current books on Java testing do not properly address the challenges that we, Java developers, face these days. As you can see in the table of contents, we cover a very broad range of frameworks, most of which have come into existence only in the last three years.

In our research on prior art, we also realized that most books on Java testing use JUnit, which, despite its qualities, is a testing framework that has barely evolved since its inception in 2001. 1 It's not just JUnit's age that we found limiting in certain ways but also its very design goal: JUnit is a unit testing framework. If you are trying to do more than unit testing with JUnit (e.g., testing the deployment of a real servlet in an application server), you are probably using the wrong tool for the job.

Finally, we also cover a few frameworks that are quite recent and are just beginning to be adopted (e.g., Guice) but that we believe have such a such as TestNG that we just couldn't resist writing about them. Hopefully, our coverage of these bleeding-edge frameworks will convince you to give them a try as well.

Throughout the book, we have tried hard to demonstrate a pragmatic application of testing. Many patterns are captured in these pages. It's not an explicit list that we expect to be recited; rather, it's more of a group of examples to ensure you develop the right approach and way of thinking when it comes to testing code.

We achieve this through two separate approaches, the first of which is TestNG usage specifics. We discuss most of its features, explaining how and why they arose, as well as practical real-world examples of where they might be applicable. Through this discussion, we'll see how testing patterns can be captured by the framework and what goes into a robust maintainable test suite (and more importantly, what doesn't!).

The second aspect is showing how TestNG integrates with your existing code and the larger ecosystem of Java frameworks and libraries. Few of us are lucky enough to work on projects that are started completely from scratch. There are always components to reuse or integrate, legacy subsystems to invoke, or backward compatibility concerns to address. It would be equally foolish to demand redesigns and rewrites just to enable testing. Instead, we try to show how it's possible to work with existing code and how small incremental changes can make code more testable and more robust over time. Again, through this approach, a number of patterns emerge, along with more practices on how to write tests and approach testing in general.

We hope you enjoy reading this book as much as we enjoyed writing it. We feel very strongly about testing, but we feel equally strongly that it isn't a golden hammer in a world of nails. Despite what many would like to believe, there are no solutions or approaches that absolve you from the need to think and the need to understand your goals and ensure that your testing journey is a rational and well-considered one, where both the downsides and upsides have received equal consideration.

Audience

So, what is this book and who is it for? In short, it's for any Java developer who is interested in testing. We are also targeting developers who have been testing their code for quite a while (with JUnit or any other framework) but still find themselves sometimes intimidated by the apparent complexity of their code and, by extension, by the amount of effort needed to test it. With the help of the TestNG community over these years, we have made a lot of progress in understanding some of the best practices in testing all kinds of Java code, and we hope that this book will capture enough of them that nobody will ever be stuck when confronted with a testing problem.

This book uses TestNG for its code samples, but don't let that intimidate you if you're not a TestNG user: A lot of these principles are very easy to adapt (or port) to the latest version of JUnit.

Whether you use TestNG or not, we hope that once you close this book, you will have learned new techniques for testing your Java code that you will be able to apply right away.



1. JUnit 4, which came out in 2006, was the first update in five years that JUnit received, but at the time of writing, its adoption is still quite marginal, as most Java projects are still using JUnit 3.

Le informazioni nella sezione "Su questo libro" possono far riferimento a edizioni diverse di questo titolo.

I migliori risultati di ricerca su AbeBooks

Edizione Internazionale
Edizione Internazionale

1.

BEUST
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Soft cover Quantità: > 20
Edizione Internazionale
Da
University Bookstore
(DELHI, DELHI, India)
Valutazione libreria
[?]

Descrizione libro 2007. Soft cover. Condizione libro: New. This book is BRAND NEW Soft cover International edition with black and white printing. ISBN number & cover page may be different but contents identical to the US edition word by word. Book is in English language. Codice libro della libreria UN-PEA-ON-284

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 12,52
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 10,01
Da: India a: U.S.A.
Destinazione, tempi e costi

2.

Beust, CédricSuleiman, Hani
Editore: Prentice Hall
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Quantità: > 20
Da
INDOO
(Avenel, NJ, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Prentice Hall. Condizione libro: New. Brand New. Codice libro della libreria 0321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 40,46
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 2,98
In U.S.A.
Destinazione, tempi e costi

3.

Beust, C?dric
Editore: Addison-Wesley Professional
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Quantità: 1
Da
Ohmsoft LLC
(Lake Forest, IL, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional. Condizione libro: Brand New. Ships from USA. FREE domestic shipping. Codice libro della libreria 0321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 55,05
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

4.

Cedric Beust, Hani Suleiman
Editore: Pearson Education (US), United States (2008)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Paperback Quantità: 10
Da
Book Depository hard to find
(London, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Pearson Education (US), United States, 2008. Paperback. Condizione libro: New. Language: English . This book usually ship within 10-15 business days and we will endeavor to dispatch orders quicker than this where possible. Brand New Book. Enterprise Java developers must achieve broader, deeper test coverage, going beyond unit testing to implement functional and integration testing with systematic acceptance. Next Generation Java(TM) Testing introduces breakthrough Java testing techniques and TestNG, a powerful open source Java testing platform. Cedric Beust, TestNG s creator, and leading Java developer Hani Suleiman, present powerful, flexible testing patterns that will work with virtually any testing tool, framework, or language. They show how to leverage key Java platform improvements designed to facilitate effective testing, such as dependency injection and mock objects. They also thoroughly introduce TestNG, demonstrating how it overcomes the limitations of older frameworks and enables new techniques, making it far easier to test today s complex software systems. Pragmatic and results-focused, Next Generation Java(TM) Testing will help Java developers build more robust code for today s mission-critical environments. This book * Illuminates the tradeoffs associated with testing, so you can make better decisions about what and how to test * Introduces TestNG, explains its goals and features, and shows how to apply them in real-world environments * Shows how to integrate TestNG with your existing code, development frameworks, and software libraries * Demonstrates how to test crucial code features, such as encapsulation, state sharing, scopes, and thread safety * Shows how to test application elements, including JavaEE APIs, databases, Web pages, and XML files * Presents advanced techniques: testing partial failures, factories, dependent testing, remote invocation, cluster-based test farms, and more * Walks through installing and using TestNG plug-ins for Eclipse, and IDEA * Contains extensive code examples Whether you use TestNG, JUnit, or another testing framework, the testing design patterns presented in this book will show you how to improve your tests by giving you concrete advice on how to make your code and your design more testable. Codice libro della libreria BTE9780321503107

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 57,96
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

5.

Cédric Beust, Hani Suleiman
Editore: Addison-Wesley Professional (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Paperback Quantità: 1
Da
Ergodebooks
(RICHMOND, TX, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2007. Paperback. Condizione libro: New. 1. Codice libro della libreria DADAX0321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 61,47
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,40
In U.S.A.
Destinazione, tempi e costi

6.

Cédric Beust; Hani Suleiman
Editore: Addison-Wesley Professional (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Paperback Prima edizione Quantità: 1
Da
Irish Booksellers
(Rumford, ME, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2007. Paperback. Condizione libro: New. book. Codice libro della libreria 0321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 68,48
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

7.

Beust, Cédric, Suleiman, Hani
Editore: Addison-Wesley Professional (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Quantità: 1
Da
Nearfine Books
(Brooklyn, NY, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2007. Condizione libro: new. Shiny and new! Expect delivery in 20 days. Codice libro della libreria 9780321503107-1

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 65,86
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,41
In U.S.A.
Destinazione, tempi e costi

8.

Cédric Beust; Hani Suleiman
Editore: Addison-Wesley Professional (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Brossura Quantità: > 20
Da
Palexbooks
(Sanford, NC, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2007. Condizione libro: New. Brand new! Please provide a physical shipping address. Codice libro della libreria 9780321503107

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 67,94
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 2,56
In U.S.A.
Destinazione, tempi e costi

9.

Beust, Cédric, Suleiman, Hani
Editore: Addison-Wesley Professional (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Paperback Quantità: 2
Da
Murray Media
(North Miami Beach, FL, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2007. Paperback. Condizione libro: New. Codice libro della libreria P110321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 75,68
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 2,55
In U.S.A.
Destinazione, tempi e costi

10.

Beust, Cedric/ Suleiman, Hani
Editore: Addison-Wesley (2007)
ISBN 10: 0321503104 ISBN 13: 9780321503107
Nuovi Paperback Quantità: 1
Da
Revaluation Books
(Exeter, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley, 2007. Paperback. Condizione libro: Brand New. 1st edition. 483 pages. 9.00x7.00x1.25 inches. In Stock. Codice libro della libreria zk0321503104

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 74,15
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 6,71
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

Vedi altre copie di questo libro

Vedi tutti i risultati per questo libro