Flylib.com
Agile Javaв„ў: Crafting Code with Test-Driven Development
Agile Javaв„ў: Crafting Code with Test-Driven Development
ISBN: 0131482394
EAN: 2147483647
Year: 2003
Pages: 391
Authors:
Jeff Langr
BUY ON AMAZON
Agile Java Crafting Code with Test-Driven Development
Table of Contents
Copyright
Praise for Agile Java
Robert C. Martin Series
About the Author
Foreword
Acknowledgments
Introduction
Who Is This Book For?
What This Book Is Not
How to Use This Book
Exercises
Conventions Used in This Book
An Agile Overview
What Is Agile?
What Is Java?
Why OO?
What Is an Object?
What Are Classes?
Why UML?
What Is Inheritance?
Why Test-Driven Development?
Setting Up
Software You ll Need
Does It Work?
Compiling Hello World
Executing Hello World
Still Stuck?
Lesson1.Getting Started
Testing
Design
A Simple Test
JUnit
Adding a Test
Creating a Student
Creating the Student Class
Constructors
Local Variables
Returning a Value from a Method
Assertions
Instance Variables
Summarizing the Test
Refactoring
this
private
Naming Conventions
Whitespace
Exercises
Lesson2.Java Basics
CourseSession
Enrolling Students
int
Initialization
Default Constructors
Suites
The SDK and java.util.ArrayList
Adding Objects
Incremental Refactoring
Objects in Memory
Packages and the import Statement
The java.lang Package
The Default Package and the package Statement
The setUp Method
More Refactoring
Class Constants
Dates
Overloaded Constructors
Deprecation Warnings
Refactoring
Creating Dates with Calendar
Comments
Javadoc Comments
Exercises
Lesson3.Strings and Packages
Characters and Strings
Strings
StringBuilder
System Properties
Looping through All Students
Single-Responsibility Principle
Refactoring
System.out
Using System.out
Refactoring
Package Structure
Access Modifiers
Using Ant
Exercises
Lesson4.Class Methods and Fields
Class Methods
Class Variables
Operating on Class Variables with Class Methods
Static Import
Incrementing
Factory Methods
Simple Design
Static Dangers
Using Statics: Various Notes
Jeff s Rule of Statics
Booleans
Tests as Documentation
More on Initialization
Exceptions
Revisiting Primitive-Type Field Initialization
Exercises
Lesson5.Interfaces and Polymorphism
Sorting: Preparation
Sorting: Collections.sort
CourseReportTest
Interfaces
Why Interfaces
Implementing Comparable
Sorting on Department and Number
The if Statement
Grading Students
Floating-Point Numbers
Testing Grades
Refactoring
Enums
Polymorphism
Using Interface References
ArrayList and the List Interface
Exercises
Lesson6.Inheritance
The switch Statement
Case Labels Are Just Labels
Maps
Inheritance
Abstract Classes
Extending Methods
Refactoring
Enhancing the Grade Enum
Summer Course Sessions
Calling Superclass Constructors
Refactoring
More on Constructors
Inheritance and Polymorphism
The Principle of Subcontracting
Exercises
Lesson7.Legacy Elements
Looping Constructs
Breaking Up a Student s Name
Comparing Java Loops
Refactoring
Looping Control Statements
The Ternary Operator
Legacy Collections
Iterators
Iterators and the for-each Loop
Casting
Wrapper Classes
Arrays
Refactoring
Exercises
Lesson8.Exceptions and Logging
Exceptions
Dealing with Exceptions
Checked Exceptions
Exception Hierarchy
Creating Your Own Exception Type
Checked Exceptions vs. Unchecked Exceptions
Messages
Catching Multiple Exceptions
Rethrowing Exceptions
Stack Traces
The finally Block
Refactoring
Logging
Logging in Java
Testing Logging
Logging to Files
Testing Philosophy for Logging
More on FileHandler
Logging Levels
Logging Hierarchies
Additional Notes on Logging
Exercises
Lesson9.Maps and Equality
Logical Operators
Short-Circuiting
Hash Tables
Courses
Refactoring Session
Equality
The Contract for Equality
Apples and Oranges
Collections and Equality
Hash Tables
Collisions
An Ideal Hash Algorithm
A Final Note on hashCode
More on Using HashMaps
Additional Hash Table and Set Implementations
toString
Strings and Equality
Exercises
Lesson10.Mathematics
BigDecimal
More on Primitive Numerics
Integer Math
Numeric Casting
Expression Evaluation Order
NaN
Infinity
Numeric Overflow
Bit Manipulation
java.lang.Math
Numeric Wrapper Classes
Random Numbers
Exercises
Lesson11.IO
Organization
Character Streams
Writing to a File
java.io.File
Byte Streams and Conversion
A Student User Interface
Testing the Application
Data Streams
CourseCatalog
Advanced Streams
Object Streams
Random Access Files
The Student Directory
sis.db.DataFileTest
Static Nested Classes and Inner Classes
sis.db.DataFile
sis.db.KeyFileTest
sis.db.KeyFile
sis.util.IOUtilTest
sis.util.IOUtil
sis.util.TestUtil
Developing the Solution
Exercises
Lesson12.Reflection and Other Advanced Topics
Mock Objects Revisited
The Jim Bob ACH Interface
The Mock Class
The Account Class Implementation
Anonymous Inner Classes
Adapters
Accessing Variables from the Enclosing Class
Tradeoffs
Reflection
Using JUnit Code
The Class Class
Building the Suite
Class Modifiers
Dynamic Proxy
A Secure Account Class
Building the Secure Account Solution
The SecureProxy Class
Problems With Reflection
Exercises
Lesson13.Multithreading
Multithreading
Search Server
The Search Class
Less Dependent Testing
The Server
Waiting in the Test
Creating and Running Threads
Cooperative and Preemptive Multitasking
Synchronization
Creating Threads with Runnable
Synchronized
Synchronized Collections
BlockingQueue
Stopping Threads
WaitNotify
Additional Notes on wait and notify
Locks and Conditions
Thread Priorities
Deadlocks
ThreadLocal
The Timer Class
Thread Miscellany
Summary: Basic Design Principles for Synchronization
Exercises
Lesson14.Generics
Parameterized Types
Collection Framework
Multiple Type Parameters
Creating Parameterized Types
Erasure
Upper Bounds
Wildcards
Implications of Using Wildcards
Generic Methods
Wildcard Capture
Super
Additional Bounds
Raw Types
Checked Collections
Arrays
Additional Limitations
Reflection
Final Notes
Exercises
Lesson15.Assertions and Annotations
Assertions
The assert Statement vs. JUnit Assert Methods
Annotations
Building a Testing Tool
TestRunnerTest
TestRunner
The TestMethod Annotation
Retention
Annotation Targets
Skipping Test Methods
Modifying TestRunner
Single-Value Annotations
A TestRunner User Interface Class
Array Parameters
Multiple Parameter Annotations
Default Values
Additional Return Types and Complex Annotation Types
Package Annotations
Compatibility Considerations
Additional Notes on Annotations
Summary
Exercises
Additional Lesson I: Swing, Part 1
Swing
Getting Started
Swing Application Design
Panels
Refactoring
More Widgets
Refactoring
Button Clicks and ActionListeners
List Models
The Application
Layout
GridBagLayout
Moving Forward
Additional Lesson II: Swing, Part 2
Miscellaneous Aesthetics
Feel
Tables
Feedback
Responsiveness
Remaining Tasks
Final Notes
Additional Lesson III: Java Miscellany
JARs
Regular Expressions
Cloning and Covariance
JDBC
Internationalization
Call by Reference versus Call by Value
Java Periphery
What Else Is There?
AppendixA.An Agile Java Glossary
AppendixB.Java Operator Precedence Rules
AppendixC.Getting Started with IDEA
IDEA
The Hello Project
Running Tests
Taking Advantage of IDEA
Agile Java References
Index
SYMBOL
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Agile Javaв„ў: Crafting Code with Test-Driven Development
ISBN: 0131482394
EAN: 2147483647
Year: 2003
Pages: 391
Authors:
Jeff Langr
BUY ON AMAZON
CISSP Exam Cram 2
Auditing Your Security Infrastructure
Single Sign-On
Exam Prep Questions
Answers to Exam Prep Questions
Answer Key
Certified Ethical Hacker Exam Prep
Ethical Hackers
An Overview of TrojansThe History of Trojans
History of Cryptography
System Hacking
Denial of Service
Systematic Software Testing (Artech House Computer Library)
The Test Organization
Improving the Testing Process
Appendix B Testing Survey
Appendix C IEEE Templates
Appendix E Simplified Unit Test Plan
MySQL Cookbook
Specifying Input Column Order
Exporting Table Contents or Definitions in SQL Format
Sequencing an Unsequenced Table
Converting Subselects to Join Operations
Counting and Identifying Duplicates
Logistics and Retail Management: Emerging Issues and New Challenges in the Retail Supply Chain
Relationships in the Supply Chain
The Internationalization of the Retail Supply Chain
Logistics in Tesco: Past, Present and Future
Temperature-Controlled Supply Chains
Rethinking Efficient Replenishment in the Grocery Sector
Comparing, Designing, and Deploying VPNs
Configuring and Verifying L2TPv3 Pseudowires
Benefits and Drawbacks of AToM-Based L2VPNs
MTU and Fragmentation Considerations in an IPsec VPN
Integrating L2TP Remote Access VPNs with MPLS VPNs
flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net
Privacy policy
This website uses cookies. Click
here
to find out more.
Accept cookies