Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dungeons & Robots Part I (Androides y Mazmorras)

Dungeons & Robots Part I (Androides y Mazmorras)

In this talk we show some tools and metrics to choose what is the best approach to refactor your application. Showing different techniques to prepare yourself before to start a refactor.

Karumi

June 21, 2016
Tweet

More Decks by Karumi

Other Decks in Technology

Transcript

  1. Androides y mazmorras. Part I (dungeons & robots) Jorge Juan

    Barroso Carmona [email protected] @flipper83 +JorgeJBarroso Android expert
  2. We embark on every project with a commitment to create

    something elegant, enduring and effective. That is our heartbeat. Our approach is uniquely simple and honest, we are a small dedicated software studio, delivering outstanding work. Karumi is the Rock Solid code software development studio.
  3. Adam Tornhill “When you see that I committed a bunch

    of buggy spaghetti last week, you know it’s because I’m a bad programmer, irresponsible and perhaps even a tad stupid. When you, on the other hand, deliver scrappy code (yes, I know - it’s a hypothetical scenario) you know it’s because you were close to a deadline, had to save the project or just intended it to be a prototype.”
  4. Pedro Ureña “La deuda técnica es como tener una tarjeta

    de crédito. Tienes que devolver el dinero y los intereses. Si tiras siempre de la tarjeta de crédito, no vas a poder pagar los intereses y estarás en bancarrota.”
  5. “I wrote that about aesthetics in discussing when you apply

    refactorings. To some extent, the situations I describe in the refactoring guidelines are fairly vague notions of aesthetics. But I try to provide more guidance than just saying, "Refactor when the code looks ugly." I say, for instance, that duplicated code is a bad smell. I say that long methods are a bad smell. Big classes are a bad smell. ” Martin Fowler
  6. File blank comment code ./android/src/main/java/com/google/samples/apps/iosched/ui/BaseActivity.java 203 175 1185 ./android/src/main/java/com/google/samples/apps/iosched/ui/SessionDetailActivity.java 178

    111 995 ./third_party/disklrucache/src/test/java/com/jakewharton/disklrucache/DiskLruCacheTest.java 113 37 881 ./android/src/main/java/com/google/samples/apps/iosched/ui/SessionsFragment.java 147 106 875 ./android/src/main/java/com/google/samples/apps/iosched/provider/ScheduleProvider.java 78 128 842 ./android/src/main/java/com/google/samples/apps/iosched/ui/SessionLivestreamActivity.java 124 125 808 ./android/src/main/java/com/google/samples/apps/iosched/ui/MapFragment.java 181 166 635 ./third_party/disklrucache/src/main/java/com/jakewharton/disklrucache/DiskLruCache.java 92 215 623 ./android/src/main/java/com/google/samples/apps/iosched/provider/ScheduleContract.java 145 277 590 ./android/src/main/assets/licenses.html 85 12 583 Cloc
  7. Watch out for classes that change frequently, it might be

    possible that a lot of people are working on it or it has too much responsibility
  8. File n-revs entity,n-revs android/build.gradle, 14 doc/BUILDING.md, 13 README.md, 9 .travis.yml

    9 Wearable/build.gradle, 6 build.gradle,6 android/src/com/google/android/apps/iosched/util/ImageWorker.java, 5 gradle/wrapper/gradle-wrapper.properties, 5 android/src/main/java/com/google/samples/apps/iosched/ui/BaseActivity.java, 5 android/src/main/res/values-it/strings.xml, 5
  9. File num-lines total media max BaseActivity.java 1360 3332 2.45 8

    SessionDetailActivity.java 1106 2898 2.62 9 MapInfoWindowAdapter.java 142 221 1.56 5
  10. File 1 File2 % couple average-rev SocialStreamFragment.java ImageFetcher.java 100 2

    SocialStreamFragment.java ImageCache.java 100 2 ImageCache.java ImageFetcher.java 100 2
  11. “If you point of me, remember you have 3 fingers

    pointing at you” Pedro Vicente Gómez
  12. Bibliography They’re the cracks! Your Code as a crime scene.

    Adam Tornhill Working Effectively with legacy code. Michael Feathers Refactoring: Improving the Design of Existing Code. Martin Fowler. Workflows of Refactoring. Martin Fowler. OOP2014. Refactorizar a patrones. Xavi Gost. Refactoring: Where Do I start?. J. B. Rainsberger.