• Complain

Nolan - Agile Android

Here you can read online Nolan - Agile Android full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA, year: 2015, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Nolan Agile Android
  • Book:
    Agile Android
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2015
  • City:
    Berkeley;CA
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Agile Android: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Agile Android" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

1. Introduction to Agile Learning objectives -- 2. Android Unit Testing Tools -- 3. Third Party Tools -- 4. Mocking Learning objectives -- 5. Dependency Injection Learning objectives -- 6. Test Driven Development Learning objectives -- 7. Dealing with Legacy Code Learning objectives.;Agile Android is a unique short but power packed book of 100-150 pages for the market that walks you through how to get unit testing and test driven development done on the Android platform - on both new and existing Android projects, specifically using JUnit 4 which is now allowed by Google to use and run. Done correctly, agile development results in a significant increase in development efficiency and a reduction in the number of defects. This book shows you how its done quickly but correctly.

Nolan: author's other books


Who wrote Agile Android? Find out the surname, the name of the author of the book and a list of all author's works by series.

Agile Android — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Agile Android" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Godfrey Nolan 2015
Godfrey Nolan Agile Android 10.1007/978-1-4842-9701-8_1
1. Introduction
Godfrey Nolan 1
(1)
MI, US
Electronic supplementary material
The online version of this chapter (doi: 10.1007/978-1-4842-9701-8_1 ) contains supplementary material, which is available to authorized users.
For a while now, Agile development has been problematic for Android developers. There have been a number of ways to test the user interface (UI), such as Robotium or Monkey Runner, but before Android Studio 1.1, unit testing was hard to use, hard to configure, and quite challenging to implement on the Android platform.
Google would argue, no doubt, that in the past you could use JUnit3-style unit testing. But for anyone from classic Java development this was a dramatic backward step in time. Developers would stumble along hacking together a JUnit4 development environment using a number of third-party tools. More likely than not they would simply give up as the ever-increasing series of mutually incompatible library dependencies would finally wear them down. Because there simply wasnt the toolbox for the Android developer, Agile development on the mobile platform was immature and reminiscent of Java development in the early 2000s.
Thankfully all this has changed - Android now supports JUnit4 and Android developers can now return to unit testing. Its early days yet in the world of Android JUnit4 testing world and the documentation is thin on the ground, so in this book were going to show practical ways to get your unit testing up and running using Android Studio. Well also look at how this can be complemented by other UI-specific Android testing libraries such as Espresso to create a complete Agile testing framework for Android developers.
Hello, World Unit Test
Before we go any further lets look at a simple unit test. For demonstration purposes we can use the Add method from the Google Calculator example, which is available from ).
Listing 1-1 . Add Method from Googles Calculator Example
public double add(double firstOperand, double secondOperand) {
return firstOperand + secondOperand;
}
Listing shows a very simple unit test, which tests if the Add method can add two numbers correctly.
Listing 1-2 . Test Method for Add Method from Calculator Example
@Test
public void calculator_CorrectAdd_ReturnsTrue() {
double resultAdd = mCalculator.add(3, 4);
assertEquals(7, resultAdd, 0);
}
Unit tests use assertions to make sure the method provides an expected result. In this case were using assertEquals to see if the Add method returns 7 when adding 3 to 4. If the test works, then we should see a positive or green result, and if it doesnt, then well see a red result in Android Studio.
Understand the Benefits of Using an Agile Approach to Android Development
If youre new to Agile development youre probably wondering how Agile can improve the development process.
At its most basic, Agile, and unit testing in particular, helps you to
  • Catch more mistakes, earlier in the development process
  • Confidently make more changes
  • Build in regression testing
  • Extend the life of your codebase
If you write unit tests and they cover a significant portion of your code then youre going to catch more bugs. You can make simple changes to tidy up the code or more extensive architectural changes, run your unit tests, and, if they all pass, be confident that you didnt introduce any subtle defects. The more unit tests you write, the more you can regression test your app whenever you change the code without fear. And once you have a lot of unit tests, then it becomes a regression test suite that allows you to have the confidence to do things you wouldnt otherwise attempt.
Unit tests mean you no longer have to program with a leave well enough alone mind-set. You can now make significant changes (changing to a new database, updating your back-end application programming interface (API), changing to a new material design theme, etc.) and be confident that your app is behaving the same as before you made the changes since all the tests execute without any errors.
Explore the Agile Testing Pyramid for Android
There are several types of tests you need in your test suite to make sure your app is fully tested. You should have Unit Tests for the component- or method-level functionality, API or Acceptance Tests for any back-end RESTful APIs, and GUI (graphical user interface) Tests for Android activities and general application workflow.
The classic Agile Test Pyramid first appeared in Succeeding with Agile by Mike Cohn ( Pearson Education, 2010). This is a good guide for the relative quantity of each type of test your app is going to need (see Figure ).
Figure 1-1 Agile Test Pyramid Create Hello World Unit Test in Android In - photo 1
Figure 1-1.
Agile Test Pyramid
Create Hello World Unit Test in Android
In the following example we show how to create our simple unit test example in Android Studio. This should return true assuming adding two numbers in the calculator Android app works correctly.
To set up and run a unit test you need to perform the following tasks:
  • Prerequisites: Android Plugin for Gradle version 1.1.x
  • Create the src/test/java folders
  • Add JUnit:4:12 dependency in build.gradle (app) file
  • Choose unit tests test artifact in Build Variant
  • Create unit tests
  • Right-click tests to run tests
Click File Project Structure and make sure the Android Plugin version is greater than 1.1. In Figure the Android Plugin version is 1.2.3 so were good to go.
Figure 1-2 Next we need to create the srctestjava folders for our unit - photo 2
Figure 1-2.
Next we need to create the src/test/java folders for our unit test code. For the moment this seems to be hard-coded to this directory. So change to Project view to see the file structure and create the folders (see Figure ). Alternatively, in Windows create the folders using the file explorer or on a Mac use the command line on a terminal window to make the changes. Dont be worried if the folders dont show up when you go back to the Android view in Android Studio. Theyll show up when we change to unit tests in the Build Variant window.
Figure 1-3 Change to Project view Add junit library to the dependencies - photo 3
Figure 1-3.
Change to Project view
Add junit library to the dependencies section in the build.gradle (app) file as shown in Figure .
Figure 1-4 Modify the buildgradle file Choose the Unit Tests test artifact - photo 4
Figure 1-4.
Modify the build.gradle file
Choose the Unit Tests test artifact in Build Variants and use the debug build (see Figure ). The test code directory should now also appear when youre in the Android view of your app.
Figure 1-5 Choose Unit Tests in Build Variant Create the Unit Tests code - photo 5
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Agile Android»

Look at similar books to Agile Android. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Agile Android»

Discussion, reviews of the book Agile Android and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.