In Test Driven Android Development, we discuss how good Object Oriented Design and Test Driven Design are complementary. We create a simple JUnit test, using a stub object that represents a data feed. Next, we demonstrate how to write a test driven design unit test for a Java class that performs network operations. After that, we create a unit test for a data access object that uses a JSON data feed. Our test includes JUnit 4 asserts and Hamcrest-style asserst. Then, we discuss blockers that prevent us from writing unit tests, and how we can use Mockito, code coverage, and automatic test execution to ameliorate those blockers. Finally, we look at UI testing with Espresso, and multi-platform testing with Firebase.
About The Author
Brandan Jones has been an Adjunct Assistant Professor for the
University of Cincinnati since the 2000-2001 school year. He has taught
many courses in programming, from introductory programming to full
stack development.
Brandan proposed and created the first Android programming course at
the University of Cincinnati, and has been teaching it ever since. He
reapplied this course and taught it at Northwestern University’s School
of Continuing Studies as well.
Brandan is the creator of the Android app PlantPlacescom Mobile,
which allows users to search for plants by color, and GPS plants. He
wrote this app in 2012, using TDD principles. He used selected JSON
feeds from that app in the examples in this video course.
Brandan’s mix of both academic and professional experience means that
he brings real-world concepts to the classroom. Most of his high level
classes include hands on experience with unit testing, scrum, and
distributed version control systems.
Brandan holds a BS in Accounting and Management Information Systems
from Miami University in Oxford, Ohio. He also earned a BS in
Horticulture from the University of Cincinnati’s College of Design, Art,
Architecture and Planning, and a Masters of Business Administration
from the University of Cincinnati, Lindner College of Business, with
concentrations in Operations Management and Real Estate Finance.