Continuous Integration: Improving Software Quality and Reducing Risk (Virginia A Hendry's Library) by Paul Duvall & Steve Matyas & Andrew Glover
Author:Paul Duvall & Steve Matyas & Andrew Glover
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2007-12-08T16:00:00+00:00
Automate Unit Tests
People often use the term “unit test” rather broadly. This can cause confusion, especially when people start claiming their unit tests “take too long to run.” Defining a common vocabulary for developer tests can assist in categorizing them into efficient groups, which can make all the difference in creating an effective CI system capable of running fast builds.
Unit tests verify the behavior of small elements in a software system, which are most often a single class. Occasionally, though, the one-to-one relationship between a unit test and a class is slightly augmented with additional classes because the classes under test are tightly coupled.
Listing 6-1 shows a unit test written with the TestNG framework. TestNG is annotation-based, hence the @testng.test Javadoc-like comment in the starPatternTest method. This test case verifies, via Java 1.4’s assert capability, that the class RegexPackageFilter properly filters strings via a regular expression pattern.
Listing 6-1. Isolated Unit Test Using TestNG
public class RegexPackageFilterTestNG {
/**
* @testng.test
*/
public void starPatternTest() throws Exception{
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12579)
Hello! Python by Anthony Briggs(9917)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9780)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8303)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7698)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7100)
Microservices with Go by Alexander Shuiskov(6869)
Practical Design Patterns for Java Developers by Miroslav Wengner(6783)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6725)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6419)
Angular Projects - Third Edition by Aristeidis Bampakos(6138)
The Art of Crafting User Stories by The Art of Crafting User Stories(5660)
NetSuite for Consultants - Second Edition by Peter Ries(5593)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5404)
Kotlin in Action by Dmitry Jemerov(5067)
