After studying this code and completing the corresponding exercises, you should be able to,
- Use High-Level Designs
[LO-HighLevelDesign]
- Use Event-Driven Programming
[LO-EventDriven]
- Use API Design
[LO-ApiDesign]
- Use Assertions
[LO-Assertions]
- Use Logging
[LO-Logging]
- Use Defensive Coding
[LO-DefensiveCoding]
- Use Build Automation
[LO-BuildAutomation]
- Use Continuous Integration
[LO-ContinuousIntegration]
Note how the Developer Guide describes the high-level design using an Architecture Diagrams and high-level sequence diagrams.
Note how the Developer Guide uses events to communicate with components
without needing a direct coupling. Also note how the EventsCenter
class acts as an event dispatcher to
facilitate communication between event creators and event consumers.
Note how components of AddressBook have well-defined APIs. For example, the API of the Logic
component
is given in the Logic.java
Resources
- A three-minutes video of designing architecture of and discovering component APIs for a Game of Tic-Tac-Toe.
Note how the AddressBook app uses Java assert
s to verify assumptions.
Resources
- Programming With Assertions - a guide from Oracle.
- How to enable assertions in Eclipse
-
Make sure assertions are enabled in Eclipse by forcing an assertion failure (e.g. add
assert false;
somewhere in the code and run the code to ensure the runtime reports an assertion failure). -
Add more assertions to AddressBook as you see fit.
Note how the AddressBook app uses Java's java.util.log
package to do logging.
Resources
- Tutorials
- Logging using java.util.logging - a tutorial by Jakob Jenkov
- Logging tutorial - a more detailed tutorial from Oracle.
- Logging best practices
Add more logging to AddressBook as you see fit.
Note how AddressBook uses the ReadOnly*
interfaces to prevent objects being modified by clients who are not
supposed to modify them.
Analyze the AddressBook code/design to identify,
- where defensive coding is used
- where the code can be more defensive
Note how the AddressBook app uses Gradle to automate build tasks.
Resources
- Tutorials
- Getting started with Gradle (Java) - a tutorial from the Gradle team
- Another tutorial - from TutorialPoint
- Use gradle to do these tasks (instructions are here) : Run all tests in headless mode, build the jar file.
- Note how the build script
build.gradle
file manages third party dependencies such as ControlsFx.
Update that file to manage a third-party library dependency.
Note how the AddressBook app uses Travis to perform Continuous Integration.
Resources
- Tutorials
- Getting started with Travis - a tutorial from the Travis team
- Set up Travis to perform CI on your own project.
{More to be added}
- Integration testing
- System testing
- Acceptance testing (+dogfooding)
- Equivalence classes
- Boundary value analysis
- Test input combination
- GUI test automation
- Design patterns
- Static analysis
- Code reviews
- Code coverage