Skip to main content
Software Development book:
Cool subtitle here
Haris Skiadas
Contents
Search Book
close
Search Results:
No results.
Prev
Up
Next
\(\newcommand{\N}{\mathbb N} \newcommand{\Z}{\mathbb Z} \newcommand{\Q}{\mathbb Q} \newcommand{\R}{\mathbb R} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \definecolor{fillinmathshade}{gray}{0.9} \newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}} \)
Front Matter
1
Introduction
1.1
What you will learn from this book
1.1.1
Maintainable code matters
1.1.2
To Java or not to Java
1.1.3
All that Jazz
2
Java Basics
2.1
Variables and Functions
2.2
First look at classes
2.2.1
Key parts of a class
2.2.2
Class example: Linked Lists
2.3
Exercises: Identifying variables
2.3
Identifying variable types in code
3
Standard Java Classes
3.1
Standard Java Classes
3.2
The List interface and ArrayList class
3.3
The Map interface and HashMap class
3.4
Builtins example: Grades
3.5
Interlude: Java Primitives
3.6
Builtins: Practice problems
4
Programming Interlude
4.1
Grading Reporter: A small project
4.1.1
The problem
4.1.2
First solution
4.1.3
Practice
5
The elements of maintainable code
5.1
Embracing Change
5.2
Facilitating change
6
Refactoring
6.1
Introduction to refactoring
6.1.1
What is refactoring
6.1.2
What and when to refactor
6.2
The rename refactoring
6.2.1
Rules for naming
6.2.2
Mechanics of renaming refactoring
6.3
Explanatory Variables and the Introduce Variable refactoring
6.3.1
The Introduce Variable refactoring
6.3.2
Mechanics of Introduce Variable refactoring
6.4
Function Size and the Introduce Method refactoring
6.4.1
Function size
6.4.2
The Extract Method refactoring
6.4.3
Mechanics of Introduce Method refactoring
6.5
The Introduce Parameter and Inline refactorings
6.5.1
Introduce Parameter refactoring
6.5.2
Inlining refactoring
6.6
A refactoring example: Grade reporter
6.6.1
Cleaning up variable names
6.6.2
Introducing explanatory methods
6.6.3
Cleaning up the switch statement
6.6.4
Levels of abstraction
7
Basics of Object Oriented Programming
7.1
Objects and Messages
7.1.1
Objects and Messages
7.1.2
Tell, don’t ask
7.2
Lambdas and Collections
7.2.1
Lambda functions
7.2.2
Collections, loops, forEach
7.2.3
Streams, stream-processing methods
7.3
Roles, responsibilities and reasons for change
7.3.1
The Single Responsibility Principle
7.3.2
Functions have responsibilities too
7.4
Encapsulation, access modifiers, and class kinds
7.4.1
Encapsulation and access modifiers
7.4.2
Kinds of classes
7.5
Discovering classes
7.5.1
Discovering classes from code smells
7.5.2
Wrap return value refactoring
7.5.3
Introduce parameter object refactoring
7.5.4
Cleaning up: Moving methods around
7.5.5
Replace Method with Method Object refactoring
7.5.6
Breaking a class: The Extract Delegate refactoring
7.6
OOP Summary
8
Unit Testing: Trusting your code
8.1
Automated Testing
8.2
Unit Tests
8.3
Arrange, Act and Assert
8.4
A simple unit test
8.5
Clean up your tests
8.6
A more complex test example
8.6.1
Tests via wishful thinking
8.6.2
Aside: Equals method for value objects
8.6.3
Aside: Creating objects, Static Factory methods
9
Test-Driven Development
9.1
What is TDD
9.2
TDD in action
9.2.1
TDD Example: Binary search trees
9.2.2
Test 1: Empty tree
9.2.3
Red-Green-Blue
9.3
What test to do next
9.3.1
Test 2 insert at the root
9.4
More tests
9.4.1
Test 3 insert left
9.4.2
Test 4 insert right
9.4.3
Test 5 insert left-left
9.4.4
Test 6 insert left-right, right-left, right-right
9.4.5
Test 7 insert left-left-left etc
10
Interfaces
10.1
Interfaces in General
10.2
Interfaces in Programming
10.2.1
Method Signatures
10.2.2
Interface and Behavior
10.3
Java Interfaces
10.4
Programming to an Interface
10.5
Examples of Interfaces
10.5.1
Iterators and the Iterable Interface
10.5.2
Iterable example: Reading lines
10.5.3
Standard Library Interfaces
10.6
Refactoring: Extracting Interfaces
10.6.1
Mechanics of Extract Interface Refactoring
10.7
Interfaces, Decoupling, and Testing
10.8
Dependency Inversion
11
Advanced Testing
11.1
Test doubles
11.1.1
Test double classification
11.2
Manual Mocking
11.3
Mocking frameworks: Mockito
11.4
To mock or not to mock
11.5
Testing schools of thought
12
Object Extension Mechanisms
12.1
Reading Courses: Extending the Grade class
12.2
Subclasses and Inheritance
12.3
Object Composition
12.4
Comparison of Extension mechanisms
12.4.1
Basic comparison and tradeoffs
12.4.2
Has-a vs is-a relationships
12.4.3
The problem of multiple dimensions
Backmatter
Colophon
Colophon
This book was authored in PreTeXt.